 ;;(integral-abstracted (hash-map :corrected-max-camber 0 :corrected-position-camber 0 :corrected-thickness 0.45) upper-surface-y-function left-rule 100)
 
 ;(upper-surface-y-function (hash-map :corrected-max-camber 0 :corrected-position-camber 0.5 :corrected-thickness 0.45) 0)
-
-
-
-
-
-

       (* (thickness-function individual x)
          (Math/cos (Math/atan (gradient-function individual x)))))))

;;;---------------- Derivative -------------------
(defn derivative
  "takes an individual, a function, and an x and returns a derivative at that point

     (simpson-integral individual adjusted-lower-function 90)))

;;;---------------- Coefficantof lift ----------------
(defn symetric-coefficient-of-lift
  [individual run-constants]
  (let [attack-angle (run-constants :angle-of-attack)
        camber-position (individual :corrected-position-camber)]
    (* (* 2 (Math/PI))
       (+ attack-angle (* 2 camber-position)))))

(defn cambered-coefficient-of-lift
  [individual run-constants]
  (let [attack-angle (run-constants :angle-of-attack)
        theta-switch-constant (theta-switch individual)]
    (- (* 2 (Math/PI))
       (* 2 (+ (integral-production individual gradient-forward-polar-function 0 theta-switch-constant (/ theta-switch-constant 90) 90)
               (integral-production individual gradient-aft-polar-function theta-switch-constant (Math/PI) (/ theta-switch-constant 90) 90))))))


(defn coefficient-of-lift
  [individual run-constants]
  (let [max-camber (individual :max-camber)]
    (if (== max-camber 0)
      (symetric-coefficient-of-lift individual run-constants)
      (cambered-coefficient-of-lift individual run-constants))))



