Inferior mirage (2D)

Switch to 3D

Presets

Controls

Live readouts

Numerical check

Press the button to compare simulation and theory.
The science

The refractive index of air is n - 1 = 7.76e-5 P/T (P in hPa, T in kelvin), so hot air near a road is slightly less dense and has a lower index. With the temperature profile T(h) = Ta + (Ts - Ta) exp(-h/d) the index rises with height, dn/dh > 0, and a ray bends towards the higher index, upwards. In a horizontally stratified medium Snell's law gives the invariant n(h) cos(theta) = const.

The simulator integrates dh/dx = tan(theta) and d(theta)/dx = (1/n) dn/dh with a fourth-order Runge-Kutta scheme and finds, by bisection, the launch angles whose rays pass through the top of a car at the chosen distance. A ray launched downwards that turns upwards before touching the road reaches the eye from below: the brain places the car below the horizon, an inverted image, the inferior mirage that looks like water on the road.

Simplifications: flat Earth, a single exponential temperature layer, monochromatic light, no turbulence or shimmer. The height scale of the drawing is stretched many times, because the real rays bend by only a few milliradians.