# How to calculate the correct focal length needed for a subject of a given size and distance?

I need to purchase my first ever lens. So far I've only used lenses that were built into a camera. This specific lens is for the BlackMagic Deign Pocket Cinema Camera (a video only camera, but one that uses photography lenses). I would prefer this to be a prime lens.

I have tried to find the exact way to calculate the focal length of the lens I need but I have not been able to find a good resource to make this simple enough for my limited optics knowledge. Can you please explain a simple way to calculate the focal length of a lens given the following inputs as an example:

I would prefer a simplified mathematical explanation so that I may use it to make similar determinations in the future using a "plug and chug" method.

I have found this answer. Using that method, I came up with:

``````Required lens focal length = 7.02mm sensor height x (77in / 36in) = 15mm
``````

Is that correct?

• Suppose you want to frame an object of size `a` at distance `l`. Then, roughly, `a/l = s/f` where `s` is the sensor size and `f` is the focal length. Dec 31, 2014 at 22:21
• @Szabolcs Thanks! So does 36/77 = 7.02/f sound right? Solving for f I get 15.015mm.
– user35614
Dec 31, 2014 at 22:40

## 1 Answer

What you did looks correct, you are using a form of h=f*tan(theta) which is used a lot in optical design. Usually one would use half the vertical sensor size (7.02/2 = 3.51) and half the height of the object(91/2 = 45.5), but in this case it doesn't matter.

It is important to note that this equation assumes some things, mostly that the axis of the lens is pointed at the person's shoulder area in the "desired result" frame that you gave, though the result holds if you depart from that a little bit.