Lens ray diagram simulator
Drag the green object along the axis and watch the rays and the image move. The tool tells you where the image is, how big it is and whether it is real or virtual, with the lens formula worked out.
Try:
Drawing a ray diagram
From the top of the object, draw any two of these three rays:
- A ray parallel to the axis. A convex lens bends it through the focal point F on the far side; a concave lens spreads it out as if it came from F on the near side.
- A ray through the centre of the lens, which goes straight on.
- A ray through the near focal point (or, for a concave lens, aimed at the far one), which leaves the lens parallel to the axis.
Where the rays meet is the top of the image. If they really meet, the image is real and can be caught on a screen. If they only seem to come from a point when traced backwards (dashed lines), the image is virtual.
Convex lens: where is the image?
- Object beyond 2F: real, inverted, smaller, between F and 2F (camera, eye).
- Object at 2F: real, inverted, same size, at 2F.
- Object between F and 2F: real, inverted, bigger, beyond 2F (projector).
- Object at F: no image; parallel rays.
- Object inside F: virtual, upright, bigger, same side (magnifying glass).
A concave lens always gives a virtual, upright, smaller image. It is used in glasses for short sight.
The lens formula
1/f = 1/u + 1/v and m = −v/u, using the "real is positive" convention: distances to real objects and images are positive, to virtual images negative, and a concave lens has a negative focal length. Some courses use the Cartesian convention (1/f = 1/v − 1/u); the answers are the same, only the signs are written differently.
Questions students ask
What is the power of a lens?
Power = 1 ÷ focal length in metres, measured in dioptres (D). A convex lens with f = 25 cm has a power of +4 D; a concave lens with f = 50 cm has −2 D. Opticians write prescriptions in dioptres.
Why is the image in a camera upside down?
The object is far beyond 2F, so the rays cross over before forming a real image on the sensor. Your eye does the same, and your brain turns the picture the right way up.
Can a virtual image be projected on a screen?
No. The light never actually reaches the place where a virtual image appears to be. You can only see it by looking through the lens.
More physics tools
Connected tools
The same idea from another angle, across the site.