Optics
How To Calculate A Thin Lens Equation
The thin lens equation relates the focal length of a lens to where an object sits and where its image forms. Magnification then tells you how big the image is and whether it is flipped.
Quick Answer
1/f = 1/do + 1/di, rearranged as di = f x do / (do - f)
- f
- The focal length, positive for a converging lens
- do
- The object distance from the lens
- di
- The image distance from the lens
- m
- The magnification, negative when the image is inverted
Multiply the focal length by the object distance, then divide by the object distance minus the focal length. A 15 cm lens with an object 45 cm away forms an image 22.5 cm from the lens, and magnification is -0.5, so the image is half size and inverted.
What Is A Thin Lens Equation?
The thin lens equation is a statement about how curved glass bends light. Rays leaving one point on an object are brought back together at one point on the image, and the equation tells you where that point lands.
It is called thin because the calculation ignores the thickness of the glass. That approximation is excellent when the lens is much thinner than either distance involved, which covers most classroom and camera problems.
The sign convention matters more than the arithmetic. A converging lens such as a magnifying glass has a positive focal length, and a diverging lens used to correct short sight has a negative one.
Magnification is the image distance divided by the object distance, with a minus sign. The minus sign is not decoration: it tells you the image is upside down relative to the object.
An image is real when light actually passes through it and virtual when the rays only appear to come from there. Real images from a single converging lens are always inverted, and virtual images are always upright.
As the object moves from far away toward the lens the image moves away from it, and the two swap places at twice the focal length. That symmetry is a quick way to sanity check an answer.
When the object sits exactly at the focal point no image forms, because the rays leave the lens parallel and never converge. This is the one input the equation cannot handle, and it is why searchlights use a bulb at the focus.
Lens power is the reciprocal of the focal length in metres, and it is measured in dioptres. A 15 cm lens has a power of 6.67 dioptres, which is roughly the strength of a strong reading glass.
Cameras use the same equation in reverse. Knowing the sensor distance and the focal length of the lens tells you the closest object that will still be sharp, which is what a focusing ring is adjusting.
The thin lens equation also covers systems of two lenses if you treat the image from the first as the object for the second. Microscopes and refracting telescopes are built on exactly that sequence.
A thicker lens does not follow the equation exactly, because refraction happens at both surfaces and those surfaces are not at the same place. Lens designers handle this with an effective focal length that shifts slightly with the object distance.
Spherical aberration is the other departure from the ideal. Rays near the edge of a lens focus at a slightly different point from rays near the centre, which is why a simple lens is softer wide open than it is stopped down.
The focal length of a lens changes in water because refraction depends on the difference in light speed between the two media. A lens that is strongly converging in air is nearly useless under water, which is why diving masks hold a flat panel of air in front of the eyes.
Formula
di = f x do / (do - f)
Formula page →The image distance for a lens of focal length f and object distance do.
| Symbol | Meaning | Unit | Notes |
|---|---|---|---|
| f | Focal length | centimetres | Positive for a converging lens, negative for a diverging one. |
| do | Object distance | centimetres | The distance from the lens to the object. |
| di | Image distance | centimetres | The distance from the lens to the image. |
m = -di / do
Formula page →Positive magnification is upright, negative magnification is inverted.
| Symbol | Meaning | Unit | Notes |
|---|---|---|---|
| m | Magnification | unitless | The ratio of image height to object height. |
| di | Image distance | centimetres | The distance from the lens to the image. |
| do | Object distance | centimetres | The distance from the lens to the object. |
How To Calculate A Thin Lens Equation
- 1
Write down the focal length and the object distance
Use the same units for both. A focal length of 15 and an object distance of 45 both in centimetres is fine; mixing metres and centimetres is the usual source of wrong answers.
- 2
Subtract the focal length from the object distance
45 minus 15 is 30. This difference is the denominator, and it is the number that tells you which side of the focal point the object is on.
- 3
Multiply the focal length by the object distance
15 times 45 is 675. This product goes on top of the fraction.
- 4
Divide to get the image distance
675 divided by 30 is 22.5, so the image forms 22.5 centimetres from the lens, on the far side from the object.
- 5
Work out the magnification
Minus 22.5 divided by 45 is -0.5. The image is half the height of the object and inverted, because the magnification is negative.
Examples
Example 1: A 15 cm lens with an object 45 cm away
- Focal length
- 15
- Object distance
- 45
- Object height
- 6
| Step | Calculation | Result |
|---|---|---|
| Object distance minus focal length | 45 - 15 | 30 |
| Focal length times object distance | 15 x 45 | 675 |
| Image distance | 675 / 30 | 22.5 |
| Magnification | -22.5 / 45 | -0.5 |
| Lens power in dioptres | 100 / 15 | 6.6667 |
| Image height | 6 x -0.5 | -3 |
Result: The image forms 22.5 centimetres behind the lens with a magnification of -0.5, so a 6 centimetre object produces a 3 centimetre inverted image. The lens power is 6.6667 dioptres, and the image height of -3 has the minus sign because the image is inverted.
Example 2: An object inside the focal length of a 20 cm lens
- Focal length
- 20
- Object distance
- 15
- Object height
- 6
| Step | Calculation | Result |
|---|---|---|
| Object distance minus focal length | 15 - 20 | -5 |
| Focal length times object distance | 20 x 15 | 300 |
| Image distance | 300 / -5 | -60 |
| Magnification | 60 / 15 | 4 |
| Lens power in dioptres | 100 / 20 | 5 |
| Image height | 6 x 4 | 24 |
Result: The image distance comes out negative at -60 centimetres, which means the image is virtual and sits on the same side as the object. Magnification is 4, so a 6 centimetre object is seen as 24 centimetres tall, which is what a magnifying glass does. At focal length 20 centimetres the lens power is 5 dioptres.
Example 3: A diverging lens of focal length -12 cm
- Focal length
- -12
- Object distance
- 24
- Object height
- 6
| Step | Calculation | Result |
|---|---|---|
| Object distance minus focal length | 24 - -12 | 36 |
| Focal length times object distance | -12 x 24 | -288 |
| Image distance | -288 / 36 | -8 |
| Magnification | 8 / 24 | 0.3333 |
| Lens power in dioptres | 100 / -12 | -8.3333 |
| Image height | 6 x 0.3333 | 2 |
Result: A diverging lens always gives a negative image distance, here -8 centimetres, and a positive magnification of 0.3333, so a 6 centimetre object appears 2 centimetres tall and upright. The image is virtual and smaller than the object, which is why short sight glasses make the world look reduced. A negative focal length gives a negative lens power, here -8.3333 dioptres.
Calculator
Image distance
22.5
- Magnification
- -0.5
- Image height
- -3
- Lens power in dioptres
- 6.6667
Values update as you type. This calculator covers the single scenario its formula assumes — see Common Mistakes for what it leaves out.
Prefer a full-width tool? Open the A Thin Lens Equation calculator page.
Common Mistakes
Mixing units between f and do
The equation only works when both distances use the same unit. Entering f as 0.15 metres and do as 45 centimetres gives an image distance that is off by a factor of a hundred.
Putting the object at the focal length
When do equals f the denominator is zero and no image forms. The object must be further from the lens than one focal length for a real image.
Reading a negative magnification as an error
A negative magnification simply means the image is inverted. It is a statement about orientation, not a sign that the input was wrong.
Forgetting the minus sign in m = -di / do
Without the minus sign every image comes out upright, and the classic inverted image of a converging lens disappears from the answer.
Using a negative focal length for a magnifying glass
A magnifying glass is a converging lens with a positive focal length. Negative focal lengths belong to diverging lenses, which can only make images smaller.
Quoting dioptres from a focal length in centimetres
Lens power is one over the focal length in metres, so a 15 cm lens is 6.67 dioptres, not 0.0667. Multiply by 100 before taking the reciprocal.
FAQ
What is the thin lens equation?
It is 1/f = 1/do + 1/di, which rearranges to di = f x do / (do - f). It links the focal length of a lens to the object distance and the image distance.
What does a negative image distance mean?
It means the image is virtual: the rays only appear to come from that point, so the image is on the same side of the lens as the object.
How do I know if the image is inverted?
Look at the magnification. If it is negative the image is inverted, and if it is positive the image is upright.
What happens when the object is exactly at the focal point?
No image forms at all. The rays leave the lens parallel and never meet, which is the principle behind searchlights and spotlights.
What unit is lens power measured in?
Dioptres, which are inverse metres. Divide the focal length in centimetres by 100 and take the reciprocal to get dioptres.
Does the thin lens equation work for mirrors?
Yes, with a sign convention. A concave mirror behaves like a converging lens and a convex mirror like a diverging one, with the same rearranged equation.
References
- [1]Wikipedia, Thin lens — https://en.wikipedia.org/wiki/Thin_lens
- [2]Wikipedia, Lens (optics) — https://en.wikipedia.org/wiki/Lens_(optics)
- [3]Wikipedia, Dioptre — https://en.wikipedia.org/wiki/Dioptre