← All lessons

Snell's law

Trace a ray through a flat, parallel-sided window. Set the incidence angle, window thickness and the three refractive indices to get the refraction angles, lateral ray displacement and any total internal reflection.

°
mm
Input medium n₁
Window glass n₂
Output medium n₃

How this works

Snell's law at each surfacen₁ sin θ₁ = n₂ sin θ₂ = n₃ sin θ₃

Because the faces are parallel, the exit angle depends only on n₁ and n₃. The glass sets the path inside the window.

Lateral displacementd = t · sin(θ₁ − θ₂) / cos θ₂

Perpendicular distance between the exit point and the undeviated ray. When n₁ = n₃ the exit ray is parallel to the incident ray, offset by d.

Total internal reflectionn₁ sin θ₁ > n₂ (first face)
n₁ sin θ₁ > n₃ (second face)

TIR is only possible going from a higher to a lower index. It begins at θ₁ = asin(min(n₂, n₃) / n₁). Light reflected at the exit face always escapes back out the entrance face, because n₁ sin θ₁ never exceeds n₁.