You are in the Physics lab.
Drag the object arrow, or use the sliders below
Object distance dₒ80 cm
Image distance dᵢ—
Focal length f40 cm
Magnification m—
Image—
Two or three known rays are enough to place any image. Every principal ray leaving the top of the object arrives at the same point after the lens or mirror — the tip of the image. A ray parallel to the axis bends through the focal point F; a ray through the centre of a lens (or the vertex of a mirror) is undeviated (or reflects symmetrically); a ray through the near focal point leaves parallel. When those outgoing rays cross in real space you get a real, inverted image you could catch on a screen; when they diverge and only their dashed back-extensions cross, you get a virtual, upright image — exactly what you see through a magnifying glass or in a convex security mirror. It all obeys 1/f = 1/dₒ + 1/dᵢ with m = −dᵢ/dₒ.
How It Works
Pick an element, trace the principal rays, and read where they meet.
1
Place the object and the element
An upright object arrow sits on the optical axis to the left of a thin lens or curved mirror. The two focal points F and the centre positions 2F are marked on the axis at the focal length you choose. Drag the object closer than F, between F and 2F, or beyond 2F to explore every regime.
2
Trace the three principal rays
From the tip of the object the tool draws the three rays whose paths are known: parallel-then-through-F, straight-through-centre, and through-F-then-parallel. For a mirror the same rays reflect off the curved surface. You do not have to guess angles — the geometry is fixed by the focal length.
3
Read the image
Where the outgoing rays cross is the image tip. If they cross in front (real image) it is inverted and can be projected; if they diverge, their dashed back-extensions cross to give an upright virtual image. The readout solves 1/f = 1/dₒ + 1/dᵢ and reports the image distance, the magnification m = −dᵢ/dₒ, and whether the image is real or virtual, upright or inverted, enlarged or reduced.
What is a ray diagram?
A ray diagram is a scale drawing that finds the image made by a lens or mirror by tracing a few rays of light from a point on the object. You only need two or three special rays — called principal rays — whose paths are known in advance: where they cross (or appear to cross) is where the image forms. This simulator draws those rays for you as you move the object, so you can see the image appear, flip, grow or shrink.
How do you draw a convex (converging) lens ray diagram?
Draw three principal rays from the top of the object. One travels parallel to the axis and then bends through the far focal point F. One passes straight through the centre of the lens without bending. One passes through the near focal point F and leaves parallel to the axis. Where the outgoing rays meet is the tip of the image. If the object is farther than one focal length the image is real and inverted; inside the focal length the rays diverge and the image is virtual, upright and enlarged — a magnifying glass. This tool draws all three rays automatically.
How does a concave mirror ray diagram work?
A concave (converging) mirror focuses parallel light to a focal point at half the radius of curvature, f = R/2. In the ray diagram, a ray parallel to the axis reflects through F, a ray through the centre of curvature reflects straight back, and a ray to the vertex reflects symmetrically about the axis. The reflected rays cross in front of the mirror to form a real, inverted image when the object is beyond F, and produce an enlarged virtual image behind the mirror when the object is inside F. Switch the element to a concave mirror here to see it.
What is the difference between a real and a virtual image?
A real image forms where light rays actually converge, so it can be projected onto a screen and is always inverted for a single lens or mirror. A virtual image forms where the rays only appear to come from — you trace them backwards along dashed lines — so it cannot be caught on a screen and is upright. A diverging lens and a convex mirror always make virtual images; a converging lens or concave mirror makes a real image when the object is beyond the focal point and a virtual one when it is inside. The readout labels each case as you change the setup.
What is the thin-lens and mirror equation?
Both thin lenses and curved mirrors obey 1/f = 1/dₒ + 1/dᵢ, where f is the focal length, dₒ the object distance and dᵢ the image distance. The magnification is m = −dᵢ/dₒ: a negative m means an inverted image, and |m| greater than one means it is enlarged. A converging lens and a concave mirror have positive f; a diverging lens and a convex mirror have negative f. This simulator solves the equation live and shows the matching ray diagram.
Teaching or blogging about optics? You can embed this simulator on your own site free — one line of code, no sign-up.