Understanding the thin lens equation calculator — concept and principle
This calculator applies the thin-lens equation to find where a lens forms an image, how large it is, whether it is real or virtual and whether it is upright or inverted. It also gives the lens power in dioptres. Physics students use it for homework, and it helps when setting up a projector, magnifier or simple camera.
How it is calculated
1/do + 1/di = 1/f, so di = 1 ÷ (1/f − 1/do)
m = −di ÷ do; image height hi = m × ho
Power P = 100 ÷ f (dioptres, with f in cm)
- f is the focal length: positive for a converging (convex) lens, negative for a diverging (concave) lens.
- do is the object distance and ho the object height, all in cm.
- Positive di means a real image on the far side of the lens; negative di means a virtual image on the object's side. Negative m means inverted.
The principle
A converging lens bends every ray from one point of the object so that the rays meet again at one point of the image. Two special rays make the geometry easy: a ray parallel to the axis passes through the focal point, and a ray through the centre goes straight on. Similar triangles formed by these rays give the thin-lens equation. The same triangles show that image height and object height scale as di to do, which is the magnification. The lens is assumed thin compared with the distances, so it can be treated as a single plane.
Worked example
Default inputs: f = 10 cm, do = 30 cm, ho = 2 cm.
- 1/di = 1/10 − 1/30 = 0.1 − 0.0333 = 0.0667, so di = 15 cm.
- m = −15 ÷ 30 = −0.5.
- hi = −0.5 × 2 = −1 cm: the image is 1 cm tall and upside down.
- di is positive, so the image is real, on the far side of the lens; it is inverted, reduced.
- Power = 100 ÷ 10 = 10 dioptres.
| Object distance from the lens (cm) | Image distance (cm) |
|---|---|
| 7.5 | -30 |
| 15 | 30 |
| 22.5 | 18 |
| 30 | 15 |
| 37.5 | 13.64 |
| 45 | 12.86 |
| 60 | 12 |
How to read the result
For a converging lens, an object beyond 2f gives a smaller inverted real image (like a camera), an object between f and 2f gives a larger inverted real image (like a projector), and an object inside f gives an enlarged upright virtual image (like a magnifying glass). A diverging lens always gives a smaller, upright virtual image. Eyeglass prescriptions are written in dioptres: plus for converging lenses, minus for diverging ones.
Common mistakes
- Forgetting the negative sign for a diverging lens's focal length.
- Mixing centimetres and metres; power in dioptres needs f in metres, which the 100 ÷ f handles for cm.
- Reading a negative image height as an error; it simply means inverted.
Frequently asked questions
What happens when the object is exactly at the focal point?
The rays leave parallel and no image forms at a finite distance; the calculator reports the image at infinity.
Can a real image be upright?
Not with a single thin lens. A single lens's real images are always inverted.
What does a magnification of −0.5 mean?
The image is half the object's size and upside down.
Does the formula work for mirrors?
The mirror equation has the same form, though the sign conventions for distances differ.
Sources: OpenStax, University Physics Volume 3 (2016), §2.4 "Thin Lenses"