Understanding the Snell's law calculator — concept and principle
This calculator applies Snell's law to find the angle of refraction when light passes from one medium into another, whether total internal reflection occurs, the critical angle, how much the ray bends and the speed of light in each medium. It includes common media such as air, water, glass and diamond. It is used in optics courses and for lenses, prisms and fibres.
How it is calculated
n₁ sin θ₁ = n₂ sin θ₂
θ₂ = arcsin(n₁ sin θ₁ ÷ n₂)
Critical angle (n₁ > n₂): θ_c = arcsin(n₂ ÷ n₁)
Speed of light in a medium = c ÷ n
- Angles are measured from the normal. Indices: air 1.000293, water 1.333, crown glass 1.52, diamond 2.419.
The principle
Light travels more slowly in denser optical media. When a wavefront crosses a boundary at an angle, the part that enters first slows down first, so the wavefront pivots and the ray changes direction. Going into a medium with a higher index, the ray bends towards the normal; going into a lower index, it bends away. Beyond the critical angle, no refracted ray can exist and all the light reflects, which is how optical fibres trap light.
Worked example
Default inputs: from air (1.000293) into water (1.333), incidence 30°.
- sin θ₂ = 1.000293 × sin 30° ÷ 1.333 = 0.3752.
- θ₂ = arcsin 0.3752 = 22.04°.
- Change of direction = 30 − 22.04 = 7.96°; the ray bends towards the normal.
- Light going into a denser medium cannot be totally reflected: no, critical angle —.
- Speeds: 299,705 km/s in air and 224,901 km/s in water.
| Angle of incidence (° from the normal) | Angle of refraction (°) |
|---|---|
| 7.5 | 5.62 |
| 15 | 11.2 |
| 22.5 | 16.69 |
| 30 | 22.04 |
| 37.5 | 27.18 |
| 45 | 32.05 |
| 60 | 40.53 |
How to read the result
The bigger the index difference, the more the ray bends. Reverse the media (water into air) to see total internal reflection above about 48.6°. Indices vary slightly with wavelength, which is what makes prisms split colours.
Common mistakes
- Measuring angles from the surface instead of the normal.
- Swapping n₁ and n₂.
- Expecting total internal reflection when light enters a denser medium.
Frequently asked questions
Why does a straw look bent in water?
Light from the straw bends at the water surface, so your eye sees it in a shifted position.
What is total internal reflection?
Complete reflection when light tries to leave a denser medium above the critical angle.
What is the critical angle from water to air?
About 48.6°.
Why does diamond sparkle?
Its high index gives a small critical angle, so light reflects many times inside.
Sources: OpenStax, University Physics Volume 3 (2016), sections 1.1 and 1.4