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?
▶ Launch the interactive simulationRace 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θ₂).
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₂