Home▸Colours & Light▸Why Is the Sky Blue? Rayleigh Scattering (2D)

2D Why Is the Sky Blue: Rayleigh Scattering

2D flat simulation of Rayleigh scattering (I ∝ 1/λ⁴): drag sun elevation and atmospheric particle density to watch the sky gradient shift from deep blue overhead to red at the horizon, with a live wavelength-vs-scattering-intensity chart.

Colours & Light2DEasy60 FPS📱 Mobile-adapted⇄ 3D version
2d-3d-blue-sky-rayleigh-scattering ↗ Open standalone

This is the flat companion to the 3D blue-sky simulator: instead of an orbitable dome, it renders the sky as a simple gradient panel driven by the same Rayleigh-scattering physics — scattered intensity proportional to 1/λ⁴. Drag the sun-elevation slider from overhead down to the horizon to see the zenith stay deep blue while the sun and the sky around it shift from white through gold to red as the slant path through the atmosphere lengthens. The particle-density slider scales how much air the light passes through, and the live chart shows exactly how much more strongly short wavelengths are scattered than long ones at the current settings.

⚙ Under the hood

2D flat sky-gradient simulation of Rayleigh scattering (I ∝ 1/λ⁴): sun-elevation and atmospheric-density sliders show the zenith stay blue while the sun and horizon shift from white to red as its slant path through the atmosphere lengthens.

colors and lightrayleigh scatteringatmospheric opticssky colorsunsetwavelength

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)