Simulation

Snell's Law · SimulatorRefraction and Total Internal Reflection

Geometric OpticsRefraction

A ray crossing between two media with adjustable indices; bend angle follows n₁sinθ₁ = n₂sinθ₂

Published: June 25, 2026

Objective

Verify that the refracted angle obeys n₁ sin θ₁ = n₂ sin θ₂ by reading the θ₂ readout at different index combinations, and identify the critical-angle threshold at which total internal reflection replaces transmission. The model assumes a planar interface, monochromatic light, and a single ray (geometric-optics limit, no diffraction or dispersion).

Setup

  1. Leave sliders at their defaults: n₁ = 1.00 (air), n₂ = 1.50 (glass), θ₁ = 40°. Press Start and observe the refracted ray bend toward the normal. The readout θ₂ should read approximately 25.4°.
  2. After the run completes, press Reset. Change n₁ to 1.50 and n₂ to 1.00 (glass into air). Keep θ₁ = 40°. Press Start: the refracted ray now bends away from the normal.
  3. Without resetting, drag θ₁ upward from 40° toward 85° in Fresh state. Watch θ₂ displayed in the readout grow; note that TIR reads 'No' throughout because 40° is still below the critical angle for n₁ = 1.50, n₂ = 1.00.
  4. Set θ₁ to 50° (above the critical angle 41.8°). Press Start: TIR flips to 'Yes', θ₂ shows 'TIR', and the refracted ray disappears while the reflected ray becomes bold.
  5. Reset and set n₁ = 1.33 (water), n₂ = 1.00 (air), θ₁ = 50°. Check whether TIR occurs (critical angle ≈ 48.8°, so 50° is just past it). Confirm TIR = 'Yes'.
The Snell's Law simulator at the start of a run.

Analytical Prediction

With n₁ = 1.00, n₂ = 1.50, and θ₁ = 40°, Snell's Law gives:

θ₂=arcsin(n₁ · sin θ₁ / n₂)
=arcsin(1.00 · sin 40° / 1.50)
=arcsin(0.6428 / 1.50)
=arcsin(0.4285)
25.4°

The Snell product n₁ · sin θ₁ = 1.00 · sin 40° ≈ 0.6428 is displayed in the `n₁ · sin θ₁` readout. For the TIR case with n₁ = 1.50, n₂ = 1.00, the critical angle is:

θ_c=arcsin(n₂ / n₁)
=arcsin(1.00 / 1.50)
=arcsin(0.6667)
41.8°

Any θ₁ > 41.8° produces TIR. At θ₁ = 50°, sin θ₁ = 0.766 and (n₁/n₂) · sin θ₁ = 1.149 > 1, confirming no real refracted angle exists.

Results Analysis

After pressing Start with the default settings (n₁ = 1.00, n₂ = 1.50, θ₁ = 40°), the `θ₂ (°)` readout shows approximately 25.4 and the `TIR` readout shows 'No'. The `n₁ · sin θ₁` readout stays at approximately 0.6428 regardless of θ₁, confirming the conserved Snell product. When TIR activates (n₁ = 1.50, n₂ = 1.00, θ₁ = 50°), `θ₂ (°)` switches to 'TIR', `TIR` switches to 'Yes', and `Reflectance` jumps to 1.000. The secondary panel (right) shows the θ₂(θ₁) curve: concave-up for air-to-glass (n₁ < n₂), with the live dot tracking the current angle; when n₁ > n₂ a red dashed vertical line marks θ_c and the curve terminates there.

The Snell's Law simulator after a completed run.

Source of Error

The simulation models a single plane wave at a flat interface with no dispersion, so the refracted angle is exact by construction (closed-form arcsin). Physical idealizations omitted include: chromatic dispersion (real glass splits white light into a spectrum), surface roughness (scattering at a real interface), polarization-averaged reflectance (the sim uses s-polarization only), finite beam width and diffraction, and curved interfaces. Because the sim computes angles directly from the Snell formula rather than integrating a wave equation, there is no numerical drift: the residual between the predicted θ₂ and the readout is purely rounding at one decimal place display precision.

Further Exploration