Refraction & Snell's Law Simulator — Light Bending at a Boundary Interactive

Interactive ray-diagram laboratory demonstrating Snell's law of refraction across a boundary between two media, with adjustable incidence angle and refractive indices, live equation verification, and preset air/water/glass/diamond scenarios.

← Optics Labs
About this tool — how it works & FAQOpen ▾Close ▴

About the Refraction & Snell's Law Simulator

This simulator sends a light ray across a boundary between two transparent media and lets you adjust the incidence angle and each medium's refractive index. Snell's law, n₁ sin θ₁ = n₂ sin θ₂, is verified live on both sides of the boundary as you change any parameter.

What the simulator shows

• A two-medium ray diagram with the incident ray, a weak partial-reflection ray, and the refracted transmitted ray, plus the surface normal. • Three live controls: incidence angle (0°-89°), n₁ for the upper medium and n₂ for the lower medium (1.00-2.50 each). • Live readouts for θ₁, θ₂, and both sides of Snell's law (n₁sinθ₁ and n₂sinθ₂), which always match. • Four preset material pairs: air-to-water, air-to-glass, water-to-air, and air-to-diamond. • Automatic detection and explanation when the angle and index combination produces total internal reflection instead of transmission.

Why light bends at a boundary

Light travels at different speeds in different media — slower in materials with higher refractive index. Refraction is the geometric consequence of that speed change: Huygens' principle shows that a wavefront crossing the boundary at an angle must bend, because the part of the wavefront still in the faster medium keeps moving ahead of the part now in the slower medium. Snell's law, n₁sinθ₁ = n₂sinθ₂, is the precise mathematical statement of that bending.

Toward or away from the normal

Going from a less-dense (lower n) medium into a more-dense (higher n) medium always bends the ray toward the normal — light slows down and compresses its wavefronts. Going the other way, from denser to less dense, bends the ray away from the normal, and if the incidence angle is steep enough, no real solution for θ₂ exists at all — that is total internal reflection, covered in its own dedicated lab.

Frequently asked questions

What is Snell's law?

Snell's law states n₁ sin θ₁ = n₂ sin θ₂, where n₁ and n₂ are the refractive indices of the two media and θ₁, θ₂ are the angles from the normal on each side of the boundary. It predicts exactly how much a light ray bends when crossing between media.

Why does light bend toward the normal entering a denser medium?

Because the wave slows down as it enters the higher-index medium, its wavefronts compress, which geometrically forces the ray direction to swing closer to the perpendicular (normal) at the boundary — confirmed directly by Snell's law since sinθ₂ = (n₁/n₂)sinθ₁ is smaller when n₂ > n₁.

What happens if n₁ sinθ₁ is greater than n₂?

There is no real angle θ₂ that satisfies Snell's law, so no light can refract through — instead all of it reflects back into the first medium. This is total internal reflection, and it can only happen going from a higher-index medium to a lower-index one.

Does this simulator account for the reflected ray too?

Yes — a faint partial-reflection ray is always shown alongside the refracted ray, since every real boundary reflects some light even when most of it transmits; the simulator focuses its calculations on the refraction angle rather than the exact reflected/transmitted energy split.

Related tools & guides