Prism Light Dispersion

A single beam of white light is really every colour travelling together. Send it into a triangular prism and the glass pulls them apart: each wavelength slows by a slightly different amount, so violet bends hardest and red barely at all. The beam refracts once going in and once coming out, and those two bends stack up to fan the light into a rainbow — this is dispersion. Tilt the apex angle, change the angle the light strikes, and swap crown glass for flint or water to widen or tighten the spectrum. Push it far enough and the blue end can no longer escape the second face — total internal reflection traps it inside. Every angle and index reads out live, and it all runs on your device.

You are in the Physics lab.

Use the controls below to change the apex angle, incidence and glass
Deviation δ (589 nm)
Minimum deviation δmin
n at 680 nm (red)
n at 420 nm (violet)
Angular spread (violet − red)
Status
Refractive index n against wavelength for the current glass, from Cauchy's relation n(λ) = B + C/λ². The index rises toward the violet end — the steeper this curve, the more the prism spreads the colours. In monochromatic mode the dashed line marks your wavelength; in white-light mode the band from 420 to 680 nm is shaded.
Two bends that add up, one per face. The refractive index n says how much a material slows light — and for glass it is a touch larger for violet than for red. Snell's law bends the ray toward the normal as it enters (r₁ = arcsin(sin i₁ / n)), the prism's shape carries it to the far face at r₂ = A − r₁, and it bends away again on the way out. The two bends stack into a total deviation δ = i₁ + i₂ − A that is different for every colour, so white light fans into a spectrum. Steep enough at the exit and the short wavelengths pass their critical angle θc = arcsin(1/n) and are trapped by total internal reflection.

Reading the simulation

What the incoming beam, the rays inside the glass and the exit fan are telling you.

1

One beam in, a rainbow out

The white ray strikes the left face and refracts into the glass. Inside, the colours already start to separate because each bends by its own amount; at the far face they refract again and fan apart into the spectrum you see leaving on the right. Red is deviated least and violet most — the same order every prism produces.

2

The numbers behind the fan

The readout gives the deviation δ for the reference yellow line at 589 nm, the refractive index at the red (680 nm) and violet (420 nm) ends, and the angular spread between them — the width of the rainbow. Switch from crown to flint glass and watch the spread jump, because flint's index changes far more steeply across the spectrum.

3

When a colour gets trapped

Light meets the exit face from inside the dense glass, so if it arrives too steeply it cannot escape — beyond the critical angle it reflects back in. Because violet has the highest index it reaches that limit first, so with a wide apex or a shallow incidence you can watch the blue end drop out while red still emerges. The status line flags total internal reflection at the exit face.

How It Works

A wavelength-dependent index, Snell's law at two faces, and a deviation that differs for every colour.

1

The index depends on colour

Glass slows light, and it slows short wavelengths a little more than long ones. The simulator models this with Cauchy's relation n(λ) = B + C/λ², using coefficients for crown glass, flint glass or water. The dispersion graph plots that curve, rising from red toward violet — the source of every colour separation a prism produces.

2

Snell's law at each face

Entering the glass, the ray bends toward the normal: r₁ = arcsin(sin i₁ / n). The prism's apex angle A fixes the internal angle at the second face, r₂ = A − r₁, and the exit bend follows i₂ = arcsin(n · sin r₂). The total deflection from the original direction is the deviation δ = i₁ + i₂ − A, which the readout tracks live as you move the sliders.

3

Minimum deviation and total internal reflection

Sweeping the incidence angle, δ dips to a lowest value when the ray crosses the prism symmetrically (i₁ = i₂). That angle of minimum deviation is how a prism spectrometer measures a glass's index. Push the exit angle past the critical angle instead and the colour is reflected back inside rather than refracted out — total internal reflection, colour by colour.

Why does a prism split white light into a rainbow?
White light is a mix of all the visible wavelengths. When it enters glass it slows down, and the amount it slows — the refractive index — is slightly larger for short wavelengths (violet) than for long ones (red). Because the index sets how sharply each ray bends, violet bends the most and red the least, so the single white beam fans out into a spectrum. The prism refracts the light twice, once at each face, and the two bends add together, which spreads the colours far enough apart to see. This is called dispersion.
How does this prism simulator calculate the colours?
For each wavelength it finds the refractive index from Cauchy's equation n(λ) = B + C/λ², with coefficients chosen for crown glass, flint glass or water. Snell's law then gives the bend at the first face, r₁ = arcsin(sin i₁ / n); the geometry of the prism fixes the angle at the second face as r₂ = A − r₁, where A is the apex angle; and Snell's law at the exit gives i₂ = arcsin(n · sin r₂). The total deviation is δ = i₁ + i₂ − A. Sampling wavelengths from 420 to 680 nm and mapping each to its sRGB colour reproduces the rainbow fan.
What is the angle of minimum deviation?
As you raise the incidence angle, the total deviation δ first falls, reaches a lowest value, then rises again. That lowest value is the angle of minimum deviation, and it happens when the ray passes symmetrically through the prism — entering and leaving at equal angles, so i₁ = i₂ and r₁ = r₂ = A/2. At that point n = sin((A + δmin)/2) / sin(A/2), which is the classic way to measure a glass's refractive index with a prism and a spectrometer. The readout shows δmin for the current glass and apex angle.
Can total internal reflection happen inside a prism?
Yes. Light already inside the glass meets the exit face from the dense side, so if it strikes too steeply — beyond the critical angle θc = arcsin(1/n) — it cannot get out and is reflected back into the prism instead. Because the index is larger for violet, violet reaches its critical angle first, so as you tune the incidence and apex angle you can trap the blue end of the spectrum while red still escapes. Right-angle prisms in binoculars and periscopes use exactly this effect to fold a beam with almost no loss.
Does the apex angle change the dispersion?
Strongly. A larger apex angle means the ray meets the second face at a steeper internal angle, so both the overall deviation and the spread between red and violet grow — until the apex is so wide that the shorter wavelengths hit total internal reflection and never emerge. A narrower apex gives a gentler, cleaner spectrum with less deviation. Slide the apex angle from 30° to 75° and watch the angular-spread readout rise, then watch colours drop out at the top of the range.
Why does flint glass spread the colours more than crown glass?
Dispersion depends on how much the refractive index changes across the spectrum, not just on how high it is. Flint glass has a much larger Cauchy C term than crown glass, so its index rises far more steeply toward the violet end — its n at 420 nm and 680 nm are further apart. That bigger difference in bending makes flint fan the colours wider, which is why flint is used for the dispersive elements in prisms and older camera lenses, paired with crown glass to control colour. Switch the glass in the controls to compare the spread.

Teaching or blogging about optics? You can embed this simulator on your own site free — one line of code, no sign-up.