X-Git-Url: http://git.kpe.io/?p=cl-photo.git;a=blobdiff_plain;f=fov.lisp;h=572a55b256652cd2e2dad18d4351de7f3fbdd6c1;hp=23ca941d517f28b73f5a0b96ac81107442ba7e76;hb=4c11fbdc404582b4b8590dca68e80db9f19a77b2;hpb=3c1c551f36fe090936bf5d21e7eb65acbcc0d457 diff --git a/fov.lisp b/fov.lisp index 23ca941..572a55b 100755 --- a/fov.lisp +++ b/fov.lisp @@ -53,7 +53,9 @@ Default is infinity (magnification 0)" (defun image-distance (focal-length object-distance) "Returns the image distance for a focused object at distance using the Gaussian Lens Equation." - (float (/ 1 (- (/ 1 focal-length) (/ 1 object-distance))))) + (if (= focal-length object-distance) + 0 + (float (/ 1 (- (/ 1 focal-length) (/ 1 object-distance)))))) (defun fov (focal-length frame-width frame-height object-distance &key (projection :rectilinear)) @@ -70,7 +72,7 @@ Lens Equation." (defun aov-format (focal-length format &key (projection :rectilinear)) "Returns the angle of field of view for a focal length and frame size at infinity" - (let ((dim (format-dimensions format))) + (let ((dim (imager-dimensions format))) (aov focal-length (car dim) (cdr dim) :projection projection))) (defun magnification (focal-length distance)