Snell's Law Simulator
Back
Optics / High School Physics

Snell's Law Simulator — Refraction & Total Internal Reflection

Drag the incident ray at the interface between two media to change θ₁ and watch the refracted and reflected rays bend live. Toggle a bending-wavefront overlay, see the total-internal-reflection critical angle, and read the Fresnel reflectance in real time.

Medium 1 (upper) Presets
Refractive Index n₁
Medium 2 (lower) Presets
Refractive Index n₂
Incident Angle θ₁ (°)
°
Drag the upper half of the ray diagram to change the incident angle
Results
Live Readouts
40°
Incident θ₁
Refracted θ₂
Critical θc
1.00→1.50
n₁ → n₂
Reflectance R
Ray Diagram (drag to change θ₁)
Incident ray Reflected ray Refracted ray Critical angle θc Wavefronts
Results
Refraction Angle θ₂
Critical Angle θc
Refraction
State
n₂ / n₁
Refraction angle vs incidence angle
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 \gt n_2)$: $\theta_c = \arcsin\!\left(\dfrac{n_2}{n_1}\right)$

Check: air→water (1→1.33) at θ₁=45° gives θ₂≈32.1°. Diamond→air critical angle θc≈24.4°.

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. Drag the incident ray in the diagram, or move 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 θ₁, 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 green critical-angle line and the TIR 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₂.

Snell's Law and Refractive Index

When light passes through the boundary between media of different refractive indices, the angle of incidence $\theta_1$ and the angle of refraction $\theta_2$ are related by Snell's law.

$n_1 \sin\theta_1 = n_2 \sin\theta_2, \qquad n = \dfrac{c}{v}$

$n$ is the refractive index, the speed of light in vacuum $c$ divided by the speed of light in the medium $v$. Entering a medium with a higher refractive index (a denser medium) bends light toward the normal ($\theta_2<\theta_1$), while exiting into a medium with a lower index bends it away from the normal. Representative values are air $1.00$, water $1.33$, glass $1.5$, and diamond $2.42$.

Total Internal Reflection and the Critical Angle

When light travels from a medium of higher refractive index to one of lower index ($n_1>n_2$), increasing the angle of incidence makes the refraction angle reach $90°$. This angle of incidence is the critical angle $\theta_c$, and beyond it total internal reflection occurs, in which all the light is reflected at the boundary.

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

Total internal reflection is the principle behind optical fibers (which confine and transmit light within the core), prisms, and the brilliance of diamonds. The critical angle for water→air is about $48.6°$, and for glass→air about $41.8°$. In this simulator you can vary the angle of incidence and observe the switch between refraction and total internal reflection.

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."

How to Use

  1. Enter refractive index for medium 1 (vN1) — typically 1.0 for air or 1.33 for water
  2. Enter refractive index for medium 2 (vN2) — use 1.5 for glass, 2.42 for diamond
  3. Input incident angle θ₁ (vTheta1) in degrees measured from the normal, or drag the incident ray directly in the diagram
  4. The simulator calculates refraction angle θ₂ using Snell's law: n₁ sin(θ₁) = n₂ sin(θ₂)
  5. Compare θ₂ against critical angle θc to detect total internal reflection when n₁ > n₂

Worked Example

Light travels from water (n₁ = 1.33) into crown glass (n₂ = 1.52) at incident angle θ₁ = 35°. Using Snell's law: 1.33 × sin(35°) = 1.52 × sin(θ₂), solving θ₂ = 30.1°. Now reverse the path: light from glass (n₁ = 1.52) to water (n₂ = 1.33) at θ₁ = 45°. Critical angle θc = arcsin(1.33/1.52) = 61.0°. Since 45° < 61.0°, refraction occurs (θ₂ = 53.9°). If θ₁ exceeds 61.0°, total internal reflection dominates with zero transmission.

Practical Notes

  1. Optical fiber design depends on critical angle — typical step-index fibers use core (n = 1.48) and cladding (n = 1.46) to achieve ~80° critical angle for waveguide confinement
  2. Gemstone cut quality relies on total internal reflection — diamond's high refractive index (2.42) produces critical angle of ~24.4°, maximizing internal light paths for brilliance
  3. When n₁ < n₂ (entering denser medium), refraction angle always bends toward normal; critical angle never exists in this direction
  4. Underwater viewing: human eye (n ≈ 1.41) loses accommodation in water due to reduced refraction difference between cornea and surrounding medium