+ (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)))
+ (mag (float (/ focal-length (- distance focal-length))))
+ (infinity-blur-diameter (/ (* mag focal-length) f-stop))
+ (depth (- far near)))
+ (values near far depth mag infinity-blur-diameter)))
+
+;; Simplified calculation for symmetric lens
+(defun dof-symmetric-mm (focal-length f-stop distance coc)
+ "Returns depth of field based on focal-length, f-stop, distance, and coc.
+Six values are returned:
+near dof, far dof, total dof, near point, far point, magnification,
+blur size at infinity (mm).
+Circle of confusion can either be a number or keyword designating format.
+Pupil factor is the ratio of the exit to enterance pupil diameters."
+ (let* ((aperture (/ focal-length f-stop))