Precise calculations based on n₁·sinθ₁ = n₂·sinθ₂. Solve for any unknown (n₁, n₂, θ₁, θ₂), visualize ray bending, compute critical angle, Brewster angle, light speed, and explore material dispersion. Ideal for optics design, photonics, and physics education.
Snell's Law describes the relationship between angles of incidence and refraction when a wave passes across an interface between two isotropic media. The law is derived from Fermat's principle of least time and is fundamental to geometrical optics.
This calculator solves for any unknown variable (n₁, n₂, θ₁, θ₂) with automatic detection of the empty field. The interactive ray diagram shows the bending direction: rays bend toward the normal when entering a denser medium (n₂ > n₁), and away from the normal when entering a rarer medium (n₂ < n₁).
Double-precision arithmetic ensures relative error below 1×10⁻¹². Validation against known refractive scenarios:
| Test Case | Input (n₁, θ₁, n₂) | Expected θ₂ (°) | Computed θ₂ (°) | Absolute Error |
|---|---|---|---|---|
| Air to Water | 1.0003, 45°, 1.333 | 32.095° | — | — |
| Water to Air | 1.333, 30°, 1.0003 | 41.800° | — | — |
| Glass to Diamond | 1.52, 20°, 2.42 | 12.455° | — | — |
In real materials, the refractive index varies with wavelength (chromatic dispersion). This effect causes rainbows, chromatic aberration in lenses, and is exploited in prism spectrometers. The empirical Cauchy equation approximates normal dispersion:
n(λ) = A + B/λ² + C/λ⁴ (λ in micrometers)
For example, BK7 optical glass coefficients (λ in μm): A = 1.5046, B = 0.00420, C = 0.00031 → n(0.486 μm) ≈ 1.522, n(0.656 μm) ≈ 1.510.
| Material | n @ 486 nm (blue) | n @ 589 nm (yellow) | n @ 656 nm (red) | Abbe number Vd |
|---|---|---|---|---|
| Water (20°C) | 1.3371 | 1.3330 | 1.3311 | ~55 |
| Crown Glass (BK7) | 1.522 | 1.517 | 1.514 | 64.2 |
| Flint Glass (F2) | 1.639 | 1.620 | 1.612 | 36.6 |
| Fused Silica | 1.463 | 1.458 | 1.456 | 67.8 |
Data from refractiveindex.info and Schott Optical Glass datasheets. Abbe number Vd = (nd−1)/(nF−nC) quantifies dispersion: higher V means lower dispersion.
When light travels from a denser medium to a rarer medium (n₁ > n₂), total internal reflection occurs if the incident angle exceeds the critical angle θc = arcsin(n₂/n₁). This phenomenon is exploited in fiber optics, endoscopy, and prism-based reflectors. The calculator automatically flags TIR and displays the critical angle.
Critical angle: θc = arcsin(n₂ / n₁) (for n₁ > n₂)
Brewster angle (p-polarization): θB = arctan(n₂ / n₁) (reflected ray becomes s-polarized).
A typical silica optical fiber has a core refractive index n₁ = 1.468 and cladding n₂ = 1.447. The maximum acceptance angle θa (in air) is given by NA = sinθa = √(n₁² − n₂²). Using this calculator, the critical angle for core-cladding interface is θc = arcsin(1.447/1.468) ≈ 80.3°, ensuring total internal reflection for rays within the acceptance cone. This principle enables high-speed internet transmission over thousands of kilometers.
Reference: Hecht, E. (2017). "Optics", 5th ed., Pearson. Fiber parameters follow ITU-T G.652 standard.
Snell's Law can be derived from Fermat's Principle of Least Time, which states that light travels between two points along the path that takes the least time. The law was first documented by Ibn Sahl in 984 AD and later formalized by Willebrord Snellius in 1621.
When light travels from a denser medium (higher n) to a rarer medium (lower n), and the incidence angle exceeds the critical angle, no refraction occurs – the light reflects entirely. TIR enables high-speed internet via fibre optics and creates brilliant sparkle in diamonds through multiple internal reflections. The tool warns you when TIR happens, and the ray diagram shows only the reflected ray (conceptually). In reality, some light propagates as an evanescent wave just beyond the interface.
| Medium | Refractive Index (n) at 589 nm | Typical Application | Notes |
|---|---|---|---|
| Vacuum | 1.00000 (exact) | Reference standard | Speed of light c = 299,792,458 m/s |
| Air (STP) | 1.000293 | Most optical calculations | Often approximated as 1.0 |
| Water (20°C) | 1.3330 | Underwater optics, biology | Varies with temperature, salinity |
| Crown Glass | 1.52 | Lenses, windows | Low dispersion, common in optics |
| Flint Glass | 1.62 - 1.75 | Prisms, chromatic correction | Higher dispersion, used with crown glass in achromatic doublets |
| Sapphire | 1.76 | Watch crystals, IR windows | Extremely hard, chemically resistant |
| Diamond | 2.417 | Jewelry, cutting tools | Highest natural n, gives brilliant sparkle |
Data from NIST Refractive Index Database and refractiveindex.info. For precise values, consult primary sources accounting for temperature, pressure, and isotopic composition.
The calculator automatically identifies which variable is left empty and solves analytically:
All trigonometric functions use JavaScript's built-in Math library (double-precision, IEEE 754). Edge cases (division by zero, sinθ>1) produce clear warning messages. The ray diagram adaptively scales the incident and transmitted rays, showing TIR when applicable (refracted ray suppressed).