$$ D = \frac{f\times H}{h} $$ where
$$ \begin{align} D &= \textrm{distance from lens to object} \\ (d &= \textrm{distance from lens to 35mm film}) \\ f &= \textrm{focal length} \\ H &= \textrm{height of object} \\ h &= \textrm{height of object's image on 35mm film} \end{align} $$
I've seen some form of this equation in several places including these two threads:
- How do I calculate the distance of an object in a photo?
- Is the formula for object image size given focal length, etc. independent of sensor size?
The problem I'm having is with \$f\$. From the magnification for a thin lens:
$$ M = \frac{D}{d} = \frac{H}{h} = \frac{f}{f-D} $$
I can't figure out how to arrive at \$D = f\cdot H/h\$.