Optics & Light Calculator

Calculate optical properties with Snell's law, lens/mirror equations, critical angle, diffraction grating, and Brewster's angle. Also: Calculator | Mechanics | Waves.
Snell's Law: n1 sinθ1 = n2 sinθ2. Light bends toward normal when entering denser medium.
Lens Equation: 1/f = 1/u + 1/v. Positive f = converging, negative = diverging. M = -v/u.
Critical Angle: θc = arcsin(n2/n1). Total internal reflection when θ1 > θc.
What is optics?

Optics is the physics of light — how it bends, reflects, focuses, diffracts, and resolves into spectra. Five core rules run the show. Snell's law (n1sinθ1 = n2sinθ2) describes how light bends at the boundary between two transparent media; the mirror equation (1/f = 1/u + 1/v, with f = R/2) and the thin-lens equation (same form) describe how reflective and refractive surfaces form images; the critical angle (sinθc = n2/n1) marks the boundary above which total internal reflection traps light inside a denser medium; diffraction grating equations (d sinθ = mλ) spread white light into its component wavelengths; and Brewster's angle (θb = arctan(n2/n1)) is the angle at which the reflected light becomes fully polarized. The refractive index n = c/v is the running constant — it sets the speed of light in a medium, the bending at an interface, and the angle of every effect above.

Two equivalent statements: 1/f = 1/u + 1/v for both lenses and mirrors (only the sign convention and where f comes from differ); and n·sinθ = n·sinθ which governs every refraction including critical angle, Brewster's angle, and dispersion.
Snell's law — refraction at an interface

Light traveling in medium 1 hits an interface at angle θ1 from the normal; in medium 2 it propagates at angle θ2, with n1·sinθ1 = n2·sinθ2. The default sample (n1 = 1.00 air, θ1 = 30°, n2 = 1.50 glass) yields θ2 ≈ 19.47°: the ray bends toward the normal on entering the denser medium. Going the other way (glass to air) it bends away; if θ1 exceeds arcsin(n2/n1) — the critical angle — the formula fails because no real θ2 exists, and all the light reflects (total internal reflection). Refractive index depends on wavelength too, which is why a glass prism spreads white light into a rainbow: each wavelength has a slightly different n and bends by a slightly different amount, a phenomenon called dispersion.

Thin-lens equation — the conjugate-distance relation

For a thin lens with object distance u and image distance v, the focal length f obeys 1/f = 1/u + 1/v, and the linear magnification is M = −v/u. The default sample (u = 30 cm, v = 15 cm) gives f = 10 cm and M = −0.5 — the image is real, inverted, and half the size of the object. A positive f means a converging (convex) lens, a negative f a diverging (concave). Two operating regimes produce different image types: when u > f the lens makes a real, inverted image on the opposite side (the projector setup); when u < f the image is virtual, upright, magnified on the same side as the object (the magnifying glass setup). The sign of v carries all the geometry: positive v means the image is real and on the opposite side of the lens, negative v means virtual and on the same side as the object. Eyeglasses run on this equation: a diverging lens (negative diopters) pushes myopia’s in-front focus back onto the retina, a converging lens (positive diopters) pulls hyperopia’s behind-retina focus forward — a diopter is just 1/f in meters.

Mirror equation — reflection forms images too

The mirror equation is identical in form, 1/f = 1/u + 1/v, with the focal length tied to the radius of curvature by f = R/2. A concave (converging) mirror has f > 0; a convex (diverging) mirror has f < 0. The default sample (R = 20 cm, u = 30 cm, concave) gives f = 10 cm, image distance v ≈ 15 cm, magnification M = −0.5: a real, inverted, half-size image. Curved mirrors have one advantage over lenses: they work at every wavelength equally, which is why the largest telescopes (Hubble, JWST, the upcoming ELT) are mirrors, not lenses. Convex mirrors used as car side mirrors carry a wider field of view because they form a smaller, upright virtual image behind the glass; the warning label "objects in mirror are closer than they appear" is just the −v/u magnification reading less than 1.

Critical angle — total internal reflection

When light tries to leave a denser medium (n1) for a rarer one (n2), at incident angles above θc = arcsin(n2/n1) the refracted ray no longer exists and 100% of the light reflects back. The default sample (n1 = 1.50 glass, n2 = 1.00 air) gives θc ≈ 41.81°; any glass-to-air ray steeper than that is trapped. This is the principle behind optical fibers: light injected past the critical angle bounces along the core for kilometers with no loss other than absorption. Diamonds look fiery partly because of their very high n (≈2.42), giving a critical angle of only about 24°; light entering the table facet hits internal facets at steeper angles and reflects back out the top, the characteristic sparkle.

Diffraction grating — wavelength by interference

A grating is many parallel slits, and the path-length difference between adjacent slits determines constructive interference: d·sinθ = m·λ, where d is the slit spacing, θ the diffraction angle, and m the order number (0, ±1, ±2, ...). The default sample (600 lines/mm, m = 1, θ = 20°) yields λ ≈ 570.03 nm, in the yellow band — the panel correctly identifies the color. Gratings beat prisms for spectroscopy because their dispersion is linear in wavelength, the resolving power is m·N (with N the number of illuminated lines), and the geometry lets you build an instrument with thousands of lines/mm. The same grating equation explains the iridescence of compact discs and DVDs, the rainbow sheen on a butterfly wing, and the spectra produced by X-ray diffraction in crystallography.

Brewster's angle — polarization for free

At θb = arctan(n2/n1), the reflected and refracted rays are perpendicular to each other, and the reflected ray becomes 100% polarized with the electric field parallel to the surface. The default sample (air n1 = 1.00, glass n2 = 1.50) gives θb ≈ 56.31°. Brewster's angle is the operating principle behind polarized sunglasses (the lenses are oriented to block the horizontal glare reflected from car hoods and water, which is s-polarized around 30-40° for typical surfaces) and behind laser cavities (Brewster windows eliminate reflection losses for one polarization). At any angle other than θb the reflection is only partially polarized, which is why reflected daylight is a messy mix.

Common misconceptions
  • Glass "absorbs" most of the light that hits it. Clean glass absorbs almost nothing; what it does is reflect a few percent at each surface (Fresnel reflection, ~4% per surface at normal incidence) and refract the rest. Anti-reflection coatings are quarter-wave layers that make the two reflected waves destructively interfere.
  • Convex lenses always make things bigger; concave always make smaller. It depends on object distance. A converging lens with the object inside the focal length makes a magnified virtual image (the magnifying glass). A diverging lens can make a real image only if the object is virtual, which it never is in everyday use.
  • Diffraction blurs every image. Diffraction is significant only when the aperture is comparable to the wavelength. A 5 mm camera iris produces a diffraction blur of about λ/D radians ≈ 0.0001 rad — invisible at normal viewing. A microscope objective at the same scale, with D ~ 1 mm and λ ~ 500 nm, has diffraction-limited resolution of about 0.3 μm — which is why oil immersion and shorter-wavelength light are used to push past that limit.
  • Light from a prism is "split" by the prism. The light is split because the refractive index varies with wavelength; if n were the same for all colors (achromatic design), the prism would refract white light but not disperse it. The same idea makes lenses chromatic, which is why camera lenses use compound achromatic doublets.

Related tools: Waves & Oscillations for the interference and diffraction framework, Modern Physics for the photon-level view of light, and Spectroscopy for what spectroscopy does with the wavelengths these rules produce.