-near point, far point, total dof, magnification, blur size at infinity (mm).
-Circle of confusion can either be a number or keyword designating format."
- (let* ((aperture (/ focal-length f-stop))
- (numerator-1 (* (- pupil-factor 1) (- distance focal-length)
- coc focal-length))
- (numerator-2 (* pupil-factor aperture focal-length distance))
- (denominator-1 (* pupil-factor coc (- distance focal-length)))
- (denominator-2 (* pupil-factor aperture focal-length))
- (near (/ (+ numerator-1 numerator-2)
- (+ denominator-1 denominator-2)))
- (far (/ (- numerator-1 numerator-2)
- (- denominator-1 denominator-2)))
+near dof, far dof, total dof, magnification, blur size at infinity (mm).
+Circle of confusion can either be a number or keyword designating format.
+Reference: http://www.vanwalree.com/optics/dofderivation.html"
+ (let* ((aperture (/ focal-length f-stop))
+ (pd (* aperture pupil-factor))
+ (numerator (* coc (- distance focal-length) (+ focal-length (* pupil-factor (- distance focal-length)))))
+ (d1 (* pupil-factor coc (- distance focal-length)))
+ (d2 (* pd focal-length))
+ (front-dof (/ numerator (+ d1 d2)))
+ (rear-dof (/ numerator (- d1 d2)))