007 / LIGHT AND WATER

Where is a rainbow born?

First send a ray through one drop and find the angle where the rays gather. Then see how millions of drops turn that into a rainbow in the sky.

Snell · Fresnel · Airy
A ray in the dropn = 1.333 · 589 nm
The ray path through the drop
Exit angle against the entry point
Rainbow angle42.1°
Width of the colour band1.75°
This ray leaves at33.3°
Share of light in this ray2.2%
↳

Try other drops

A glass bead makes a bow of only about 21°: you can see one on road markings that contain glass beads. In diamond the once-reflected ray has no limit, so there is no primary bow, yet the second one (two reflections) is there.

Theory behind the experimentWhy a rainbow sits at 42°, where its colours come from, why it is round and why a polarising filter can switch it offPlain explanation, equations and how the model works

In plain words

A ray of sunlight entering a drop bends, reflects off the back of the drop and comes back out. The angle at which it leaves depends on where it hit the drop. Move the entry point from the centre to the edge and the angle grows, hits a limit and turns back. A great many rays leave close to that limit, so that is the direction in which the drop shines brightest. For water it is about 42° from the shadow of the observer’s head.

Water bends violet light slightly more than red. So every colour has its own limit: about 42.5° for red and 40.7° for violet. That is how white light spreads into bands.

All that matters is the angle between the direction to a drop and the line from the sun through your head to its shadow. All directions at one angle to that line form a cone, and in the sky that is a circle around your head’s shadow. The shadow is always below the horizon, so the ground hides the lower part of the circle. From a plane you can see the whole of it.

If a ray reflects twice inside the drop, it leaves with a different limit, about 51°. That is the second rainbow: wider, fainter and with the colours reversed. Between 42° and 51° the drops send you none of this light, and the sky there is darker. This is Alexander’s dark band.

Try it yourself

  1. In “The drop”, slowly move the entry point from the centre to the edge and watch the dot on the chart. Find the top of the curve; the “Rainbow ray” button puts the ray exactly there.
  2. Switch on 60 rays. Bottom left you can see the rays bunching up at the limit. The bars to the right of the chart show the same density.
  3. Switch the material to glass, then to diamond. Glass gives a bow of about 21°; diamond with one reflection has no limit at all. Try two reflections.
  4. In “The sky”, lower the sun to the horizon, then raise it above 42°. See what is left of the rainbow, and try the view from a plane.
  5. Turn on the polarising filter and rotate it slowly. A dark gap will move along the arc.

Physics and equations

Entering the drop, the ray bends by Snell’s law:

sin⁡i=n sin⁡r,b=sin⁡i\sin i = n\,\sin r,\qquad b=\sin i

Here ii is the angle of incidence, rr the angle of refraction, nn the refractive index, and bb the impact parameter: the ray’s distance from the centre of the drop as a fraction of its radius. Inside a sphere one ray’s path is made of equal chords: each meets the wall at the same angle rr. So after kk internal reflections the ray has turned through

Dk(b)=2 (i−r)+k (π−2r)D_k(b)=2\,(i-r)+k\,(\pi-2r)

This function has an extremum where its derivative vanishes:

dDkdb=0⟹cos⁡2i=n2−1k2+2k\frac{dD_k}{db}=0\quad\Longrightarrow\quad \cos^2 i=\frac{n^2-1}{k^2+2k}

That is the rainbow ray. For water (n=1.333n=1.333) and k=1k=1 the deviation is about 138°, so the ray leaves at α0≈42.1°\alpha_0\approx42.1\degree from the direction away from the sun. For k=2k=2 it is α0≈50.9°\alpha_0\approx50.9\degree. A solution exists only when the right-hand side is below one, that is when n<k+1n<k+1. So diamond (n≈2.42n\approx2.42) has no once-reflected rainbow, but it does have the twice-reflected one.

How the light divides at each surface is given by the Fresnel equations, for light polarised perpendicular and parallel to the plane of incidence:

Rs=(cos⁡i−ncos⁡rcos⁡i+ncos⁡r)2,Rp=(ncos⁡i−cos⁡rncos⁡i+cos⁡r)2,Tk=(1−R)2R k \begin{aligned} R_s&=\left(\frac{\cos i-n\cos r}{\cos i+n\cos r}\right)^{2},\qquad R_p=\left(\frac{n\cos i-\cos r}{n\cos i+\cos r}\right)^{2},\\ T_k&=(1-R)^2R^{\,k} \end{aligned}

Inside, the ray meets the wall at rr, while it entered at ii. The angles differ, but they are linked by Snell’s law, and for such a pair the reflectance from inside equals the one from outside, so RR is the same. Summed over all orders together with the outside reflection it gives exactly 1, as the “Where this ray’s light goes” panel shows.

The brightness against direction for many drops is

dσdΩ=a2 bsin⁡θ∣dbdθ∣Tk(b)\frac{d\sigma}{d\Omega}=\frac{a^2\,b}{\sin\theta}\left|\frac{db}{d\theta}\right|T_k(b)

At the rainbow angle db/dθdb/d\theta goes to infinity: this is a caustic. In the real sky the peak is smoothed by the sun’s disk, about 0.5° across.

Polarisation

The rainbow ray reflects inside the drop at close to Brewster’s angle. Light polarised in the plane of incidence (pp) then almost all leaves the drop, and the rainbow is made mostly of ss light. The plane of incidence passes through the centre of the bow, so rainbow light oscillates along the arc. A filter whose axis crosses the arc at some point darkens it exactly there.

More: Airy’s wave theory

Ray optics cannot explain the faint extra bands inside the bow. Near the rainbow ray the wavefront leaving the drop is cubic, and the intensity follows the Airy function:

I(ε)∝Ai2(−z),z=ε (ka)2/3h−1/3,h=12 Dk′′(b0)I(\varepsilon)\propto \mathrm{Ai}^2(-z),\qquad z=\varepsilon\,(ka)^{2/3}h^{-1/3},\qquad h=\tfrac12\,D_k''(b_0)

Here ε\varepsilon is the offset from the ray-optics rainbow angle, k=2π/λk=2\pi/\lambda and aa the drop radius. The main maximum moves inward by

Δθ≈1.019 h1/3(ka)2/3\Delta\theta\approx1{.}019\,\frac{h^{1/3}}{(ka)^{2/3}}

and the further maxima of the Airy function are the supernumerary bows. The smaller the drops, the wider they are spaced and the more the colours blend.

More: how much of the circle you see

With the sun at altitude h⊙h_\odot, the centre of the rainbow is the same distance below the horizon. On the sky sphere the part left above the horizon is

share above the horizon=1πarccos⁡tan⁡h⊙tan⁡α0\text{share above the horizon}=\frac1\pi\arccos\frac{\tan h_\odot}{\tan\alpha_0}

With the sun on the horizon this is exactly half the circle; for h⊙≥α0h_\odot\ge\alpha_0 the bow is entirely below the ground.

How the model works

The drop is a perfect sphere, so the whole ray path lies in one plane and a cross-section is enough. The refractive index of water follows Daimon and Masumura at 20 °C, pinned to the handbook value nD=1.33299n_D=1.33299. Glass is BK7 (like the beads in road markings), diamond uses a Sellmeier formula. For a custom nn the dispersion is that of water, scaled; this is a simplification.

The sky is computed for water drops with the sun at the chosen altitude: sunlight as a 5772 K blackbody passed through the same atmosphere model as in the colour-of-temperature experiment. Wavelengths 400-700 nm every 10 nm, angles every 0.1°, a uniform solar disk of 0.53°. The ray picture uses 40,000 rays per colour. Airy’s theory holds near the bow; far from it the bands continue only approximately. Drops below 0.1 mm need the exact Mie theory, which is not included, so the white fogbow and the glory are missing.

The sky background is illustrative and treated as unpolarised; brightness is set automatically from the rainbow itself. The sky is drawn so that distance on the screen is proportional to the angle from your head’s shadow (an azimuthal equidistant projection). All drops are the same size and perfectly round, although large raindrops are slightly flattened.

The calculation on the page matches the reference Python code: refractive indices, Fresnel equations, bow angles, ray paths, the Airy function and the final sky colour are all checked.

Sources and further reading

Atmospheric Optics: rainbows ↗: a clear explanation with photographs.

Philip Laven: simulating rainbows ↗: ray optics, Airy and Mie theory compared.

Daimon, Masumura (2007) ↗: the refractive index of water.