Clever Quest Lab ← Labs

Ray Optics

Move lenses, mirrors, a prism and a glass block on an optical bench and watch every ray respond.

Add

Drag an element to move it. Drag the round handle of the selected element to rotate or aim it. Keyboard (focus the bench first): arrow keys move, Q and E rotate, N and P select the next or previous element, Delete removes, Shift makes fine steps.

Selected element

Image

Add an object arrow and a lens or a curved mirror to see the image and its numbers here.

Display

How to use it

The dark panel is an optical bench one metre wide; each grid square is 10 cm. Choose a preset or build your own setup with the Add buttons. Drag any element to move it. The selected element has a round handle: drag it to rotate the element or to aim a light source.

To study images, add an object arrow and a lens or a curved mirror. Three principal rays leave the tip of the arrow, the image is drawn in orange (solid when real, dashed when virtual), and the Image panel shows the object distance, image distance and magnification. Dashed lines are backward extensions of rays: light only seems to come from there.

Controls

How it works

Reflection. A plane mirror follows the law of reflection: the angle of reflection equals the angle of incidence, both measured from the normal, the line perpendicular to the surface.

Refraction. The glass block and the prism use real refraction at every surface. Where a ray meets glass, the simulator finds the normal and applies Snell’s law, going in and again going out:

n1 sin θ1 = n2 sin θ2

Light entering glass with n = 1.5 at 30° continues at 19.47°. From glass to air the ray bends away from the normal, and beyond the critical angle there is no refracted ray:

sin θc = n2 / n1   (n1 > n2)

For n = 1.5 this gives 41.81°. Above it the surface reflects all the light: total internal reflection.

Lenses and curved mirrors use a different, idealised model. Each is an ideal thin element: a ray that meets it at height h above the axis has its slope changed by −h/f, nothing else. This is the paraxial model behind the thin-lens and mirror equations, so all rays from one object point meet in exactly one image point:

1/f = 1/do + 1/di
m = −di/do = hi/ho

Here f is positive for a converging lens or concave mirror and negative for a diverging lens or convex mirror. A positive di means a real image, a negative one a virtual image; a negative m means the image is inverted. For a spherical mirror f is half the radius of curvature. The Image panel computes di from the equation and, separately, from the point where the traced rays cross. Real thick lenses and spherical mirrors blur that point slightly (spherical aberration); the ideal elements here do not.

Dispersion. In glass the refractive index depends on the wavelength λ. The simulator uses Cauchy’s two-term formula, anchored at yellow light of 589 nm:

n(λ) = nD + B (1/λ² − 1/λD²)

White light is traced as seven wavelengths from 420 to 670 nm. Violet has the largest index, so a prism bends it most. With λ in micrometres, B is about 0.004 for crown glass and 0.013 for dense flint glass.

Things to try

Frequently asked questions

What is the difference between a real and a virtual image?

At a real image the rays actually meet, so it can be caught on a screen. At a virtual image the rays only seem to come from one point when you follow them backwards.

Why does the lens not split white light into colours?

The lenses here are ideal thin lenses with the same focal length for every colour. A real single lens focuses blue light a little closer than red light (chromatic aberration). Only the prism and the glass block are dispersive here.

Why do some rays stop?

A ray ends when it hits the hatched back of a mirror. Tracing also stops after 60 interactions, which only matters for light trapped between mirrors.

What is left out?

This is geometric optics: light travels in straight rays. Diffraction, interference and polarisation are not modelled, a good approximation when everything is much larger than the wavelength of light.

More free games and simulators