(* Trigonometric functions using degrees *) let pi = 3.14159265358979323846 let degrees_to_radians = pi /. 180.0 let radians_to_degrees = 180.0 /. pi let deg_cos a = cos (a *. degrees_to_radians) let deg_sin a = sin (a *. degrees_to_radians) let deg_acos x = acos x *. radians_to_degrees let deg_asin x = asin x *. radians_to_degrees (* Internalization of strings (unique representatives) *) let intern_table = (Hashtbl.create 37 : (string, string) Hashtbl.t) let intern s = try Hashtbl.find intern_table s with Not_found -> Hashtbl.add intern_table s s; s let fudge_factor = ref 0.0;; let set_fudge_factor x = fudge_factor := x;; let fudge x = if !fudge_factor = 0.0 then x else x *. (1. -. Random.float !fudge_factor) ;; (* positive infinity *) let pos_infty = 1.0 /. 0.0