Sub topic 13
The thin-lens equation
This chapter assumes you can solve equations with reciprocals, you know how to draw principal-ray diagrams, and you have seen the real-is-positive sign convention. The thin-lens equation replaces the diagram with arithmetic. It gives the exact image position within the paraxial model, and the sign of the result tells you what kind of image you have.
The equation
For a thin lens in air, with object distance do, image distance di and focal length f:
1/f = 1/do + 1/di
Solving for the image distance gives di = 1 / (1/f − 1/do). This is the form the code below uses.
"Thin" means the lens thickness is negligible next to do, di and f. All distances are measured from the lens center. "Paraxial" means the rays stay close to the optical axis and make small angles with it. Outside those limits the equation is only approximate (see the aberrations chapter).
Sign convention
The equation holds only if you apply the signs consistently. This chapter uses the real-is-positive convention.
| Quantity | Positive | Negative |
|---|---|---|
| f | converging lens | diverging lens |
| d_o | real object, on the incoming-light side | virtual object (rare, see below) |
| d_i | real image, on the outgoing side | virtual image, on the same side as the object |
| m | upright image | inverted image |
Magnification is m = −di / do. Its sign gives orientation and its absolute value gives the size ratio. If |m| > 1 the image is enlarged. If |m| < 1 it is reduced.
A function you can run
def image(f, d_o):
"""Thin lens or spherical mirror, real-is-positive convention.
f: focal length (converging lens or concave mirror > 0)
d_o: object distance (> 0 for a real object)
Returns (d_i, m), or None when the object is at the focal point.
"""
if d_o == f:
return None # rays leave parallel, image at infinity
d_i = 1 / (1 / f - 1 / d_o)
m = -d_i / d_o
return d_i, m
print(image(10, 30)) # (15.0, -0.5): real, inverted, half size
print(image(10, 5)) # (-10.0, 2.0): virtual, upright, twice size
print(image(-10, 30)) # (-7.5, 0.25): virtual, upright, reducedThe None return is deliberate. At do = f the term 1/f − 1/do is zero, so d_i would be infinite. The refracted rays leave parallel and never meet.
How the image changes as the object moves
Take a converging lens with f = 10 cm and move the object toward it.
| d_o (cm) | d_i (cm) | m | Image |
|---|---|---|---|
| 30 | 15 | −0.5 | real, inverted, reduced |
| 20 (= 2f) | 20 | −1 | real, inverted, same size |
| 15 | 30 | −2 | real, inverted, enlarged |
| 10 (= f) | none | none | at infinity |
| 5 | −10 | +2 | virtual, upright, enlarged |
The image jumps from real to virtual as the object crosses the focal point. In the equation, di goes to +∞ as do approaches f from outside. It comes back from −∞ as d_o approaches f from inside.
Worked example: diverging lens
A diverging lens has f = −10 cm and the object sits 30 cm away.
- 1/di = 1/f − 1/do = −1/10 − 1/30 = −4/30.
- d_i = −7.5 cm. The negative sign means a virtual image, 7.5 cm from the lens on the object side.
- m = −(−7.5)/30 = +0.25. The image is upright and one quarter the object size.
This matches the third line of the code output. A diverging lens with a real object always gives a virtual, upright, reduced image, wherever the object is. You can check this by trying several values of d_o in image.
Common errors
- Forgetting to take the reciprocal. The equation gives 1/di. Computing 1/f − 1/do and stopping there is the most common arithmetic slip.
- Using the wrong sign for f. A diverging lens must have a negative f. Entering its magnitude will produce a real image that cannot exist.
- Dropping the sign of d_i when computing m. The sign carries the orientation. Compute m = −di/do with the signed d_i.
- Measuring from the wrong place. Distances run from the lens, not from the focal point. (Newton's form, xo · xi = f², uses focal-point distances. That is a different equation.)
- Applying the equation to a thick lens. With a thick lens or a compound system, the single-plane assumption fails and you need principal planes.
Two lenses in sequence
The equation also handles two lenses. Apply it to the first lens, then treat its image as the object for the second. The total magnification is m1 · m2.
def image(f, d_o):
d_i = 1 / (1 / f - 1 / d_o)
return d_i, -d_i / d_o
f1, f2, separation = 10, 5, 40
d_o1 = 30
d_i1, m1 = image(f1, d_o1) # 15.0, -0.5
d_o2 = separation - d_i1 # 25.0, the first image is the second object
d_i2, m2 = image(f2, d_o2) # 6.25, -0.25
print(d_i2, m1 * m2) # 6.25 0.125The distance to the second object is the separation minus di1. If the first image lies beyond the second lens, that expression is negative. The second lens then has a virtual object, and do2 < 0 is correct. The same formula still works.
Edge cases
- Object very far away (d_o → ∞). Then 1/do → 0 and di → f. The image forms at the focal point, which is how you locate a lens's focal length with a distant light source.
- Object at 2f. The image is also at 2f, with m = −1. This is the smallest possible distance between a real object and its real image: 4f.
- Real image distance limit. For a converging lens, a real image needs d_o > f. Any object closer than f gives a virtual image.
- Index of refraction. The equation as written assumes the lens is in air. In water or another medium, f changes through the lensmaker's equation, but the equation's form does not.
Exercise
A converging lens has f = +20 cm. An object is 60 cm from it. Find the image distance and the magnification, then describe the image.
Show answer
1/di = 1/20 − 1/60 = 2/60, so di = 30 cm. m = −30/60 = −0.5. The image is real (d_i > 0), inverted (m < 0), and half the object size.
Exercise
A diverging lens has f = −15 cm. An object is 30 cm from it. Find d_i and m, and state whether the image is real or virtual.
Show answer
1/di = −1/15 − 1/30 = −3/30, so di = −10 cm. m = −(−10)/30 = +1/3. The image is virtual (on the object side), upright, and one third the object size.