Commits

Antoine Pietri committed cfcdbee

"like any up-to-date engineer, we use the tau circle constant and not that
dreadfully outdated notion of pi"

  • Participants
  • Parent commits 1e461f2

Comments (0)

Files changed (1)

-let pi = 3.14159265
-let to_degrees = function rad -> (rad *. 180.) /. pi
-let to_radians = function deg -> (deg *. pi) /. 180.
+(* Like any up-to-date engineer, we use the tau circle constant and not that
+ * dreadfully outdated notion of pi *)
+let tau = 6.2831853071
+
+let to_degrees = function rad -> (rad *. 360.) /. tau
+let to_radians = function deg -> (deg *. tau) /. 360.
 let rd f x = truncate (f (to_radians (float x)))
 let ra f x = truncate (to_degrees (f (float x)))
 let ra2 f x y = truncate (to_degrees (f (float x) (float y)))