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.

A converging lens with f = 10 cm and an object 4 cm tall at 30 cm. Ray 1 goes parallel to the axis and then through F'; ray 2 goes straight through the centre; ray 3 goes through F and then parallel. They cross 15 cm behind the lens at the tip of an inverted image 2 cm tall.
The three principal rays from the tip of the object cross at the tip of the image (d₀ = 30 cm, f = 10 cm: dᵢ = 15 cm, m = −0.5).

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.

raybefore the lensconverging lensdiverging lens
1parallel to the axisbent through F'bent away, as if it came from F'
2toward the centrestraight onstraight on
3through F (or toward F)leaves parallel to the axisleaves 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:

signmeans
f > 0 / f < 0converging / diverging lens
dᵢ > 0image behind the lens: real
dᵢ < 0image in front of the lens, on the object's side: virtual
m < 0 / m > 0inverted (upside down) / upright
|m| > 1 / |m| < 1bigger / 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 atimageused inon the page (f = 10)
beyond 2Fbetween F' and 2F': real, inverted, smallercamera, the eyeDemo 1: d₀ = 30 → dᵢ = 15, m = −0.5
2Fat 2F': real, inverted, same sizecopying at 1 : 1Demo 2: 20 → 20, m = −1
between F and 2Fbeyond 2F': real, inverted, biggerprojectorDemo 3: 15 → 30, m = −2
Fnone: the rays leave paralleltorch, lighthouseDemo 4: 10 → ∞
inside Fin front of the lens: virtual, upright, biggermagnifying glassDemo 5: 5 → −10, m = 2
Three small ray diagrams side by side with f = 10 cm: camera, object at 30 cm and a small inverted image at 15 cm; projector, object at 15 cm and a big inverted image at 30 cm; magnifying glass, object at 5 cm and a dashed, bigger upright virtual image at −10 cm on the object's side.
Move the object toward the lens and the image moves away and grows; once the object is inside F the image jumps to the front and turns upright.

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.

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.