Size of Focussed Disk after light passes through lens onto screen

So I'm not sure about the exact physics behind this, but as far as I know when a camera takes a picture the points that are 'in focus' seem to be because all the light from that point will form a disk which is approximately the size of one pixel on the sensor, and similarly for points which are 'out of focus.' This is of course once the light has passed through the lens of the camera.

So basically I am looking for the equation of the size of the disk as a function of how far the light source is from the lens.

If your lens has diameter $D$ and focal length $f$, and you are out of focus by $\delta d$, then from similar triangles it follows that the spot has a diameter
$$d = \frac{\delta d D}{f}$$
• Just added a diagram. Note that $f$ is the distance at which the point of interest is in focus: when you are focusing something that is not at infinity, that point will be a bit further from the lens than the nominal focal distance. I hope that makes sense. – Floris Jan 28 '17 at 17:52