iconEuler Reference

Depth of Field of an Ideal Lens

Load with "load dof.e", help with "help dof.e", see the user menu for snippets.

function enddof (d, f, cf, a, c=0.00002)
  Far limit of DOF
  
  If the lens is sharp to infinity the result will be negative.
  
function startdof (d, f, cf, a, c=0.00002)
  Near limit of DOF
  
function dof (d:real vector, f:real vector,
    cf:real vector, a:real vector, c:real vector=0.00002,
    infinity=NAN)
  DOF interval
  
  d : focussed distance
  f : focal length of lense (relative to film)
  cf : crop factor (f/cf then is the true focal length)
  a : aperture (F stop)
  c : acceptable blur radius (0.00002 is the industry standard)
  infinity : Use for infinity
  
  If the lens is sharp to infinity the result will be negative.
  
  Returns a 1x2 vector containing the bounds of the interval. If one
  of the inputs is a vector the result is a nx2 vector of interval
  bounds.
  
  >dof(4m,18mm,1.5,[2,4,8,16])
  2.30081       15.2975
  1.61483           NAN
  1.01161           NAN
  0.579026           NAN
  
  See: 
enddof (Depth of Field of an Ideal Lens),
startdof (Depth of Field of an Ideal Lens),
hyperfocal (Depth of Field of an Ideal Lens),
coc (Depth of Field of an Ideal Lens)
function hyperfocal (f, cf, a, c=0.00002)
  Hyperfocal distance
  
  f : focal length of lense (relative to film)
  cf : crop factor (f/cf then is the true focal length)
  a : aperture (F stop)
  
  The lense will be acceptably sharp from the hyperfocal distance
  divided by 2 to infinity.
  
  >hyperfocal(18mm,1.5,[2,3,8,16])
  [5.412,  3.612,  1.362,  0.687]
  
  See: 
dof (Depth of Field of an Ideal Lens)
function coc (od, d, f, cf, a)
  Circle of Confusion
  
  od : object distance
  d : focussed distance
  f : focal length of lense (relative to film)
  cf : crop factor (f/cf then is the true focal length)
  a : aperture (F stop)
  
  See: 
dof (Depth of Field of an Ideal Lens),
hyperfocal (Depth of Field of an Ideal Lens)

Documentation Homepage