 (set! *warn-on-reflection* true)
 (set! *unchecked-math* true)
 
-;; Bunch of math constants
+;; ## Math functions
+;;
+;; FastMath functions type hinted wrapped in processing function (to allow composition etc.).
+;; All functions operate and return `double` or in some cases `long`.
+
+;; Processing math constants
 (def ^:const ^double PI Math/PI)
 (def ^:const ^double HALF_PI (/ PI 2.0))
 (def ^:const ^double QUARTER_PI (/ PI 4.0))

         (+ mn (next-random-value-double r diff))))))

(defn next-random-value-gaussian
  ""
  (^double [^RandomGenerator r] (.nextGaussian r))
  (^double [^RandomGenerator r ^double mx] (* (.nextGaussian r) mx))
  (^double [r ^double mn ^double mx]

(defn smoothstep
  "GL smoothstep"
  ^double [^double start ^double stop ^double x]
  (let [t (norm x start stop)]
    (* t t (- 3.0 (* 2.0 t)))))

;;`(wrap 0 -1 1) => 0.0`  
