What this simulation shows
A ray box shines a narrow beam of light at the boundary between two materials. You choose the materials, and you set the angle by dragging the ray box or using the slider. The simulation draws the incident ray, the reflected ray and the refracted ray, measures the angles from the normal, and works out what happens using Snell's law.
Why light bends
Light travels at different speeds in different materials. It is fastest in a vacuum and almost as fast in air. In water it is about a quarter slower, and in glass about a third slower. The refractive index tells you how much slower:
When a ray meets a boundary at an angle, the change of speed makes it change direction. Light that slows down bends towards the normal. Light that speeds up bends away from it. A ray that arrives along the normal changes speed but not direction. Try 0° to see this.
Snell's law
Snell's law connects the angles on the two sides of the boundary:
When light enters a material from air, this becomes , where is the angle of incidence and is the angle of refraction. The Snell check readout works out both sides for you. Whatever angle you choose, the two numbers match.
The critical angle and total internal reflection
Now make the light go from glass into air. The refracted ray bends away from the normal, so it gets closer and closer to the surface as you raise the angle. At one angle it runs along the surface. This angle of incidence is the critical angle, :
Raise the angle any further and there is no refracted ray at all. All the light reflects back inside the glass. This is total internal reflection, and it is how optical fibres carry internet data and how endoscopes let doctors see inside the body.
Total internal reflection only happens when light is heading into a material with a lower refractive index. Going from air into glass, you will never see it, however large the angle.
Watch the reflected ray
Some light is always reflected at a boundary, even when most of it passes through. The simulation makes the reflected ray brighter or fainter to match how much light goes each way. At small angles only a few per cent is reflected. Near the critical angle, and at grazing angles, the reflection gets much stronger.
Symbols in your course
Some courses write the angles as and , others as and . Some only ask you to describe refraction rather than calculate it. The physics shown here is the same for every syllabus.