When light travels from a denser medium into a less
dense one, it bends away from the normal (Snell's law: n₁ sin θ₁ = n₂
sin θ₂). Above the critical angle θ_c = arcsin(n₂/n₁)
the refracted ray disappears entirely — all light is reflected. This is
the principle behind fibre optics, diamond brilliance,
and mirages. Drag the incident ray or use the angle slider.
Medium 1 (dense, bottom)
Medium 2 (less dense, top)
Angle
Info
θ₁ (incident)35.0°
θ_c (critical)41.1°
θ₂ (refracted)—
Reflectance—
⚡ TOTAL INTERNAL REFLECTION
Physics
Snell's law n₁ sin θ₁ = n₂ sin θ₂ governs refraction
at any interface. For light moving from dense (n₁) to less dense (n₂
< n₁) medium, θ₂ > θ₁. The critical angle θ_c =
arcsin(n₂/n₁) is reached when θ₂ = 90°. Beyond this, sin θ₂ > 1 has
no real solution — the wave becomes evanescent and all energy is
reflected.
The Fresnel equations give the exact reflected fraction. At normal
incidence (~0°), about 4% reflects off a glass-air interface. Near the
critical angle, reflectance rises steeply to 100%.
Applications
Fibre optics (internet cables, medical endoscopes)
trap light inside a glass core by TIR. Diamonds are
cut so light entering the table hits every facet above the critical
angle (24.4°) before exiting — maximizing brilliance.
Mirages occur when heated road air acts as a
less-dense layer, reflecting the sky downwards.
About Total Internal Reflection
This simulation models a single light ray striking the flat horizontal interface between a denser lower medium (refractive index n₁) and a less dense upper medium (n₂). It applies Snell's law, n₁ sin θ₁ = n₂ sin θ₂, to find the refracted angle, and the Fresnel equations to compute reflectance. When the incident angle reaches the critical angle θ₊ = arcsin(n₂/n₁), the refracted ray vanishes and every photon is reflected.
You set the two media using preset buttons (glass 1.52, water 1.33, diamond 2.42, air 1.00) or the n₁ and n₂ sliders, and choose the incident angle θ₁ either with its slider or by dragging directly in the dense medium. The info panel reports θ₁, the critical angle, the refracted angle and the reflectance, while a fibre-optic toggle illustrates light trapped by repeated total internal reflection — the principle that carries internet data and powers endoscopes.
Frequently Asked Questions
What is total internal reflection?
Total internal reflection (TIR) is when light travelling inside a denser medium hits the boundary with a less dense medium at a steep enough angle that none of it refracts through — it is all reflected back. It only happens going from high refractive index to low, and only above the critical angle.
What is the critical angle?
The critical angle θ₊ is the incident angle at which the refracted ray would emerge exactly along the surface (θ₂ = 90°). It is given by θ₊ = arcsin(n₂/n₁). For glass to air the panel shows about 41.1°, for water to air about 48.8°, and for diamond to air only about 24.4°.
How does the simulation decide when TIR happens?
Each frame it computes sin θ₂ = (n₁/n₂) sin θ₁. If that value exceeds 1 there is no real refraction angle, so the code flags TIR, draws only the reflected ray and shows the warning banner. Equivalently, TIR is triggered whenever θ₁ reaches or exceeds the critical angle.
What do the n₁ and n₂ controls change?
n₁ is the refractive index of the dense lower medium and n₂ that of the less dense upper medium. Raising n₁ or lowering n₂ increases the index contrast, which lowers the critical angle and makes TIR easier. The presets jump to common materials; the sliders let you set any value, with n₁ from 1.01 to 3.0 and n₂ from 1.00 to 2.0.
What does the reflectance figure mean?
Reflectance is the fraction of incident light energy that is reflected rather than transmitted. The simulation uses the Fresnel equations, averaging the s- and p-polarised reflectances. At near-normal incidence on glass-air it is only about 4%, rising steeply as the angle approaches the critical angle, where it reaches 100%.
Why does the refracted ray bend away from the normal here?
Because light is moving from a denser medium into a less dense one (n₂ < n₁), Snell's law forces θ₂ to be larger than θ₁. As you increase the incident angle the refracted ray swings closer to the surface, until at the critical angle it lies flat along the boundary and then disappears.
Is the physics in this simulation accurate?
The core relationships are exact: Snell's law and the critical-angle formula are textbook results, and the reflectance uses the genuine Fresnel coefficients for unpolarised light. The visualisation is a simplified 2D ray diagram, so it omits effects such as the evanescent wave, beam width, dispersion and absorption.
What is the evanescent wave?
Even during total internal reflection the electromagnetic field does not stop abruptly at the boundary; a non-propagating evanescent wave penetrates a fraction of a wavelength into the less dense medium and decays exponentially. It carries no net energy across the interface, but it underlies frustrated TIR and devices like fingerprint sensors. This simulation does not draw it.
How do fibre optics use total internal reflection?
An optical fibre has a high-index glass core surrounded by a lower-index cladding. Light injected within the acceptance angle strikes the core-cladding boundary above the critical angle, so it reflects perfectly and zig-zags along the fibre with very little loss. The fibre toggle in this simulation shows that bouncing path.
Why do diamonds sparkle so much?
Diamond has a very high refractive index of about 2.42, giving a small critical angle near 24.4°. A brilliant cut is shaped so light entering the top hits the rear facets above that angle and is totally internally reflected back out through the crown, maximising the return of light and the characteristic fire and brilliance.