## Derivation of Lens Depth of Field

The diagram above depicts a point object at a distance 'u' in front of a lens of aperture 'a' and focal length 'f'; the image is in focus on the sensor at 'v' behind the lens. A point object at the near focus distance 'n' would focus 'm' behind the lens but actually forms a circular image of diameter 'c' on the sensor (the circle of confusion).

From the thin lens equation,

By similar triangles,

Substituting for m from (3) into (2),

Substituting for 1/v from (1),

Expanding,

Hence,

Or, arranging with common denominator,

Hence,

By similar arithmetic (not written out here), the far focus distance is given by,

Finally, the depth of field is the distance between the near and far focus distance,

Which rearranges to,

We can simplify this down by reference to the hyperfocal distance H. If we set the focus ‘u’ to the hyperlocal distance ‘H’, the DOF tends to infinity, so the denominator of (4) above reduces to zero. Hence,

Substituting for ‘fa’ in (4),

In everyday use, when considering DOF, the focus distance will often be well above the focal length (i.e. not macro) and well below the hyperfocal distance. Applying u >> f,

And applying H >> u,

Now expressing aperture ‘a’ in terms the f/number ’N’, i.e. ‘a = f / N’ and substituting into (5),

And the depth of field becomes,

In conclusion, for medium distances well above macro and below the hyperfocal distance, the depth of field is approximately proportional to the aperture and the circle of confusion. It increases with the square of distance and decreases with the square of focal length.