X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;ds=sidebyside;f=fov.lisp;h=23ca941d517f28b73f5a0b96ac81107442ba7e76;hb=3c1c551f36fe090936bf5d21e7eb65acbcc0d457;hp=9b5ac79d1e8acc1216cee3663899ad01ab2e5228;hpb=4779a391e5c45e56ea3cb2c35787354f07e6d362;p=cl-photo.git diff --git a/fov.lisp b/fov.lisp index 9b5ac79..23ca941 100755 --- a/fov.lisp +++ b/fov.lisp @@ -50,14 +50,15 @@ Default is infinity (magnification 0)" (aov-one-dim focal-length (diagonal frame-width frame-height) :projection projection :magnification magnification))) -(defun gaussian-lens (focal-length object-distance) - "Returns the image distance for a focused object at distance." +(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))))) (defun fov (focal-length frame-width frame-height object-distance &key (projection :rectilinear)) "Returns the field of view and image magnificaion ratio at a given distance." - (let* ((image-distance (gaussian-lens focal-length object-distance)) + (let* ((image-distance (image-distance focal-length object-distance)) (magnification (/ image-distance object-distance))) (multiple-value-bind (aov-width aov-height aov-diagonal) (aov focal-length frame-width frame-height :projection projection @@ -71,3 +72,12 @@ Default is infinity (magnification 0)" "Returns the angle of field of view for a focal length and frame size at infinity" (let ((dim (format-dimensions format))) (aov focal-length (car dim) (cdr dim) :projection projection))) + +(defun magnification (focal-length distance) + "Returns the image magnification: the ratio of image size to objecct size." + (float (/ focal-length (- distance focal-length)))) + +(defun bellows-factor (focal-length distance) + "Returns the bellows factor, the ratio of effective aperature to actual aperture." + (1+ (magnification focal-length distance))) +