Skip to content
TR Open free
Ages 14–18

Lens ray diagram simulation

Move the object nearer or further from the lens and change the focal length. See at once where the rays go and where the image forms, how big it is and whether it is upright or upside down.

Free, no sign-up. Works on phones and smart boards too.

A thin lens ray diagram with object distance, focal length and object height sliders

What’s going on

A converging (convex) lens brings parallel rays together at its focal point. A diverging (concave) lens spreads them out; their extensions meet at the focal point.

With a converging lens the image depends on where the object is. Outside the focal point the image is upside down and real: you can catch it on a screen. At twice the focal length the image is the same size. Inside the focal point the image becomes upright, larger and virtual; that is a magnifying glass.

A diverging lens always gives an upright, smaller, virtual image. Glasses for short sight use diverging lenses; glasses for long sight and magnifiers use converging ones.

The formula

1/f = 1/d₀ + 1/dᵢ · magnification = −dᵢ / d₀

  • f: focal length
  • d₀: distance from the object to the lens
  • dᵢ: distance from the image to the lens (negative: virtual)

Things to try

  1. With the converging lens, set f = 12 cm and d₀ = 30 cm. The image is upside down, smaller and real, about 20 cm from the lens.
  2. Set d₀ to 24 cm (2f). The image is the same size and upside down, also 24 cm away.
  3. Set d₀ to 8 cm (inside the focal point). The image is upright, larger and virtual: a magnifier.
  4. Switch to “Diverging” and move the object. Wherever it is, the image stays upright, smaller and virtual.

Open the experiment →

Questions and answers

An object is 30 cm from a converging lens with a focal length of 10 cm. Where is the image?

1/dᵢ = 1/10 − 1/30 = 2/30, so dᵢ = 15 cm. It is upside down, real and half the size.

Why do you hold a magnifying glass close to what you are looking at?

Inside the focal length, a converging lens gives an upright, larger, virtual image.

Why do glasses for short sight use diverging lenses?

In a short-sighted eye the image forms in front of the retina. A diverging lens spreads the rays a little and moves the image back onto it.

For teachers

  • Use a magnifying glass to throw an upside-down image of the window onto paper, then compare with the simulation.
  • Have students record the image’s properties for five object positions in a table.

Lens ray diagram simulation

Free, no sign-up. Works on phones and smart boards too.