r10463: update cameras
[cl-photo.git] / fov.lisp
old mode 100755 (executable)
new mode 100644 (file)
index 23ca941..572a55b
--- 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)