Introduction

Introduction to f/Calc

What It Does

f/Calc is a small utility for photographers that calculates various lens formulæ. Currently, it understands how to calculate the following:

  • "f number" arithmetic
  • depth of field
  • hyperfocal distance
  • field of view
  • angle of view
  • magnification
  • spot meter angles

All you have to do to use it is tell the program a few things about the situation, like the focal length of the lens in question, and the film size you're using.

The program is also fairly intelligent. If you enter a value in one location, such as the distance to the subject, all parts of the program will use that new value, so that you can calculate several different things, without having to reenter these values in each part of the program. Also, the program recalculates the answers every time you change a field, so you can easily try many different values to see what effect changing the inputs has.

Other Places to Go

    Future Features
    License
    Credits and Acknowledgements


f Number Arithmetic

The "f Numbers" tab lets you perform arithmetic on "f numbers", also known as "aperture values." Currently, this tab understands two different calculations:

  1. 'f2' as 'f1' plus 'stops': This calulcation lets you add an arbitrary number of "f stops" to an arbitrary aperture value. Most SLR users know that f/2.8 plus two stops is f/5.6, but what is f/2.8 plus three and a half stops? (Answer: About f/9.4.)
  2. 'stops' as 'f2' minus 'f1': This calculation lets you find out how far apart two aperture values are, in stops. This is especially useful when comparing variable-aperture zoom lenses, since these often do not use "even" aperture values. For example, Canon makes a very popular 28-105mm f/3.5-4.5 lens. Clearly, f/3.5 is slower than f/2.8, but by how much? (Answer: Roughly two thirds of a stop.)

In the second calculation, you can also choose to have the 'stops' value rounded off to the nearest 1/6 of a stop. Why 1/6? Because both 1/2 and 1/3 stop increments are popular; 1/6 covers both ranges.

About f Numbers

f numbers, or aperture values, are a measurement of the size of the hole that the light passes through in the rear of a lens. The smaller the f number, the more light gets through the lens. Each additional "f stop" means that half as much light gets through the lens. So, at f/2, twice as much light gets through the lens as when you set that same lens at f/2.8.

f numbers are a fraction of the focal length of the lens. That is, f/2.8 on a 50mm lens is 1/2.8 of 50mm, or about 18mm in diameter. (This is why you sometimes see f numbers written as a ratio, like 1:2.8.)

The term "stops" comes from the early days of photography, when photographers would place thin wooden panels with holes cut in them between the lens and the film (photographic plates, actually), to "stop" a certain amount of light from reaching the photographic plates.

Formulæ Used

f stops are powers of the square root of two. The first f stop is sqrt(2) to the zeroth power, or f/1.0. Next is sqrt(2) to the first power, or f/1.4, and then sqrt(2) squared for f/2, etc. As you can see, common values like f/2.8 are actually approximations of the unwieldy "true" values.

  1. To calculate a new aperture value f2 from an initial aperture f1 and a given number of stops, we first convert f1 to a number of f stops from f/1.0, with this formula:

      log base sqrt(2) of f
    Then, we add the result of that to stops, and convert back to an aperture value with:
      f equals sqrt(2) to the n'th power

  2. To calculate the number of f stops between f1 and f2, first convert both values to a count of f stops from f/1.0 as above, subtract the results, and convert back to an aperture value.


Depth of Field

The Depth of Field tab lets you calculate the depth of the field of acceptable sharpness in a print. This depends on the subject distance, focal length, and aperture. It also depends on the "circle of confusion," which is a measure of "acceptable sharpness." The program has CoC values built into it for all common film formats, but you can put your own value in, if you like.

About Depth of Field

When you focus your camera's lens at a certain subject distance, objects at exactly that distance from the optical center of the lens are exactly in focus. Technically, everything else is out of focus. In practice, however, there is a "zone of acceptable focus" surrounding the focus plane, so that objects within that zone are considered "in focus" and those outside that zone are "out of focus". The size of this zone is called the "depth of field."

About the Circle of Confusion

To understand depth of field, you have to understand the "circle of confusion" concept.

Imagine a perfect white point in an empty black room. The point has no height, and no width. If you focus a lens on that point, it forms a perfect point on the film as well, if you ignore lens imperfections. If, however, you focus slightly before or after the point, the point will image on the film as a small disc, or circle. If that circle is small enough, it will look like a point, not a circle. The "circle of confusion" is typically calculated as the largest on-film circle that you see as a point when you make an 8×12 print and view it from 10 feet away. Anything larger is seen as a small circle, and is therefore perceived as out of focus.

f/Calc comes with common CoC values built into it for common film formats, but they are plainly only a generalization. If you plan on making prints larger than 8 × 12, or viewing them from closer than 10 feet, you will need to use a smaller circle of confusion to get the same degree of apparent sharpness. The CoC value also takes into account imperfections in the camera and enlarging lenses used, and the resolution of the film and paper used to make the image. If you change any of these for better or for worse, you will need to use a different CoC value.

f/Calc uses the commonly-accepted CoC value of 0.033mm for 35mm film, but some companies like Zeiss use a more demanding value of 0.025mm when making the depth of field marks on their lens barrels. That number is calculated as 1/1730 of the diagonal of the frame. You can use the same formula for other film formats. For 6 × 4.5 film, for example, you could use (sqrt(60mm2 + 45mm2) ÷ 1730) = 0.043mm instead of 0.05mm.

General Rules About Depth of Field

  1. Smaller apertures make for deeper in-focus fields. However, keep in mind that extremely small apertures (f/22 and smaller) can actually degrade images due to diffraction, which happens because lens apertures are not perfectly round. (This is why better lenses have more "blades" making up their aperture — more blades makes for "rounder" apertures.)
  2. Wide angle lenses have deeper field depths at a given aperture than telephoto lenses do.
  3. Larger format films, like 6cm×6cm, provide "sharper" images than 35mm film. This is because a 0.033 mm circle imaged on 6×6 film is comparatively smaller than the same point imaged on 35mm film.

Formulæ Used

First, we must find the hyperfocal distance:

hyperfocal distance formula

where f is the focal length of the lens, A is the aperture value and c is the circle of confusion value.

The near edge of the zone of acceptable focus is found with:

near edge of field formula

and the far edge is found with:

far edge of field formula

where h is the hyperfocal distance calculated above, and s is the subject distance. (Technically, s is the distance from the optical center of the lens to the focal plane, but this distinction usually only matters in close-up photography.)

All lengths f, c and s must be in the same unit, such as millimeters.


Hyperfocal Distance

This tab is rather similar to the Depth of Field tab. The DoF tab actually calculates the hyperfocal distance as an intermediate result, but in order to keep the DoF tab "clean," we did not display this result there.

About Hyperfocal Distance

The "hyperfocal distance" is the nearest distance that you can focus a given focal length/aperture combination at and still have "infinity" in focus. Practically speaking, this is the deepest possible depth of field for that focal length/aperture combination.

Some people use the hyperfocal distance rule to "prefocus" their lens for a given aperture for snap shooting. For example, if you have a 50mm lens on a 35mm camera, and want to use an f/11 aperture, you could focus your lens at about 6.7m and have everything from about 3.4m to infinity in focus. Theoretically, then, you could snap a picture of anything in this range, and have it acceptably sharp, without fine-tuning the focus.

A more common use of the hyperfocal distance is maximizing the depth of field for a given aperture. This is a common requirement in landscape photography. Since smaller apertures give greater depth of field, but also cause greater image degradation due to diffraction, it is best to choose the largest aperture that will still give an acceptable in-focus field.

Formula Used

The hyperfocal distance is found with the following formula:

hyperfocal distance formula

where f is the focal length of the lens, A is the aperture value and c is the circle of confusion value.


Field of View

The "field of view" calculator ets you solve two photographic problems. The primary one is, given a film size, lens length and distance to the subject, how much of the subject will I be able to fit in the frame? By fiddling with the calculator a bit, you can also solve a slightly different problem: given a film size and lens length, how far away do I have to be to take a picture of a subject of a certain size?

Formulæ Used

To calculate the field of view, we first have to calculate the magnification of the lens, given its focal length and the distance to the subject:

M = f / (s - f)

where f is the focal length of the lens, and s is the distance from the optical center of the lens to the subject. (Roughly equivalent to the camera-to-subject distance, except for closeups.) Both values must be in the same unit, such as millimeters.

Given the magnification, the horizontal and vertical field of view are calculated:

V(h) = F(w) / M V(v) = F(h) / M

where Fw is width of the film frame, Fh is height of the film frame and M is the subject magnification.


Angle of View

The "angle of view" is the measure of a given lens' angle of view for a given film format. For example, a 50mm lens can see a 47° view on a 35mm camera, and an 81° view on a 6×6 camera. Several problems are expresed in terms of angle of view:

  1. What focal length lens on a 4×5 view camera would be equivalent to a 35mm camera's 50mm lens? (Answer: About 180mm.)
  2. Given that the full moon is half a degree wide as seen from the Earth, how long a lens will I have to use to capture an image of the moon that fills half the width of the frame, using a 35mm camera? (Answer: About 2000mm.)
  3. If I place my 6×7 medium format camera in the corner of a room, how wide a lens will I need to capture the entire room wall-to-wall, in landscape orientation? (Answer: At least 30mm.)

Formula Used

The angle of view is calculated as:

angle of view formula

where F is the length of the frame in the direction for which you want the angle measurement, and f is the focal length of the lens. Both values must be in the same unit, such as millimeters.


Magnification

Magnification is the relationship between an object's real size and its size on film. If, for example, you take a picture of a US 25¢ coin (roughly 24mm in diameter) such that it creates a 24mm wide image on-film, the magnification is equal to 1. (Also written 1:1.) If, instead that coin takes up 12mm on the film's frame, you have a 1/2 or 1:2 magnification ratio.

The magnification formula is mainly used by macro shooters, though it also has other applications. For example, the Field of View calculation has magnification as one of its factors.

Formula Used

The magnification of a given lens, given its focal length and the distance to the subject is calculated as:

M = f / (s - f)

where f is the focal length of the lens, and s is the distance from the optical center of the lens to the subject. (Roughly equivalent to the camera-to-subject distance, except for closeups.) Both values must be in the same unit, such as millimeters.


Spot Metering

The precision of a hand-held spot meter is generally measured in degrees, but the in-camera spot meters in advanced cameras are usually measured in percentage of the frame. This is because the actual angle of view of the spot meter changes depending on the focal length of the lens you have on the camera. This formula will help you to calculate a metering angle given a frame size, a percentage of that frame, and the focal length of the lens being used.

This calculation is closely related to the Angle of View calculation, but it different enough that it warranted a tab of its own. Conversely, this calculation might be useful for answering other questions, such as those having to do with a camera's autofocus sensors.

Formula Used

To convert from a percentage of a frame to an angle of view, use:

spot metering formula

where A is the area of the film frame, p is percentage of that frame expressed as a fraction of 1 (e.g. 9% would be 0.09), and f is the focal length of the lens. A's unit must be in square units of the same unit f is expressed in. That is, if f is in millimeters, A must be in square millimeters. (And now you know why I write utility programs rather than solve nasty little equations like these by hand!)


Future Features

This program is not finished. Surely there are other formulæ out there that are hard enough to calculate that most people don't even bother. If I give f/Calc the ability to calculate these, more people will experiment with these formulæ, and so will learn more about the photographic process.

So, what do you think f/Calc should be able to calculate? Naturally, I am not interested in a major departure from the program's current "feel". For example, a "development timer" tab would not be appropriate at all. Some ideas that would work are:

  • macro formulæ
  • bellows factor correction
  • fisheye calculations (the Angle of View calculator is only useful for rectilinear lenses)
  • magnification, in a form that works for extension tubes
  • trim trailing zeros from fractional parts of numerical fields

I also have plans for general improvements to the program, some of which may go into a "pro" shareware version:

  • Printable graphs:
    • hyperfocal distance, against aperture, for a given lens focal length
    • depth of field for a given focal length, for several apertures
  • Have the program save the values in its fields before the program shuts down, and restore them on startup
  • In the f Numbers tab, it would be nice if the "round to nearest sixth of a stop" feature used actual fractions, instead of decimal approximations.
  • Add a calculation for the inverse of "field of view": given a subject size and distance, calculate the required focal length to capture the subject.
  • Add context-sensitive help.
  • Allow the main window to be minimized. Maybe add "minimize to system tray" feature.

I need feedback, further ideas, and a feel for whether such a "pro" version would be helpful. The effort of implementing the graphing module alone might well take this program out of the freeware arena. (There will always be a freeware version of this program, however, with fewer features than the "pro" version.) Your feedback will help me to decide these issues.

Email your feature requests, comments and rants to: tangent@cyberport.com.


f/Calc License

f/Calc is a freeware program, copyright © 1998 by Tangentsoft, all rights reserved. Tangentsoft grants you the right to use and/or distribute this program freely, provided that you comply with the following:

  1. You must distribute all of the files necessary for the InstallShield™ program to install f/Calc, and you must distribute all of these files exactly as you received them. You may, however, repackage the installation files with a different kind of compression.
  2. You may not charge money for this program. You may, however, charge a nominal fee to cover media and distribution costs.
  3. You may not represent this program as your own, either explicitly or implicitly.

NO WARRANTY

This software is provided as is, without warranties of any kind, either express or implied, including suitability for a particular purpose. The author accepts no responsibility whatsoever for any damage incurred directly or indirectly as a result of using this software. Use this software entirely at your own risk.


Credits

The primary thing you should know is that I am not a mathematician, and I am not an optical physicist. I am not even a professional in any photographic field. I am, by day, a software engineer, and by night a computer geek who happens to like photography. In my quest to learn more about my hobby, I began learning about optical formulae; I quickly found that it was a pain to crunch all those equations. Since I have the modest skills required to automate these calculations, I decided to do so.

But this was not after I searched long and hard for something out there that already did this sort of thing. Along that journey, I found many good equations, and a few interesting ideas, but nothing that I really wanted to use a lot. (One exception is an online depth of field graphing program. However, I hope one day to match or outdo that applet by adding a graphing module to f/Calc..)

The end result was that I created this program out of whole cloth, except that I did not derive a single equation that I use. Every equation, constant and identity I use in this program comes from postings on Usenet, pages on the Internet, email list archives and standard reference sources. As such, I cannot claim that I have a totally firm grasp on what exactly these equations do. I have a basic idea, and that helped with debugging, but in the end, if there are errors in my math, it's probably my fault due to overly clever [mis]use of these formulæ, rather than my source's fault. So, please drop me a line if you find something broken with this program. If you don't find any errors, forward your kudos to the great Internet, that wonderful resource that we all depend on these days. f/Calc is my gift back to the Internet, as a result of a very educational few months.

Thanks, y'all.

    Warren Young

    Aztec, New Mexico
    August, 1998