Skip to main content
Preparing workspace

Light Refraction Simulator

Solve n₁ sin θ₁ = n₂ sin θ₂ on a live ray diagram: air to water at 45° gives 32.05°. Pick 11 materials or any n to see the critical angle and TIR.

Still loading. If the tool doesn’t appear, reload this page.

Planned features and workflows

About this tool

Light Refraction Simulator

Interactive Snell's Law light refraction simulator with material refractive index controls, critical angle detection, and Total Internal Reflection.

Snell's law, n₁ sin θ₁ = n₂ sin θ₂, gives the angle of a refracted ray. Light going from air (n = 1.0003) into water (1.333) at 45° bends to 32.05°. Choose two media or type your own indices, set the incident angle, and read θ₂, the critical angle from sin θc = n₂/n₁, and whether total internal reflection occurs.

How to use Light Refraction Simulator

  1. Pick medium 1 (the incident side) and medium 2 from the presets, such as air (1.0003), water (1.333), crown glass (1.52) or diamond (2.417), or type your own refractive index from 1 to 5.

  2. Drag the incident angle slider from 0° to 89°, or type a decimal angle; the diagram redraws the incident, reflected and refracted rays against the dashed normal.

  3. Read the refraction angle θ₂, the critical angle θc, the ratio n₁/n₂ and the speed of light in each medium. θ₂ shows "None (TIR)" when the ray is totally internally reflected.

Why use Light Refraction Simulator

  • Snell's law solved live

    θ₂, the critical angle, the n₁/n₂ ratio and the speed of light in each medium update on every slider step or keystroke.

  • Total internal reflection made visible

    When Snell's law would need sin θ₂ above 1, the refracted ray disappears and the reflected ray is drawn at full strength, so the cutoff is something you see, not just read.

  • Both directions of the boundary

    Swap media reverses the pair in one click, so you can compare bending toward the normal and away from it with the same two materials.

Common use cases

  • Seeing why a straw looks bent in a glass of water: set air to water at 45° and the ray swings to about 32° from the normal
  • Showing a class total internal reflection, the effect optical fibres rely on, by stepping the incident angle past the 24.45° diamond-to-air critical angle and watching the refracted ray vanish
  • Sanity-checking a physics homework answer for θ₂ before writing it up, with the ratio n₁/n₂ shown alongside so you can see which way the light should bend

Frequently asked questions

What is Snell's law?

Snell's law states that n₁ sin θ₁ = n₂ sin θ₂, where n is a medium's refractive index and θ is the angle measured from the normal — the line perpendicular to the boundary, not the surface itself. The simulator solves it for θ₂ = arcsin((n₁/n₂) sin θ₁) each time you change the angle or a medium.

Link to answer
What is the critical angle for water to air?

About 48.6°, from sin θc = n₂/n₁ = 1.0003/1.333. Beyond that angle light hitting the water surface from below is entirely reflected back into the water, which is why the surface looks mirrored when you are underwater looking up at a shallow angle.

Link to answer
Why does light bend toward the normal going into glass?

Because glass has the higher refractive index (1.52 against 1.0003 for air), so sin θ₂ must be smaller than sin θ₁ to keep both sides of Snell's law equal. Going the other way, from the denser medium into the rarer one, the ray bends away from the normal and can reflect entirely once past the critical angle.

Link to answer
When does Total Internal Reflection happen?

Only when light travels from a higher index into a lower one and the incident angle exceeds the critical angle: 41.15° for crown glass (1.52) to air and 24.45° for diamond to air. If n₂ is equal to or greater than n₁ there is no critical angle, and the tool shows "None (n₁ ≤ n₂)".

Link to answer
How do I calculate the angle of refraction?

Rearrange Snell's law: θ₂ = arcsin(n₁ sin θ₁ / n₂). For air to crown glass at 30°, sin θ₂ = 1.0003 × 0.5 / 1.52 = 0.329, so θ₂ is 19.21°. Going the other way, from glass to air at 30°, sin θ₂ = 1.52 × 0.5 / 1.0003 = 0.760, so θ₂ is 49.44°.

Link to answer
Which refractive index values does the simulator use?

Typical textbook values for yellow light near 589 nm at room temperature: vacuum 1, air 1.0003, ice 1.31, water 1.333, ethanol 1.361, acrylic 1.49, crown glass 1.52, flint glass 1.62, sapphire 1.77, cubic zirconia 2.15 and diamond 2.417. Real materials vary with composition and wavelength, so you can type a custom index instead.

Link to answer