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

Functions for DOF, hyperfocal distance and Bokeh.

startDOF, endDOF: computes depth of field (DOF) DOF: prints ranges of DOF hyperfocal: computes hyperfocal distance bokeh: computes quality of Bokeh (blurriness at infinity)

lens: prints various parameters for a specific lens

For another calculator:

See: https://www.photopills.com/calculators/dof

functionendDOF(D, L, A, c=0.03mm, ff=1, inf=NAN)

Far limit of DOF If the lens is sharp to infinity the result will be inf. D : focussed distance in m L : film equivalent focal length in m A : film equivalent aperture (F-stop times ff) c=0.03mm : accepted blurriness radius ff=1 : form factor inf=NAN : default value for inifinity See:

startDOF (Depth of Field of an Ideal Lens)

functionstartDOF(D, L, A, c=0.03mm, ff=1)

Near limit of DOF D : focussed distance in m L : film equivalent focal length in m A : film equivalent aperture (F-stop times ff) c=0.03mm : accepted blurriness radius ff=1 : form factor See:

endDOF (Depth of Field of an Ideal Lens)

functionDOF(D:real vector, L:real vector, A:real vector, c:real vector=0.03mm, ff:real vector=1, inf=NAN)

DOF interval 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,[28mm,35mm,50mm,85mm],8) 1.80512 NAN 2.25122 17.9225 2.90023 6.4433 3.53967 4.59796 See:

endDOF (Depth of Field of an Ideal Lens),

startDOF (Depth of Field of an Ideal Lens)

functionhyperfocal(L, A, c=0.03mm, ff=1)

Hyperfocal distance L : film equivalent focal length of the lens A : filrm equivalent aperture (F-stop times ff) c : accepted radius of blurriness ff : form factor 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)

functionbokeh(D, L, A, ff=1)

Computes the Bokeh Bokeh is the diameter of the circles of diffusion divided by the diameter of the image.