Refraction · Fermat → Snell
Light goes from a point in air to a point in glass. Of all the paths it could take, which does it follow — the straight line, or something else?

▶ Run the simulationSee the measured result
Units: sinθ₁/sinθ₂ = n₂/n₁ for air (n₁ = 1.000) → crown glass (n₂ = 1.500); Hecht, Optics 5e, Table 4.1
How the lab tests it
Race photon pulses from A (air, index n₁) to B (glass, n₂) down several broken paths A→(x,0)→B, each travelling at c/n₁ above the interface and the slower c/n₂ below, and time the arrivals; then read the winning path's angles, and across a sweep of incidence angles find each least-time path numerically and measure (sinθ₁, sinθ₂).
What it checks
FERMAT'S PRINCIPLE — light takes the path of LEAST time, which BENDS at the interface (the straight geometric line is slower), and the bend obeys SNELL'S LAW n₁ sinθ₁ = n₂ sinθ₂ (i.e. sinθ₁/sinθ₂ = v₁/v₂ = n₂/n₁); across angles the measured (sinθ₁, sinθ₂) fall on a straight line of slope n₁/n₂
Snell's law, refractive index & apparent depth calculator
Why light bends, and what the bend is worth measuring for. Snell's law is usually taught as a rule to apply; in this lab it is a RESULT — the simulation above knows only how long a broken path takes, races candidate paths against each other, and the sine law falls out of the winner's geometry. This page carries both directions of that. The forward solve bends a ray; the index solve runs it backwards, and because the measured boxes hold this lab's own raced angles rather than tidy textbook ones, it returns 1.500000039058 instead of a clean 1.5 — that +3.9e-8 is the flat-minimum floor a stopwatch cannot see past, and the finding prices it rather than rounding it away. The race direction does the whole thing from scratch here: a golden section that COMPARES arrival times, with no sine, no derivative and no stationarity condition anywhere in it, landing on a crossing 1.03e-7 from the one the simulation executed — 21% of the flat basin, which is one answer read twice, not two answers. It also times Hero of Alexandria's rival: the straight line from A to B, the shortest path, arrives 3.6466% late, and that measurement is what refuses least distance. The last box is a dial rather than a checkbox: f(θ) = w·sin θ + (1−w)·θ is Snell at w = 1 and Ptolemy's constant angle ratio at w = 0, the reading his tables carried for fourteen centuries. Fit the rival on small angles — where it is genuinely right, because sinθ → θ — and extrapolate to 83.8°, and it predicts 55.73° where Snell predicts 41.51° and this lab's stopwatch measured 41.52° ± 0.007°: a 2030-σ verdict reached here by pure closed form, on a route the simulation never took. Four things this page will not do — re-run the simulation, add chronometry noise, tell you how much light takes the path (Fermat picks the route, Fresnel sets the brightness), or account for dispersion, since every index here is one number at one colour.
n₁ sinθ₁ = n₂ sinθ₂ · n₂ = n₁ sinθ₁/sinθ₂ · θ_c = arcsin(n₂/n₁) · s = t·sin(θ₁−θ₂)/cos θ₂ · d′ = d·n₁/n₂ · δ = θ₁ + θ₂′ − A, n = sin((A+δ_min)/2)/sin(A/2) · t(x) = n₁|A→x| + n₂|x→B| minimised