Light Refraction and Lenses Simulation

A free optics simulation for class: Snell's law with real angles, total internal reflection, a prism splitting white light, and lens ray diagrams with images.

  • Physics
  • Grades 7–10
Light Refraction and Lenses Simulation

Free, no sign-up, runs in the browser on a projector, TV or touch screen.

Make a review gameFree games library

This simulation is a dark optics bench for the whole class. Shine a laser at the boundary between two materials and watch it bend, measure the angles on the protractor, then tilt it until the light can no longer get out. Switch to the prism and white light splits into a rainbow. Switch to the lens and a little candle makes a real or virtual image while the three special rays draw the ray diagram for you, with the numbers from the lens formula.

How to use it

  • Refraction: drag anywhere to move the laser around the point of incidence. Pick each material or set any index with the slider. Put the laser in the bottom material to find total internal reflection; Swap turns the two materials around.
  • Prism: drag the laser to move it, the yellow ring to aim, the glass to turn it. Choose a prism, a half disc or a glass block, the material, and white light or one colour.
  • Lens: drag the candle to move it or make it taller, drag F (or the slider) to change the focal length, and switch between converging and diverging. More rays shows a whole fan of light.
  • Keys and projector: click the board and use the arrow keys (Shift for bigger steps). Full screen makes text and buttons big enough for the back row.

Reflection and refraction

At the boundary between two transparent materials, part of the light bounces back (reflection) and part goes through and changes direction (refraction). Angles are measured from the normal, the dashed line at right angles to the boundary: the angle of incidence i, the angle of reflection i′ (always equal to i) and the angle of refraction r.

Light slows down in glass or water. How much it slows is the index of refraction n: light is 1.33 times slower in water than in a vacuum, so water has n = 1.33. Going into a material with a bigger n, light bends toward the normal; going into a smaller n, it bends away from it. Snell's law gives the exact angle:

n₁ sin i = n₂ sin r

MaterialIndex of refraction n
Vacuum1 (exactly)
Air1.0003 (the simulation uses 1.00)
Ice1.31
Water1.33
Ethanol1.36
Acrylic (plexiglass)1.49
Crown glass1.52
Flint glass1.62
Sapphire1.77
Diamond2.42

The reflected beam's brightness comes from the Fresnel equations: straight into glass only about 4% of the light reflects, at a grazing angle almost all of it.

Total internal reflection and optical fibres

Going from a denser material into a less dense one (glass to air), the ray bends away from the normal. As i grows, r reaches 90° and the ray skims along the surface: that angle of incidence is the critical angle, where sin(critical angle) = n₂ / n₁. Past it, no light gets out and everything reflects. This is total internal reflection.

Critical angles to air: water 48.8°, glass (n = 1.5) 41.8°, diamond 24.4°. Diamond's small critical angle traps light inside a cut stone, which is why it sparkles. An optical fibre is a thin glass core in a cladding of slightly lower index: light meets the wall beyond the critical angle and bounces along for kilometres, in internet cables and medical endoscopes.

Prisms and colours

White light is a mix of colours. Glass slows violet light a little more than red, so n depends on the colour: for crown glass n ≈ 1.514 for red and 1.531 for violet. A prism bends each colour by a different amount, and white light fans out into a spectrum: red bends least, violet most. This is dispersion. Flint glass spreads the colours more than twice as wide as crown glass. Raindrops do the same thing to sunlight to make a rainbow.

Lenses

A converging lens (thicker in the middle) brings rays parallel to the axis together at the principal focus F′; a diverging lens (thinner in the middle) spreads them out as if they came from a focus. The distance from the optical centre O to a focus is the focal length f. Three special rays from the top of the object find the image:

  1. A ray parallel to the axis leaves through F′ (diverging lens: as if it came from F).
  2. A ray through the optical centre O goes straight on.
  3. A ray through F (diverging lens: heading for F′) leaves parallel to the axis.

Where the rays meet is a real image: upside down, and it shows on a screen. If they spread apart, their dashed extensions meet on the object's side at a virtual image: upright, seen only through the lens. The lens formula links the object distance d and image distance d′, and the magnification is k = h′/h = −d′/d:

1/f = 1/d + 1/d′

The simulation uses signs: d′ is negative for a virtual image, f is negative for a diverging lens, and a negative k means the image is upside down.

Try this

  • Air to water at i = 30°: sin r = sin 30° / 1.33 = 0.376, so r = 22.1°. Check it on the protractor.
  • Critical angle: top air, bottom glass, laser underneath. Turn it slowly: the refracted ray fades and vanishes past 41.8°.
  • Lens, f = 10 cm: at d = 30 cm the image is at d′ = 15 cm with k = −0.5 (real, upside down, half size). At 20 cm (2F) it's the same size at 20 cm; at 15 cm it's at 30 cm and twice as big; at 10 cm there is no image; at 5 cm, d′ = −10 cm and k = 2: virtual, upright and twice as big, like a magnifying glass.
  • Diverging, f = −10 cm, d = 10 cm: d′ = −5 cm, k = 0.5. A diverging lens always gives a small, upright, virtual image.

Teaching ideas

  1. Predict first: before the laser goes into glass, ask "Toward the normal or away from it?" Then show it.
  2. Measure Snell's law (10 minutes): read i and r at four angles, work out sin i / sin r and find it's always n₂/n₁.
  3. The disappearing ray: in the half disc, turn the glass slowly and let the class shout "stop!" when no light comes out. Compare with the critical angle.
  4. Image hunt: give each group a distance (3f, 2f, 1.5f, f, 0.5f) to predict the image, then check on the big screen.
  5. Review: press "Make a review game" for a team game on the same screen, with your phone as the remote.

Frequently asked questions

Are the angles in the simulation exact?

Yes. Every angle comes from Snell's law and is shown to a tenth of a degree. The critical angles (48.8° for water, 41.8° for glass) and the lens images match the textbook formulas and are checked by automatic tests.

Why is the reflected ray so faint?

A clear surface reflects little light: about 2% for water and 4% for glass, straight on. Each ray's brightness comes from the Fresnel equations, so the reflection grows at grazing angles and takes all the light once total internal reflection starts.

Why does the prism spread colours only a little?

Real crown glass changes its index only from about 1.514 (red) to 1.531 (violet), and the simulation uses these real values, so the spectrum is narrow, as in a real lab. Pick flint glass for a wider spread.

What do the negative numbers in the lens panel mean?

They are signs: a negative d′ is a virtual image on the object's side, a negative f is a diverging lens, a negative k is an upside-down image. Textbooks that write distances without signs use a separate formula for virtual images; the sizes agree.

Does it work on an interactive whiteboard?

Yes. Drag the laser, the aim ring, the glass, the candle or the focus with a finger. It runs in any modern browser with no installation or account, and goes full screen for a projector.

← All simulations