How it works
Light bends when it passes from one material into another with a different refractive index. Snell's law links the angles measured from the normal, the line perpendicular to the surface. When light travels from a denser medium to a thinner one and the angle is large enough, no light gets out and it all reflects back: that is total internal reflection, and the angle where it starts is the critical angle. The indices are yours to type, from a table or a data sheet.
Formula
θ2 = asin(n1 × sin(θ1) ÷ n2)
critical angle = asin(n2 ÷ n1), only when n1 > n2
Sources
Example
Air to glass with n1 = 1.0, n2 = 1.5 and a 30° incident angle: sin(θ2) = 1.0 × 0.5 ÷ 1.5 = 0.3333, so θ2 = 19.47°. Check: 1.0 × sin(30°) = 0.5000, and 1.5 × sin(19.47°) = 0.5000. From glass to air the critical angle is asin(1 ÷ 1.5) = 41.81°.
Frequently asked questions
Which index is which?
n1 is the medium the light starts in, n2 is the one it enters.
What is the index of air?
About 1.0003, which is treated as 1 in most calculations.
When does total internal reflection happen?
When the light goes from denser to thinner and the sine of the refracted angle would exceed 1.
How are the angles measured?
From the normal, the line perpendicular to the surface, not from the surface itself.