n₁·sinθ₁ = n₂·sinθ₂ · critical angle · medium presets

Passing into an optically denser medium (larger n), light refracts toward the normal; into a rarer one — away from the normal. Above the critical angle (only when passing into a rarer medium), total internal reflection occurs — the principle behind optical fibers.
Snell's law (the law of refraction) describes the change in direction of a light ray at the boundary between two media of different refractive indices:
Passing into an optically denser medium (larger ), the ray refracts toward the normal; into a rarer one — away from the normal. When passing into a rarer medium, above the critical angle:
total internal reflection occurs — light does not pass through, it reflects entirely. This is the principle behind optical fibers and the sparkle of diamonds. The calculator has presets for typical media (air, water, glass, diamond).
Only when passing into an optically rarer medium (n₂ < n₁) and when the angle of incidence exceeds the critical angle θ_c = arcsin(n₂/n₁). The light then reflects entirely — this is how optical fibers work.
Because light rays refract at the water–air boundary according to Snell's law, shifting the apparent position of the submerged part.
Teaching? Embed this calculator on your site.
Free widget — paste it on your school site, blog or notes. It links to the full version.