r10440: add tables
[cl-photo.git] / fov.lisp
index 23ca941d517f28b73f5a0b96ac81107442ba7e76..572a55b256652cd2e2dad18d4351de7f3fbdd6c1 100755 (executable)
--- 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)