# Snell's Law Calculator

> Applies Snell's law n₁·sin θ₁ = n₂·sin θ₂ to find the angle of refraction of light passing between two media of known refractive index, detects total internal reflection, and reports the critical angle, the speed of light in each medium and the normal-incidence reflectance.

- Calculator id: `snells-law` · Category: Physics (`physics`) · Tool name: `calculate_snells_law_refraction`
- Canonical page: https://tttkmbb.com/physics/snells-law · This document: https://tttkmbb.com/physics/snells-law.md · JSON definition: https://tttkmbb.com/physics/snells-law.json

## Purpose

Applies Snell's law n₁·sin θ₁ = n₂·sin θ₂ to find the angle of refraction of light passing between two media of known refractive index, detects total internal reflection, and reports the critical angle, the speed of light in each medium and the normal-incidence reflectance.

**Use when:** You need the refraction angle of a light ray entering water, glass, diamond or another medium, or want to know whether a ray inside the denser medium is totally internally reflected.

**Do not use when:** You need image positions from lenses or mirrors (use lens-equation), reflectance at oblique angles or with polarisation (Fresnel equations are not implemented), or the wavelength dependence of the index (dispersion).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `medium_1` | enum: air \| water \| ice \| glass_crown \| glass_flint \| diamond \| acrylic \| vacuum \| ethanol \| custom |  | required | Medium the ray travels in before the surface; choose custom to supply n1. |
| `n1` | number |  | optional | Refractive index of medium 1; required for medium_1 = custom and overrides the preset otherwise. (> 0, max 10) |
| `medium_2` | enum: air \| water \| ice \| glass_crown \| glass_flint \| diamond \| acrylic \| vacuum \| ethanol \| custom |  | required | Medium the ray enters; choose custom to supply n2. |
| `n2` | number |  | optional | Refractive index of medium 2; required for medium_2 = custom and overrides the preset otherwise. (> 0, max 10) |
| `angle_of_incidence_degrees` | number | ° | required | Angle between the incoming ray and the normal (perpendicular) to the surface, 0–90°. (min 0, max 90) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `n1` | number |  | Refractive index of medium 1 used. |
| `n2` | number |  | Refractive index of medium 2 used. |
| `angle_of_refraction_degrees` | number | ° | θ₂ = asin(n₁·sin θ₁ / n₂), measured from the normal; omitted under total internal reflection. |
| `total_internal_reflection` | boolean |  | True when n₁·sin θ₁ / n₂ > 1, i.e. no refracted ray exists and all light is reflected back into medium 1. |
| `critical_angle_degrees` | number | ° | asin(n₂ / n₁): incidence angle above which total internal reflection occurs (only when n₁ > n₂). |
| `deviation_degrees` | number | ° | Angle between the incident and outgoing ray directions: \|θ₁ − θ₂\| for refraction, 180° − 2·θ₁ for total internal reflection. |
| `speed_in_medium_1_m_s` | number | m/s | c / n₁ with c = 299,792,458 m/s. |
| `speed_in_medium_2_m_s` | number | m/s | c / n₂. |
| `reflectance_normal_incidence_percent` | number | % | Fraction of light reflected at the surface for a ray at 0° incidence, ((n₁ − n₂) / (n₁ + n₂))² × 100 (Fresnel, unpolarised). |

## Formula

`n1 × sin(angle_of_incidence_degrees) = n2 × sin(angle_of_refraction_degrees); total internal reflection when n1 × sin θ₁ / n2 > 1; critical_angle_degrees = asin(n2 / n1) for n1 > n2; speed = c / n with c = 299,792,458 m/s; reflectance_normal_incidence_percent = ((n1 − n2) / (n1 + n2))² × 100; deviation_degrees = |θ₁ − θ₂| (refraction) or 180° − 2·θ₁ (reflection)`

Snell's law for a flat interface between isotropic media; preset indices are for sodium D light (589 nm) at room temperature from the Wikipedia list (air 1.000293, water 1.333, ice 1.31, crown glass 1.52, flint glass 1.62, diamond 2.417, acrylic 1.49, ethanol 1.361).

## Data Sources

- Wikipedia – Snell's law — https://en.wikipedia.org/wiki/Snell%27s_law (reference, retrieved 2026-09-24)
- Wikipedia – List of refractive indices — https://en.wikipedia.org/wiki/List_of_refractive_indices (reference, retrieved 2026-09-24)
- HyperPhysics – Refraction of light — http://hyperphysics.phy-astr.gsu.edu/hbase/geoopt/refr.html (reference, retrieved 2026-09-24)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/snells-law?medium_1=…&medium_2=…&angle_of_incidence_degrees=…`
- `POST https://tttkmbb.com/api/v1/calculate/snells-law` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/snells-law · OpenAPI operationId `calculate_snells_law_refraction` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "snells-law", "inputs": {…}}`

## Example

- Air to water at 30°: inputs `{"medium_1":"air","medium_2":"water","angle_of_incidence_degrees":30}` → `{"n1":1.000293,"n2":1.333,"angle_of_refraction_degrees":22.04,"total_internal_reflection":false,"deviation_degrees":7.96,"speed_in_medium_2_m_s":224900569,"reflectance_normal_incidence_percent":2.0332}`
- Water to air at 60° (total internal reflection): inputs `{"medium_1":"water","medium_2":"air","angle_of_incidence_degrees":60}` → `{"total_internal_reflection":true,"critical_angle_degrees":48.63,"deviation_degrees":60,"speed_in_medium_1_m_s":224900569}`

```
GET https://tttkmbb.com/api/v1/calculate/snells-law?medium_1=air&medium_2=water&angle_of_incidence_degrees=30
```

## Limitations

You need image positions from lenses or mirrors (use lens-equation), reflectance at oblique angles or with polarisation (Fresnel equations are not implemented), or the wavelength dependence of the index (dispersion). Snell's law for a flat interface between isotropic media; preset indices are for sodium D light (589 nm) at room temperature from the Wikipedia list (air 1.000293, water 1.333, ice 1.31, crown glass 1.52, flint glass 1.62, diamond 2.417, acrylic 1.49, ethanol 1.361). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Is the angle measured from the surface or from the normal?**

From the normal, the line perpendicular to the surface. A ray hitting the surface at 60° to the surface has an angle of incidence of 30°.

**Why is there no angle of refraction for water to air at 60°?**

Snell's law would need sin θ₂ = 1.333 × sin 60° / 1.000293 = 1.154, which is impossible; above the critical angle of 48.63° the ray is totally reflected inside the water.

**Does the wavelength matter?**

Yes, the index depends on wavelength (dispersion): crown glass is about 1.51 for red and 1.53 for violet light. The presets are for 589 nm; enter custom indices for other wavelengths.

## Related

- [Thin Lens Equation Calculator](https://tttkmbb.com/physics/lens-equation.md) — Image formation by lenses and mirrors, which rely on refraction and reflection.
- [Wavelength & Frequency Calculator](https://tttkmbb.com/physics/wavelength-frequency.md) — Wavelength in a medium from the reduced speed c / n.
