Depth of Focus, DOF≈B’*f/# where B’ is the blur diameter criterion (for my camera it’s about 4.5 microns — the size of one pixel). The f/# represents the size of the aperture, or the angle of the cone of light converging on the sensor. So a wider aperture (smaller f/#) gives a wider cone of light and smaller DOF. But this is only an approximation.
What I’m really interested in here is the depth of field. Similar but very different. DOF, is in image space and is the depth of the image that is in focus (usually on the order of microns for most digital cameras). Depth of field is in object space and can vary widely from a few microns to infinity, and beyond. Depth of field is a function of the entrance pupil diameter, the focal length of the lens, and the distance from the lens to the object.
Everybody else already knew that, right? I knew it on some kind of level. I could tell you when I took macro photographs that the reason my depth of field is so narrow is because I was too close. Until I saw a formula, however, it didn’t really dawn on me that I could fix that. If I close up the aperture when I get closer I can get the whole flower in focus.
It’s just how my mind works. Even art is a science.