When taking pictures with a camera (film or digital) where you have a choice of lenses to use (different focal lengths), you often may want to make a decison at least partly based on the size of the scene you wish to capture, and/or the distance you are (or will be) from the scene that you wish to shoot. The following are 3 formulas (really the same formula written 3 different ways) which are helpful to make some calculations based on these variables.

1) distance_to_subject = [ focal_length_of_lens x scene_dimension (width or height) ] / sensor_dimension (width or height)

2) focal_length_of_lens = [ distance_to_subject x sensor_dimension (width or height) ] / scene_dimension (width or height)

3) scene_dimension (width or height) = [ distance_to_subject x sensor_dimension (width or height) ] / focal_length_of_lens

Note that all values in the above equations must be in the same unit of measurement - I typically calculate everything in millimeters and then convert back and forth to feet as needed.

Note the above equations are acurate enough for typical photography scenarios. (My understanding is that the equations are a somewhat simplified version of the true equations.) Values may not be entirely acurate for special situations such as using unusually large or small lenses, or using specialty lenses such as Macro, fish-eye, or Tilt-Shift. Also note that all lenses have a certian mininum focusing distance, and these calcluations do not take that into consideration. For example, a typical 50 mm lens is not going to let you focus on something closer than about 1.5 feet (unless it happens to be a Macro lens).

For the purpose of all these examples, let's assume you have either a 35mm film camera, or a "full frame" digital camera where the sensor has the same size as 35mm film - that size is 36mm wide x 24mm tall. And for simplicity, I will assume only prime lenses (fixed focal length) for these examples.

1a) Suppose you have a 50mm focal length lens. You want to take a portrait shot of your friend. You want to photograph your friend's head and upper body - say an area of 3 feet tall by 2 feet wide. (I've chosen this ratio to match the 3:2 ratio of a typical "full frame" sensor.) So the question you want to answer is given the lens you have and the area you want to capture, how far should you position your camera/tripod from your friend?

We will use equation 1 from above. We will assume the camera will be held in a vertical position for this shot,
so what is normally the sensor width will actually be the sensor height for this example.

focal_length_of_lens = 50 mm

scene_height = 3 feet → 914.4 mm

sensor_height = 36 mm

distance_to_subject = (50 mm x 914.4 mm) / 36 mm = 1,270 mm = 4.17 feet

1b) Let's change one variable in the equation - suppose you have an 85 mm lens instead of 50 mm.
Now how far away should you position the camera to capture the same scene area (3 feet by 2 feet)?

focal_length_of_lens = 85 mm

scene_height = 3 feet → 914.4 mm

sensor_height = 36 mm

distance_to_subject = (85 mm x 914.4 mm) / 36 mm = 2,159 mm = 7.08 feet

1c) Let's go back to the 50m lens, but this time suppose we want to capture your friend from head to toe.
How far away should you position the camera to capture a 6 foot tall by 4 foot wide area?

focal_length_of_lens = 50 mm

scene_height = 6 feet → 1,828.8 mm

sensor_height = 36 mm

distance_to_subject = (50 mm x 1828.8 mm) / 36 mm = 2,540 mm = 8.33 feet

Suppose you want to photograph some friends playing soccer. You will be standing on the sideline of the soccer field and you estimate that your friends will be about 40 yards away. You want to capture an area of about 20 feet wide. Given these parameters, what is a good focal length of lens for you to use?

We will use equation 2 from above. We will assume the camera will be held in horizontal position
for this shot.

distance_to_subject = 40 yards → 36,576 mm

sensor_width = 36 mm

scene_width = 20 feet → 6,096 mm

focal_length_of_lens = (36,576 mm x 36 mm) / 6,096 mm = 216 mm

Now of course in reality, your friends will not always be exactly 40 yards away if they
are running up and down the soccer field. You may have to compensite by some combination
of moving yourself up and down the sideline, and perhaps by using a zoom lens,
say 100 to 300 mm, using that initial calucation of 216 mm as a guideline.

Be consistent with scene dimension and sensor dimension - if you put width for one then put width for the other - if you plan on holding the camera in a vertical position then treat the width as the height and vice-versa.