---
title: "Mirage & Green-Flash Observatory Interactive Lab | Sandbox Physics"
description: "How can layers of warm and cool air make distant objects sink, rise or appear several times?"
canonical_url: "https://sandboxphysics.com/labs/atmospheric-refraction-theatre/"
language: "en"
page_type: "lab"
alternate_languages:
  zh-CN: "https://sandboxphysics.com/zh/labs/atmospheric-refraction-theatre/"
last_modified: "2026-10-29"
---

Optics 012 · A ship and the setting Sun through layered air

# Mirage & Green-Flash Observatory

**How can layers of warm and cool air make distant objects sink, rise or appear several times?** Temperature changes the air's density and with it the refractive index, and light bends toward the cooler, denser air. Over hot ground the lowest air is hottest, so rays curve upward: distant objects sink and the sky seems to lie on the road, an inferior mirage. When the lowest air is colder, rays curve down and distant objects loom into view. Several temperature layers stack several images.

Look at a ship 20 km out through cold sea air: its light bends back down, so the ship looms up, stacks and flips. The same air stretches the green flash.

> Interactive simulation: open this page in a web browser to change the parameters and run the model.

Model of the mirage and green-flash calculations of van der Werf, Können and Lehn (Applied Optics 42, 367, 2003) and the transfer characteristic of Lehn (JOSA 73, 1622, 1983). The air follows the US Standard Atmosphere 1976 started from the chosen sea-level temperature, plus one layer whose temperature changes by the chosen step as a smooth Fermi step around its central height. Pressure follows from hydrostatic balance with inverse-square gravity, and the refractive index from pressure and temperature with the constants of van der Werf et al. for 650, 580 and 520 nm; humidity is left out. Rays are traced in the vertical plane over a spherical Earth of radius 6371 km by a fourth-order Runge–Kutta method; Bouguer’s invariant stays constant along every ray to better than one part in a hundred million. The layer is horizontally uniform for 50 km and then ends, where the paper’s layer starts to weaken; light still low there continues through the same air without the layer. If the layer went on for ever, a level ray from 15 m under a layer 40 m up would be trapped from a 3.64 K step, where the paper finds the threshold between 3.7 and 4.0 K. Extinction is left out, although along the long low paths of a trapping layer real air lets mostly red light through. The ship is a 60 m freighter 21 m tall; the camera image uses 241 rays in 580 nm light and ignores turbulence, diffraction and the camera lens. In the scene, heights are drawn about 30 to 270 times taller than distances, and the sea’s curve uses the same height scale.

Physics tutorial

## See a ship rise, stack and flip over the sea

**Background** Light travels a little more slowly in dense air than in thin air. Cold air is denser than warm air, and over a calm sea the temperature can change by several degrees within a few metres of height.

**Why it matters** Through such air a ray from a distant ship does not run straight: it curves towards the denser air. Sailors have long reported ships hanging upside down in the sky, coasts rising from beyond the horizon and a green flash at sunset. In 2003 van der Werf, Können and Lehn traced rays through layers of this kind to explain both the mirages and the flash.

Start with the essentials

- **Focus question**: A camera on the shore looks at a ship 20 km away. How can a layer of air a few metres thick show the ship several times, some of the images upside down?
- **One-sentence intuition**: Trace each ray from the camera to the plane of the ship and plot the height $z$ where it lands against the elevation $\beta$ at which it left the camera: this is the transfer characteristic (Lehn 1983). In plain air $z$ rises steadily with $\beta$ and the ship looks normal. A layer that bends rays more than the sea curves folds the curve. Each stretch where $z$ rises is an upright image, each stretch where it falls an inverted one.

### Core mathematical model

#### The refractive index of air

$$
n-1=A(\lambda)\,\frac{P}{T}
$$

Pressure $P$ is in hectopascals and temperature $T$ in kelvin. Van der Werf et al. (2003) give $A=7.87\times10^{-5}\,\mathrm{K/hPa}$ at 580 nm, 0.4 % more at 520 nm and 0.3 % less at 650 nm. At sea level $n-1$ is about $3\times10^{-4}$, larger in cold air than in warm air.

#### One layer on the standard atmosphere

$$
T(h)=T_{\mathrm{US}}(h)-\Delta T+\frac{\Delta T}{1+e^{-(h-h_{\mathrm{c}})/a}}
$$

The US Standard Atmosphere 1976 cools by 6.5 K per kilometre. The layer adds a step $\Delta T$ centred at the height $h_{\mathrm{c}}$, with 90 % of it inside a band $6a$ thick (van der Werf et al. 2003, Eq. 7). A positive step leaves cold air under warmer air; a negative step leaves hot air at the surface.

#### Following a ray around the Earth

$$
\begin{aligned}\frac{\mathrm{d}h}{\mathrm{d}\psi}&=(R+h)\tan\beta\\\frac{\mathrm{d}\beta}{\mathrm{d}\psi}&=1+\frac{R+h}{n}\,\frac{\mathrm{d}n}{\mathrm{d}h}\end{aligned}
$$

The ray climbs at the elevation $\beta$ above the local horizontal while it advances through the angle $\psi$ about the Earth’s centre, with $R=6371\,\mathrm{km}$ (van der Werf et al. 2003, Eqs. 4 and 5). Together the two equations keep Bouguer’s invariant $n\,(R+h)\cos\beta$ constant; the traced rays hold it to better than $10^{-8}$.

#### When a layer traps light

$$
\begin{gathered}k=-\frac{R}{n}\,\frac{\mathrm{d}n}{\mathrm{d}h}\\k>1\iff\frac{\mathrm{d}T}{\mathrm{d}h}>\frac{T^2}{A\,P\,R}-B\end{gathered}
$$

The bending $k$ compares the curvature of a level ray with that of the Earth; standard air at 15 °C gives $k\approx0.17$. Where $k>1$, a level ray curves faster than the sea falls away and is trapped. That takes warming of about 0.11 K per metre of height (van der Werf et al. 2003, Eq. 12). Where the temperature falls faster than $B=0.034\,\mathrm{K/m}$, $k<0$ and rays bend upwards, as over a hot road.

#### Height of the green flash

$$
\Delta\beta_{\mathrm{g}}=\int\mathbf{1}\!\left[\alpha_{\mathrm{g}}(\beta)\le\min\alpha_{\mathrm{r}}\right]\mathrm{d}\beta
$$

Each apparent altitude $\beta$ maps to the true altitude $\alpha$ in which its ray leaves the atmosphere. Once the Sun’s top edge sinks below the lowest true altitude red light can come from, red is gone; green light, bent slightly more, still arrives over the range $\Delta\beta_{\mathrm{g}}$. In the standard-air preset that range is 14 arcseconds; next to a layer that almost traps rays, the nearly flat transformation curve stretches it more than tenfold.

### Common difficulties

#### A mirage is not a reflection

**Typical misconception** The inverted image is the ship reflected in the sea or in a layer of air.

**Better mental model** No surface reflects the light. In the default preset the inverted image hangs above the ship, made by rays that bend smoothly through the layer and cross on the way; the transfer characteristic shows where they cross.

#### Warm air does not always lift things

**Typical misconception** Warm air makes distant things look higher.

**Better mental model** Light bends towards the colder, denser air. Hot air at the surface bends rays upwards, so things sink and an inverted image appears below; cold air over the sea bends rays down and lifts distant things into view.

#### The green flash is not in the eye

**Typical misconception** The green flash is an afterimage of the red sunset.

**Better mental model** Air bends green light slightly more than red, so the Sun’s green image sits a little higher and sets last. This simulation has no eye at all and the green still outlasts the red; a layer close to trapping stretches it into a flash tall enough to see.

### Run the experiment

1. 01

   #### Watch the ship stack and flip

   Keep the default preset, Cold sea air: the ship stacks and flips, and look at the camera image under the scene.

   **What to observe:** The camera sees three images of the freighter, the middle one upside down, together 16.1 arcminutes tall. Without the layer the ship would be 2.85 arcminutes tall.

2. 02

   #### Read the folded curve

   Look at the plot of where each ray meets the ship, then drag the camera up and down.

   **What to observe:** The curve rises, falls and rises again; the falling stretch, in magenta, is the inverted image. At the layer, 25 m up, a level ray bends 4.9 times as sharply as the Earth curves. Moving the camera changes which rays cross, so the images grow, shrink and merge.

3. 03

   #### Heat the surface

   Load Hot surface: an inverted image below.

   **What to observe:** Hot air in the lowest metre bends rays upwards. The bottom 5.8 m of the ship disappear, and an inverted copy of the rest hangs below it, like the sky seen on a hot road.

4. 04

   #### Let the ship loom

   Load Gentle warm layer: the ship looms up.

   **What to observe:** The step is spread over many metres, so the curve never folds and there is one upright image. It is stretched to 5.24 arcminutes instead of 2.95.

5. 05

   #### Bring back a hidden ship

   Load A ship beyond the horizon reappears.

   **What to observe:** At 30 km the ship lies behind the curve of the sea in standard air. A sharp step 14 m up traps rays beneath it, and the camera sees three thin images of the ship between 3.6 and 11.2 m above the waterline, two of them inverted.

6. 06

   #### Stretch the green flash

   Load Near-trapping layer: a tall green flash, then Standard air: no mirage, and compare the sunset frames.

   **What to observe:** Just below the 3.64 K step that would trap level rays, the green edge of the Sun still spans 162 arcseconds of sky at the moment the red edge sets. In standard air the green rim is 14 arcseconds high.

Physical conclusion

A mirage is not a reflection. Air whose temperature changes with height bends rays all the way along, and where the bending changes sharply with height, rays that leave the camera at neighbouring angles cross before they reach the ship. Their order flips, so the ship appears stretched, inverted or several times over. The same bending makes the colours of the setting Sun disappear one after another; next to a layer that almost traps rays, the green edge stays up longest and stretches into a tall flash.

## Related experiments and articles

Probes and measurement · Reading path

### Wireless links and the upper atmosphere

Articles on this path that use this experiment, followed by the other experiments they suggest.

1. [Article **Wireless and the ionosphere: reception was only the beginning**](https://sandboxphysics.com/stories/probe-evidence/wireless-signals-and-ionosphere/)
2. [Lab **Radio Echoes from the Ionosphere** Sound an ionospheric layer](https://sandboxphysics.com/labs/ionospheric-radio-sounding/)
3. [Lab **Gradient-Index Optics Observatory** Follow rays that bend continuously](https://sandboxphysics.com/labs/gradient-index-worlds/)

Waves & optics · Starter path

## From one ray to interference measurement

Start with refraction, find where the ray picture stops working, then use interference to measure tiny distances.

[Start here → **Optical Boundary Explorer** Turn the incident angle and watch reflected and transmitted power trade off. Then switch to the critical-angle scene. Observe · 11 min](https://sandboxphysics.com/labs/optical-boundary-explorer/)

1. [1 Optical Boundary Explorer](https://sandboxphysics.com/labs/optical-boundary-explorer/)
2. [2 Rainbow Caustic Observatory](https://sandboxphysics.com/labs/rainbow-laboratory/)
3. [3 Camera Obscura](https://sandboxphysics.com/labs/camera-obscura/)
4. [4 Coherent Wave Composer](https://sandboxphysics.com/labs/coherent-wave-composer/)
5. [5 Young Double-Slit Bench](https://sandboxphysics.com/labs/young-double-slit-bench/)
6. [6 Michelson Precision Lab](https://sandboxphysics.com/labs/michelson-precision-lab/)

[View the full path →](https://sandboxphysics.com/topics/waves-and-optics/#starter-path)
