Snell's Law Simulator
Back
Optics / High School Physics

Snell's Law Simulator — Refraction & Total Internal Reflection

Adjust refractive indices and incident angle to see real-time ray diagrams. Critical angle is auto-calculated and a refracted-angle vs incident-angle curve is plotted instantly.

Medium 1 (upper) Presets
Refractive Index n₁
Medium 2 (lower) Presets
Refractive Index n₂
Incident Angle θ₁ (°)
°
Results
Results
Refraction Angle θ₂
Critical Angle θc
Refraction
State
n₂ / n₁
Ray
Curve
Theory & Key Formulas
Snell's law: $n_1 \sin\theta_1 = n_2 \sin\theta_2$

Refraction: $\theta_2 = \arcsin\!\left(\dfrac{n_1}{n_2}\sin\theta_1\right)$

Critical angle $(n_1 > n_2)$: $\theta_c = \arcsin\!\left(\dfrac{n_2}{n_1}\right)$

What is Snell's Law?

🙋
What exactly is Snell's Law? I see the light ray bending in the simulator, but what's the rule behind it?
🎓
Basically, it's the formula that predicts how light bends when it passes from one transparent material into another. The key is the refractive index, labeled `n` in the simulator. In practice, if light goes from air (n₁) into water (n₂), it slows down and bends. Try moving the "Incident Angle θ₁" slider and watch how the transmitted angle θ₂ changes instantly.
🙋
Wait, really? So the bending depends on the material's "n". What happens if I make n₁ bigger than n₂, like light going from glass into air?
🎓
Great question! That's when things get interesting. When n₁ > n₂, the light bends away from the normal line. Keep increasing θ₁ with the slider, and you'll see the transmitted ray get closer to the surface. A common case is a fiber optic cable: light is trapped inside the glass core because it can't escape into the cladding.
🙋
Okay, I see a "Critical Angle" pop up sometimes. What is that, and why does the light stop transmitting?
🎓
That's total internal reflection! When n₁ > n₂ and you hit the critical angle, the transmitted ray vanishes and 100% of the light reflects back inside the first material. For instance, this is how diamond sparkles—light enters but gets trapped by repeated internal reflections. In the simulator, set n₁=1.5 (glass) and n₂=1.0 (air), then slowly drag θ₁ up to watch the critical angle appear.

Physical Model & Key Equations

The core relationship governing refraction is Snell's Law. It states that the product of the refractive index and the sine of the angle in each medium is constant.

$$n_1 \sin\theta_1 = n_2 \sin\theta_2$$

n₁, n₂: Refractive indices of the first and second medium. A higher `n` means light travels slower in that material.
θ₁: Angle of incidence, measured from the normal (perpendicular line to the surface).
θ₂: Angle of refraction, also measured from the normal.

When light travels from a denser to a rarer medium (n₁ > n₂), there exists a specific incident angle—the critical angle—beyond which refraction is impossible and all light is reflected.

$$\theta_c = \arcsin\!\left(\dfrac{n_2}{n_1}\right)$$

θ_c: The critical angle. For any incident angle θ₁ > θ_c, total internal reflection occurs. This equation only applies when n₁ > n₂.

Real-World Applications

Fiber Optic Communication: Data is sent as pulses of light through thin glass fibers. Total internal reflection keeps the light trapped inside the core, allowing signals to travel vast distances with minimal loss, forming the backbone of the internet.

Lens Design (Eyeglasses, Cameras): Snell's Law is used to calculate the precise curvature of lenses. By controlling how light bends at each air-glass interface, opticians can correct vision (concave for nearsightedness, convex for farsightedness) and camera designers can minimize optical aberrations.

Gemology & Diamond Cutting: The dazzling brilliance of a diamond is engineered. Cutters angle the facets so that light entering the stone undergoes total internal reflection multiple times before exiting back toward the viewer's eye, maximizing sparkle.

Atmospheric Refraction & Mirages: The air's refractive index changes with temperature and density. When light passes through these layers, it bends, creating phenomena like mirages (where the sky appears as water on a hot road) or making the sun appear above the horizon even after it has physically set.

Common Misconceptions and Points to Note

First, you might think of the refractive index as an "absolute, intrinsic property of a material," but it actually varies slightly depending on the wavelength of light. For example, a prism creates a rainbow because the refractive index of glass differs for red light and blue light (dispersion). This simulator assumes a single wavelength, so in actual design, you need to account for this "chromatic aberration."

Next, the way the angle of incidence is measured. The angle slider on the screen is the angle from the "normal to the boundary surface," right? However, in the field, people sometimes refer to the angle from the boundary surface itself (its complement). So, when reading specifications, always check "which angle is being used." For instance, an incidence of 60 degrees from the normal is 30 degrees from the interface. Confusing these can lead to serious design errors.

Finally, the simulator deals with "perfectly flat surfaces," but real-world interfaces have roughness and contamination. For example, if dust gets into an optical fiber connector, unintended scattering or reflection occurs there, causing signal loss. When things don't work as theory predicts, it's important to suspect these "gaps between ideal and reality."