   ;;(:require [clojure.algo.generic.math-functions :as trig])
   )
 
+;;---------------- Utilities ---------------
+(defn round-double
+  "Takes a double and returns a double with four points of accuracy"
+  [n]
+  (double (/ (int (+ (* n 10000) 0.5)) 10000)))
+
+
+;;---------------- NACA Functions ---------------
 (defn thickness-function
   "Take a corrected thickness and returns the function of thickess around the camber line.
   The thickness equation is (T/.2)(a-0x^.5 + a-1x + a-2x^2 + a-3x^3 + a-4x^4)

  (theta =  atan(G)), x + thickness-function * sin(theta)."
  [individual x]
  (let [thickness (individual :corrected-thickness)]
  (+ x (* (thickness-function thickness x)
          (Math/sin (Math/atan (gradient-function individual x)))))))



  (theta =  atan(G)), camber-function + thickness-function * cos(theta)."
  [individual x]
  (let [thickness (individual :corrected-thickness)]
    (+ camber-function (* (thickness-function thickness x)
                        (Math/cos (Math/atan (gradient-function individual x)))))))


