Browse Source

Add math constants

David Peter 2 years ago
parent
commit
fe28a60082
2 changed files with 4 additions and 1 deletions
  1. 3 0
      modules/math/constants.nbt
  2. 1 1
      modules/prelude.nbt

+ 3 - 0
modules/math/constants.nbt

@@ -2,7 +2,10 @@
 
 let pi = 3.14159265358979323846264338327950288
 let π = pi
+let τ = 2 π
 let e = 2.71828182845904523536028747135266250
+let φ = (1 + sqrt(5)) / 2
+let golden_ratio = φ
 
 ### Named numbers
 

+ 1 - 1
modules/prelude.nbt

@@ -1,8 +1,8 @@
 use core::scalar
 use core::dimensions
 
-use math::constants
 use math::functions
+use math::constants
 use math::partsperx
 
 use units::si