Snell's Law and Total Internal Reflection
Why does a straw look bent in a glass of water? Why do diamonds sparkle, optical fibers trap light for thousands of kilometres, and hot asphalt seem to shimmer like a lake? All three come from one deceptively simple equation relating two angles and two refractive indices.
1. Why light bends at an interface
Light travels at different speeds in different media. In vacuum it moves at c = 299,792,458 m/s; in water it slows to about 0.75c, in glass to roughly 0.66c. We describe this slowdown with the refractive index n = c / v — a dimensionless number that is 1.0003 for air, 1.33 for water, and 1.5–1.9 for common glasses.
When a ray crosses the boundary between two media at an angle, one side of the wavefront enters the slower medium before the other side does. That side is "held back", which rotates the direction of travel — exactly the way a marching band bends when one file steps onto muddy ground while the rest is still on pavement. The ray bends towards the normal when entering a denser medium, and away from the normal when leaving it.
The law is named after Dutch astronomer Willebrord Snellius (1621), though Ibn Sahl described the same relationship geometrically in Baghdad around 984 CE, and Descartes published an independent derivation in 1637 — hence the law is also called "Descartes' law" in French-language texts.
2. Deriving Snell's law from Fermat's principle
Fermat's principle states that light travels between two points along the path that takes the least time (more precisely, a stationary time — a local extremum). Consider a ray leaving point A in medium 1 (index n₁), crossing a flat interface, and arriving at point B in medium 2 (index n₂). Let the crossing point be a horizontal distance x from directly below A.
where a, b are the perpendicular distances of A and B from the interface, d is the horizontal separation, and v₁ = c/n₁, v₂ = c/n₂ are the speeds in each medium.
Minimising t(x) means setting dt/dx = 0. Differentiating and recognising that x/√(a²+x²) = sin θ₁ and (d−x)/√(b²+(d−x)²) = sin θ₂ (the sines of the angles measured from the normal), the equation collapses to:
This is remarkable: the messy geometric optimisation reduces to a one-line relationship between the sines of the incidence and refraction angles. It says nothing about why light "chooses" the fastest path — that deeper explanation comes from the wave picture (Huygens' principle) or from quantum electrodynamics, where every path is summed and only paths near the stationary-time path survive destructive interference.
Huygens' principle gives the same result by matching wavefronts at the boundary: the ratio of wavelengths in the two media equals λ₁/λ₂ = v₁/v₂ = n₂/n₁, and simple triangle geometry on the wavefronts reproduces n₁ sin θ₁ = n₂ sin θ₂ without invoking "least time" at all.
3. The critical angle and total internal reflection
Rearrange Snell's law to solve for the refraction angle when going from a denser medium (n₁) into a rarer one (n₂ < n₁):
Because n₁/n₂ > 1, sin θ₂ grows faster than sin θ₁. At some incidence angle θc, sin θ₂ reaches exactly 1 — meaning θ₂ = 90°, and the refracted ray skims along the interface itself. Beyond that angle there is no mathematical solution for θ₂: no light can refract out at all. Every photon is reflected back into the denser medium. This is total internal reflection (TIR).
Unlike ordinary reflection off a mirror, TIR is 100% efficient — no absorption, no partial transmission, provided the surfaces are clean and the second medium's index really is lower. Some example critical angles for light travelling from a denser medium into air (n₂ ≈ 1.0):
| Medium 1 | Refractive index n₁ | Critical angle θc |
|---|---|---|
| Water | 1.33 | 48.6° |
| Crown glass | 1.52 | 41.1° |
| Diamond | 2.42 | 24.4° |
| Silica fiber core (vs. cladding, n₂ ≈ 1.44) | 1.46 | ~80.5° |
Notice diamond's exceptionally small critical angle: light entering a cut diamond struggles to find an exit angle below 24.4° and instead bounces internally many times before escaping — one of the reasons diamonds appear so brilliant when cut with the correct facet angles.
4. Applications: fibers, diamonds, mirages
Optical fibers
A glass fiber has a core with a slightly higher refractive index than its surrounding cladding (typically ncore ≈ 1.46, nclad ≈ 1.44). Any light ray that enters within the fiber's acceptance cone hits the core-cladding boundary at an angle steeper than the critical angle and undergoes TIR over and over, bouncing down the fiber for kilometres with almost no loss. This is the same physics explored in more depth in our article on fiber optics, including the related concept of numerical aperture.
Gemstone brilliance
Diamond cutters exploit the small critical angle of diamond (24.4°) by choosing facet angles so that light entering through the top always strikes the bottom facets steeper than θc and bounces back out towards the viewer, rather than leaking out of the bottom of the stone.
Mirages
Hot air near asphalt is less dense and has a slightly lower refractive index than the cooler air above it. Light from the sky travelling at a very shallow (near-grazing) angle towards the ground can exceed the local critical angle between these thin, continuously-varying air layers and curve back upward — the brain interprets this bent ray as a "reflection" from a non-existent puddle. This is continuous refraction rather than a single sharp interface, but the same critical-angle condition governs when the ray turns back.
5. Beyond the critical angle: the evanescent wave
Total internal reflection isn't perfectly "nothing happens" on the far side of the interface. Maxwell's equations require the field to be continuous across the boundary, so a thin non-propagating evanescent wave exists just beyond the surface, decaying exponentially with distance:
If a second medium of similar index is brought within roughly one wavelength of the interface, this evanescent field can couple energy across the gap and light "tunnels" through — a direct optical analogue of quantum tunnelling, known as frustrated total internal reflection. It's used in beam-splitter cubes and fingerprint scanners.
6. Ray tracing Snell's law in code
A robust refraction routine (used in ray tracers, and in the simulations linked below) needs to detect TIR and fall back to pure reflection when it occurs:
function refract(incident, normal, n1, n2):
cosI = -dot(normal, incident)
eta = n1 / n2
k = 1 - eta*eta * (1 - cosI*cosI)
if k < 0:
// Total internal reflection: no refracted ray exists
return reflect(incident, normal)
cosT = sqrt(k)
return eta * incident + (eta * cosI - cosT) * normal
The key branch is k < 0: it corresponds exactly to
sin θ₂ > 1 in the algebra above — the point at which Snell's
law runs out of real solutions and reflection becomes the only
option.
🌈 See refraction and dispersion live
Watch Snell's law in action as white light splits into a spectrum through a glass prism — each wavelength has a slightly different refractive index, so each bends by a slightly different angle.
Open simulation →