Home▸Colours & Light▸Rainbow Formation in Mist: Ray Optics & Dispersion (2D)

Rainbow Formation in Mist: Ray Optics & Dispersion (2D)

2D rainbow-optics lab: real Snell's-law refraction, internal reflection and dispersion traced through a water droplet, deriving the ~42° primary-bow angle per colour from a genuine minimum-deviation scan — not a decorative gradient.

Colours & Light2DModerate60 FPS📱 Mobile-adapted⇄ 3D version
2d-rainbow-mist-waterfall ↗ Open standalone

This 2D companion to the 3D waterfall scene replaces the decorative rainbow arc with the actual geometric optics that produce one: every colour's bow angle is computed live by tracing Snell's-law refraction into a spherical droplet, one internal reflection, and refraction back out, then scanning the incidence angle to find the true minimum-deviation extremum — the same calculation that gives the textbook ~42° primary bow and its ~50–51° secondary. Sun elevation, droplet size and observer position all feed back into that same math, so the mist field's colour bands, the fogbow transition at small droplet sizes, and the bow sinking below the horizon at high sun are all consequences of the underlying ray trace, not scripted effects.

⚙ Under the hood

2D rainbow-optics lab with real Snell's-law refraction, internal reflection and per-wavelength dispersion, deriving the primary and secondary bow angles from a numerical minimum-deviation scan rather than a hardcoded value.

rainbowgeometric opticssnell's lawdispersionrefractioninternal reflection

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

What did you find?

Add reproduction steps (optional)