The idea: three rays find the image
An object stands in front of a thin lens. Every point of the object sends light in all directions, and the lens bends the part that goes through it. The light from one point either meets again at one point behind the lens, or it spreads out as if it came from one point. That point is the image of the object point. To find it you only need two rays, and three are easy to draw. The page follows the light from the tip of the object arrow: where its rays meet is the tip of the image.
The three principal rays
The lens has two focal points, one focal length f from its centre on each side: F in front (the object's side) and F' behind. A converging lens (thicker in the middle) has f > 0. A diverging lens (thinner in the middle) has f < 0, so its F' lands on the object's side.
| ray | before the lens | converging lens | diverging lens |
|---|---|---|---|
| 1 | parallel to the axis | bent through F' | bent away, as if it came from F' |
| 2 | toward the centre | straight on | straight on |
| 3 | through F (or toward F) | leaves parallel to the axis | leaves parallel to the axis |
Ray 3 is ray 1 run backwards: light paths can be reversed. Ray 2 goes straight because near its centre a thin lens is like a thin flat sheet of glass. The page draws the lens as a line (the thin lens model): all bending happens in that one plane.
Real and virtual images
If the bent rays cross behind the lens, the light really goes through that point. A screen put there shows a sharp picture: a real image. If the bent rays spread apart, they never meet. Trace them back (the dashed lines on the page) and they seem to come from one point in front of the lens. Your eye, looking through the lens, sees the object there: a virtual image. No screen can catch it, because no light actually reaches that point. (Demo 5: inside F.)
The thin lens equation and magnification
Similar triangles in the drawing give the same answer as the rays, as a formula:
1/f = 1/d₀ + 1/dᵢ so dᵢ = f·d₀ / (d₀ − f)
m = hᵢ / h₀ = −dᵢ / d₀
d₀ is the object distance, dᵢ the image distance, h₀ and hᵢ the heights, m the magnification. The signs carry the meaning:
| sign | means |
|---|---|
| f > 0 / f < 0 | converging / diverging lens |
| dᵢ > 0 | image behind the lens: real |
| dᵢ < 0 | image in front of the lens, on the object's side: virtual |
| m < 0 / m > 0 | inverted (upside down) / upright |
| |m| > 1 / |m| < 1 | bigger / smaller than the object |
For the start of the page: 1/dᵢ = 1/10 − 1/30 = 2/30, so dᵢ = 15 cm and m = −15/30 = −0.5: a real image half as tall and upside down (Demo 1). A shorter focal length is a stronger lens: with f = 5 cm the same object gives dᵢ = 6 cm and m = −0.2 (Demo 7).
Where the object is decides the image
For a converging lens it all depends on where the object stands compared with F and 2F (twice the focal length):
| object at | image | used in | on the page (f = 10) |
|---|---|---|---|
| beyond 2F | between F' and 2F': real, inverted, smaller | camera, the eye | Demo 1: d₀ = 30 → dᵢ = 15, m = −0.5 |
| 2F | at 2F': real, inverted, same size | copying at 1 : 1 | Demo 2: 20 → 20, m = −1 |
| between F and 2F | beyond 2F': real, inverted, bigger | projector | Demo 3: 15 → 30, m = −2 |
| F | none: the rays leave parallel | torch, lighthouse | Demo 4: 10 → ∞ |
| inside F | in front of the lens: virtual, upright, bigger | magnifying glass | Demo 5: 5 → −10, m = 2 |
As the object comes in from far away toward F, the image moves out from F' to infinity and grows. With the object exactly at F the image is "at infinity": the light from each point leaves as a parallel beam. Inside F it jumps to the object's side, upright and bigger.
Diverging lenses
A diverging lens spreads every ray out, so the bent rays never cross. Traced back they always meet between F' and the lens: the image is always virtual, upright and smaller, wherever the object is. With f = −10 cm and d₀ = 15 cm: dᵢ = (−10)·15 / 25 = −6 cm and m = 0.4 (Demo 6). Glasses for short sight and door peepholes use this.
See also
Ray diagrams treat light as straight lines. Light is also a wave, and two waves can add up or cancel: see Wave Interference. Another page in the same style, with numbers that fly into boxes: Elastic and Inelastic Collisions.
Ray Tracing follows rays the other way, backwards from the eye, to render images.
Why a ray bends at the glass in the first place, with the wavefronts drawn, Snell's law and total internal reflection: Refraction.
What the page leaves out
Mirrors (the same equation works with a mirror's focal length, but the light comes back), thick lenses and the lens maker's formula that gives f from the curvature and the glass, aberrations (rays far from the axis and different colours focus at slightly different places), systems of two or more lenses (a microscope, a telescope, glasses in front of the eye), the limit set by diffraction, and the brightness of the image. Heights are drawn at twice the horizontal scale so that small objects show; that stretch keeps every line straight and every crossing in place.