A first-person sky rendered by single-scattering radiative transfer — Rayleigh molecular scattering plus Mie aerosol scattering integrated along every view ray. Drag the Sun toward the horizon and the redness appears on its own: it is a geometry effect, the beam forced through a longer column of air until only the long wavelengths survive. Then swap Earth for Mars and watch the whole thing invert.
MODEL CLASS SINGLE-SCATTERING TRANSFER Rayleigh + Mie along each view ray; multiple scattering is omitted
Earth
world
6.0°
Sun elevation
9.7
airmass · slant path
0.94
τRay(550) · slant
86%
blue stripped
0.06
aerosol τ · turbidity
Single-Scattering Sky · First-Person View · Drag to look around
The reddening is path length × wavelength
Each pixel integrates the sunlight scattered once into your eye along that direction: Rayleigh scattering ∝ 1/λ⁴ removes blue ~6× faster than red, and as the Sun drops the beam's air path lengthens toward ~38 airmasses at the horizon. Look toward the Sun for the warm limb; look away for the blue that was scattered out of it.
World
Same single-scattering engine, different atmosphere. Mars: thin CO₂ (almost no Rayleigh) with suspended dust that forward-scatters blue — a butterscotch day sky and a blue Sun at sunset.
Beam state · live
Sun elevation6.0°
airmass (slant)9.7
τ blue (440)2.35
τ red (680)0.40
blue survives9.5%
red survives67%
Direct Sun-disk colour, from the full 380–700 nm transmitted spectrum (CIE 1931 → sRGB). White at noon, red at the horizon.
Sun 6.0° · 9.7 AM
Entry XXI · Radiative Transfer · Atmospheres
A red sunset is the most-witnessed physics experiment on Earth, and almost no one is told what the apparatus is. The apparatus is the atmosphere itself, and the variable being swept is the length of air the sunlight has to cross to reach you. At noon that path is one airmass; at the horizon it is nearly forty. Along that longer path, short-wavelength light is scattered out of the direct beam far more efficiently than long-wavelength light — Lord Rayleigh's 1871 result that the scattering coefficient runs as 1/λ⁴ — so what finally arrives has had its blues and greens stripped away and reads as orange, then red. This entry computes that beam, and the whole sky around it, from the single-scattering radiative-transfer integral, live, so the colour is an output of the physics rather than a painted gradient.
Mie optical depth · 0.02 crisp dry air → 0.15 hazy → 0.6 volcanic/dust · deepens & can mute colour
0.76
Cornette-Shanks asymmetry · larger particles (g→0.9) throw more light forward, brightening the Sun's aureole
0.20
Clouds don't make the red — they are the canvas that catches the already-reddened low beam from below
1.0
Tone-map exposure only · does not change the physics, just makes faint twilight visible
Load-time self-check
The model bisects its own numbers on load ✓
Every value below is computed by the same functions that drive the render, and checked against the canonical result. If any line failed it would read ✗ in amber.
Two ingredients, and neither is "the sky is made of blue"
The colour is set by two things acting together, and the interactive above isolates each.
1 · Rayleigh scattering, ∝ 1/λ⁴. Air molecules are far smaller than the wavelength of light, and in that limit the scattering efficiency scales as the inverse fourth power of wavelength. Violet (400 nm) is scattered about (700/400)⁴ ≈ 9× more strongly than red (700 nm); across the visible band blue is stripped roughly six times faster than red. Midday, looking away from the Sun, it is that scattered short-wavelength light filling the dome that you see — the blue sky. The reddening at sunset is the same coefficient read the other way: the light that made it through in a straight line is what's left after the blue was scattered out.
2 · Path length (airmass). This is the lever people forget, and it is the one the model foregrounds. Scattering is exponential in the column of air traversed, so what matters is how much air the beam crosses. Straight up, that's one airmass. As the Sun sinks, the beam cuts through the atmosphere at a shallow, tangential angle, and the path lengthens dramatically — to about 38 airmasses at the geometric horizon (Kasten & Young 1989; the naïve sec z diverges, which is exactly why a spherical airmass formula is needed). Over that path essentially all the blue and most of the green are removed from the direct beam before it reaches your eye. Drop the elevation slider and watch the "blue survives" figure collapse from ~50% at altitude to well under 1% at the horizon while red barely moves.
What separates a dull sunset from a spectacular one
Rayleigh scattering guarantees some reddening every evening. The vividness is set by what else is in the air, and by what there is for the light to land on.
Aerosols are the amplifier — with a sweet spot. Dust, smoke, sea salt, pollution and especially volcanic sulfate droplets add Mie scattering (particles comparable to the wavelength), which can deepen and spread the reds far beyond what clean air produces. The most storied skies in history followed eruptions: the sulfate veil from Krakatoa (1883) is widely credited with the blood-red twilights that Edvard Munch recorded behind The Scream (Zerefos et al. 2007). But it is genuinely a sweet spot — push the turbidity slider past ~0.4 and the colour mutes toward a flat brown as the haze starts to scatter and absorb everything, long before it "improves." Crisp, dry air after a cold front gives the purest, most saturated colour; heavy humid haze washes it out.
Clouds are the canvas, not the paint. Toggle the cloud slider: the clouds themselves add no red. What they do is intercept the low, already-reddened beam from below the horizon and glow with it — which is why the drama lives in mid- and high-level clouds and why a completely clear sky gives only a smooth gradient. In the model the clouds are lit by the same transmitted Sun-disk colour shown in the swatch, so they redden exactly when the beam does.
Water is the mirror. A reflecting surface simply doubles the display — the reason lake and ocean sunsets feel so saturating — but it is not required for the colour itself. Turn the water off and the sky is unchanged; turn it on and the foreground carries a Fresnel-weighted copy of it.
Not the same trick as a rainbow
Two different ways to pull colour out of white sunlight
It is tempting to file sunsets and rainbows together, and pedagogically the contrast is the point: they are different mechanisms. A rainbow is refraction + internal reflection + dispersion inside spherical raindrops — pure geometric optics, a fixed ~42° cone, and it always sits opposite the Sun (behind you). A red sunset is wavelength-dependent scattering along a line of sight — no droplets, no fixed angle, and it lives in front of you, around the Sun. Teaching them side by side is the cleanest way to show that "colour from sunlight" is not one phenomenon but a family of them, each with its own geometry.
The counterfactual: swap the atmosphere, invert the sunset
The deepest reason this belongs in a physics or astronomy course, rather than a weather segment, is that a sunset's colour is a direct read-out of what the atmosphere is made of and how big its particles are. Change the gas, the particle size, or the density, and the colour changes in a computable way. Hit the Mars button.
Mars: a blue Sun at sunset
Mars' atmosphere is ~0.6% of Earth's surface pressure, so molecular Rayleigh scattering is roughly 170× weaker — there is almost no "blue sky" to lose. What dominates instead is suspended dust with particle sizes comparable to visible wavelengths. That dust broadly scatters and absorbs across the red, giving the famous butterscotch daytime sky; but it forward-scatters blue light preferentially, so in the narrow cone right around the Sun the blue is thrown toward the observer. The result, imaged repeatedly by Pathfinder, Spirit, and Curiosity, is the inverse of Earth: a warm-tan day and a cool blue glow hugging the setting Sun. Same single-scattering engine here — only the atmosphere's composition and grain size are changed.
That move — infer an atmosphere from the colour and angular structure of transmitted starlight — is not a toy. It is the logic of transmission spectroscopy, the primary method by which we characterise exoplanet atmospheres: starlight filtered through a planet's limb during transit carries the fingerprint of its gases and hazes, and a Rayleigh slope rising into the blue is one of the first things analysts look for. A sunset is that same measurement, made from the inside, on a planet you happen to be standing on.
Bringing it to the bench: the sunset in a jar
The whole phenomenon scales to a tabletop, which is why it is one of the most reliable classroom demonstrations in optics. Shine a white beam (a phone torch works) through a clear tank of water with a few drops of milk stirred in. The milk's fat micelles are sub-wavelength scatterers — a stand-in for air molecules — so they scatter blue preferentially. Viewed from the side, the tank glows faintly blue (the "sky"); viewed end-on, looking back through the beam, the transmitted light shifts through yellow and orange to red as you add milk or lengthen the tank — the "sunset," with milk concentration and path length playing exactly the roles that airmass and turbidity play in the slider above. It is the same single-scattering physics at 30 cm instead of 300 km, and running the on-screen model alongside the jar lets students match a number to what they see: more milk ≈ higher turbidity, longer tank ≈ lower Sun.
Boundary of validity
Where this reduced model is trustworthy — and where it isn'tread this
The engine is the single-scattering radiative-transfer integral: each pixel accumulates sunlight scattered exactly once into the line of sight, with proper Rayleigh (1/λ⁴) and Mie (Cornette-Shanks) phase functions, exponential density profiles, and Beer-Lambert extinction to the Sun and to the eye. That is the correct leading-order physics and it reproduces the geometry and the colour sequence quantitatively. The boundaries are where higher-order terms and omitted physics matter.
Single scattering only
Light that scatters two or more times before reaching the eye is not summed. Multiple scattering is what keeps the deep-twilight sky and the horizon from going fully black and softens the gradients. Below the horizon especially, the real sky is brighter and bluer than this model. This is the largest known approximation.
Spherical shell, but smooth
The atmosphere is a spherically-symmetric exponential shell (correct for airmass at the horizon, where plane-parallel sec z fails). Real density has weather, temperature inversions, and layering that this does not carry.
Three-band dome vs full spectrum
The live sky is integrated at three representative wavelengths (R/G/B) for speed — standard for real-time atmospheric rendering. The Sun-disk swatch and the τ read-outs use the full 380–700 nm spectrum with CIE colour-matching, so the audited colour is spectral even where the dome is three-band.
Mars dust is parameterised
The Martian dust optics (single-scattering albedo, the blue forward-scattering lobe) are tuned to reproduce the observed butterscotch-day / blue-sunset result, not derived from first-principles Mie theory over the measured size distribution. The inversion is physical; the exact hue is a fit.
No refraction or green flash
Atmospheric refraction (which lifts the Sun's image and flattens the disk) and the dispersion that produces the green flash are not modelled. The Sun is placed at its geometric elevation.
No ozone Chappuis in the dome
The full-spectrum swatch includes the Chappuis ozone band that gives late twilight its blue cast; the three-band dome does not carry ozone absorption. Ground albedo and clouds are simplified single-layer approximations.
References
Strutt (Lord Rayleigh), J. W.1871, Phil. Mag. 41, 107 & 274 — On the light from the sky, its polarisation and colour — the original 1/λ⁴ scattering law.
Bodhaine, B. A., Wood, N. B., Dutton, E. G., Slusser, J. R. 1999, J. Atmos. Ocean. Tech. 16, 1854 — On Rayleigh optical depth calculations — the reference τR(λ) used here (τ550 ≈ 0.097).
Fröhlich, C., Shaw, G. E. 1980, Appl. Opt. 19, 1773 — New determination of Rayleigh scattering in the terrestrial atmosphere — the τR0(λ) polynomial.
Kasten, F., Young, A. T. 1989, Appl. Opt. 28, 4735 — Revised optical air mass tables — the horizon-finite airmass formula (≈ 38 at z = 90°).
Nishita, T., Sirai, T., Tadamura, K., Nakamae, E. 1993, SIGGRAPH — Display of the Earth taking into account atmospheric scattering — the single-scattering sky integral.
Cornette, W. M., Shanks, J. G. 1992, Appl. Opt. 31, 3152 — Physically reasonable analytic expression for the single-scattering phase function — the Mie phase used here.
Preetham, A. J., Shirley, P., Smits, B. 1999, SIGGRAPH — A practical analytic model for daylight — turbidity parameterisation.
O'Neil, S.2005, GPU Gems 2, ch. 16 — Accurate atmospheric scattering — the GPU realisation of the Nishita integral.
van de Hulst, H. C.1957 — Light Scattering by Small Particles, Wiley — Rayleigh and Mie regimes.
Minnaert, M.1954 — The Nature of Light and Colour in the Open Air, Dover — the classic field guide to sky colour, twilight and the green flash.
Zerefos, C. S. et al. 2007, Atmos. Chem. Phys. 7, 4027 — Atmospheric effects of volcanic eruptions as seen in the paintings of the great masters — Krakatoa and The Scream.
Lemmon, M. T. et al. 2015, Icarus 251, 96 — Dust aerosol, clouds, and the atmospheric optical depth record over Mars — the blue-sunset observations.
Ehlmann, B. L. et al. — MSL/Curiosity imaging of Martian twilight; the blue Sun near the horizon on Mars.
Bucholtz, A.1995, Appl. Opt. 34, 2765 — Rayleigh-scattering cross sections and optical depths for the atmosphere.