NewVersion 1.2

Atmospheric Optics: Sky Color, Rainbows & Halos

Paint a sky from the physics, from blue noon to red sunset on Earth, Mars, Titan and the Moon, then build the rainbow from Descartes to Airy and find halos and sun dogs from ice prisms.

A sunlit afternoon sky toward the Sun and a whole-sky view from below, the sky's color computed from sunlight scattered by air.

About this simulation

Why is the sky blue, not violet, and why is the setting Sun red? Students set the Sun's elevation and the air's pressure, gas, haze and ozone, and watch the sky's color change through a day, on Earth and on Mars, Titan or the Moon. A Sandbox sky painter shows the sky facing the Sun and the whole dome, with the optical depths behind the colors. Sunlight Through Air follows the spectrum from above the atmosphere to the ground, with the ozone, oxygen and water-vapor bands each able to be taken out. Rainbow Lab builds both bows from Descartes's rays and Airy's theory, with drop size from fog to big raindrops and a polarizer. Halos & Sun Dogs places the 22° and 46° halos, sun dogs and the circumzenithal and circumhorizontal arcs for every Sun elevation. The walkthrough runs from a black sky on the Moon to the 22° halo; the Advanced track adds cross sections, single scattering, ozone at twilight, Airy and Bravais's index. A concept challenge that names the atmosphere behind a sky and a prediction lab with fresh numbers every run round it out.

What you'll learn

  • Explain that molecules scatter blue light about six times as strongly as red, as 1/λ⁴, so the sky is scattered sunlight and blue, and with no air it is black.
  • Explain that a low Sun's beam crosses many air masses, and Beer–Lambert attenuation, I = I₀e^(−τm), leaves little blue: orange suns and red horizons while the zenith stays blue.
  • Explain that refraction and reflection in raindrops bunch light near 42° and 51° from the antisolar point with a dark band between, and that drop size sets the supernumeraries and the fogbow.
  • Explain that hexagonal ice prisms turn light by at least 22° and 46°, and that plates floating level make sun dogs, which move out as the Sun climbs and vanish above about 61°.

What you can do

  • Guided walkthroughStep-by-step, in Intro and Advanced tracks.
  • SandboxEvery control of the model, to explore freely.
  • Concept checksQuestions about ideas and vocabulary, with no calculating.
  • PredictionCommit to a prediction, then see the result.
  • Classroom demoProjector mode and recordable clips for slides.
  • Works offlineA single downloadable file, verified to run without a network.

Before you start

  • Wavelength and color, and reflection and refraction of light
  • Exponential decay and reading a graph
  • For the Advanced track: Snell's law, cross sections and optical depth, and a little calculus

Run or download

Run it in your browser

Nothing to install and no account. Works on laptops, Chromebooks, tablets, and phones.

Launch Atmospheric Optics: Sky Color, Rainbows & Halos

Download for offline use

One HTML file (867 kB) that opens in any modern browser with no network: for rooms with unreliable Wi-Fi, or to keep a copy.

Download the file
File details and checksum
File
atmospheric-optics-sky-halos-v1.2.html
Version
1.2, released November 28, 2026
Build
b7828b2
Size
887,881 bytes
SHA-256
4ec961f2dcd3d9784cec5d7699b46992f5464b35b560d1a4b21d84fb3b26f74d
Offline
Checked to run with all network access blocked.

The model and its limits

What the model assumes

  • The sky is the sunlight scattered once by molecules and particles (single scattering), computed in 14 wavelength bands of 25 nm from 380 to 730 nm, weighted with the CIE 1931 color-matching table and shown in sRGB.
  • The Sandbox adds, unless turned off, a rough two-stream estimate of light scattered many times for thick skies, spread evenly over the sky; the walkthrough and activities use single scattering alone.
  • The atmosphere is one uniform layer over a dark ground, with illustrative particles on other worlds chosen to look like rover and lander images.
  • Rainbows use water at 20 °C and Airy's theory near each bow with Fresnel factors and the Sun's disk averaged; brightness is relative to unpolarized 0.5 mm drops.
  • Halos use ice at 266 K: positions are exact, ring profiles come from a quadrature over every crystal orientation through ideal wedges, and brightness is schematic.

What it leaves out

  • Light scattered twice or more is left out of the single-scattering picture; it matters near the horizon and in deep twilight, dominates under clouds and in thick haze, and the sim says when a sky is outside the model's range.
  • The ground's reflected light and color, sky polarization, the Sun's narrow spectral lines, limb darkening, refraction near the horizon, airglow, starlight and moonlight are left out.
  • Real particles are not modeled: Henyey–Greenstein scattering has no rainbow, glory or corona, and the other worlds' particles and the gas bands' strengths are illustrative.
  • Rainbows leave out non-spherical drops, exact Mie theory and higher-order bows; halos leave out real crystal shapes and tilts.

Cite this simulation

APA 7

Meier, D. (2026). Atmospheric Optics: Sky Color, Rainbows & Halos (Version 1.2) [Computer simulation]. Glidepath Science. https://glidepathscience.org/simulations/atmospheric-optics-sky-halos/

MLA 9

Meier, David. Atmospheric Optics: Sky Color, Rainbows & Halos. Version 1.2, Glidepath Science, 2026, glidepathscience.org/simulations/atmospheric-optics-sky-halos/.

AIP

D. Meier, Atmospheric Optics: Sky Color, Rainbows & Halos, version 1.2 (Glidepath Science, 2026), https://glidepathscience.org/simulations/atmospheric-optics-sky-halos/.

BibTeX

@misc{meier2026atmosphericopticsskycolorrainbowshalos,
  author       = {Meier, David},
  title        = {{Atmospheric Optics: Sky Color, Rainbows & Halos}},
  year         = {2026},
  publisher    = {Glidepath Science},
  version      = {1.2},
  note         = {Interactive simulation, version 1.2},
  howpublished = {\url{https://glidepathscience.org/simulations/atmospheric-optics-sky-halos/}},
  url          = {https://glidepathscience.org/simulations/atmospheric-optics-sky-halos/}
}

Credits and license

Created by Dr. David Meier, Glidepath Science.

Licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0). You may share and adapt it for noncommercial purposes, such as teaching, with credit and under the same license. Licensing and reuse

AI tools (Claude, from Anthropic, and ChatGPT, from OpenAI) were used in developing Glidepath Science and its simulations. Dr. David Meier reviewed, edited, and modified every release version.