Presets
Playback
Air and viewer
Hot air is thinner, so its refractive index is lower. Light bends towards the denser, cooler air: upward over a hot road, downward over cold ground.
Model checks
The science
What is modelled
Air near the ground is warmer (or colder) than the air above by an amount that decays exponentially with height. The refractive index of air depends on its density, n = 1 + 77.6×10-6 P/T (P in hPa, T in K), so a temperature gradient is an index gradient and light rays curve. Rays are launched from the eye at a fan of small angles and traced to the ground or to the chosen distance.
Equations
- Temperature:
T(z) = Tamb + ΔT e-z/H. - Ray equations in a horizontally layered medium:
dz/dx = tan θ,dθ/dx = (1/n) dn/dz, integrated with RK4. - Invariant:
n(z) cos θis constant along each ray (Snell's law for a layered medium).
Checks run in the page
- Drift of the invariant over all rays.
- The analytic dn/dz against a central finite difference of n(z).
- A uniform atmosphere: rays are straight and hit the ground where geometry says.
- The bending of the central ray against the line integral of (dn/dz)/n along its path.
Honest simplifications
Flat ground and flat layers (no Earth curvature), a single exponential temperature profile, constant pressure, no turbulence or shimmer, no wavelength dependence. The picture stretches the height axis by a large factor; real rays are almost horizontal.
What to try
- Press Hot road and note how the rays curve up before reaching the ground: you see the sky in the road.
- Choose Cold-air inversion: the rays bend down and distant objects appear raised.
- Raise the eye: fewer rays reach the ground.