The sky is a compass.

Sunlight scattered by air vibrates in a pattern locked to the sun. You can't see it. A fly can, and it steers by it. Drag the sun and watch the pattern follow.

Drag the sun across the dome, then switch to a fly's eye to see the pattern it steers by.

120°sun bearing
18°sun height
70%polarized overhead
NSEW

What a camera records

A polarization camera puts a tiny filter over every pixel, in four orientations. Each image on its own looks like plain sky with a dark band across it.

The pattern lives in the differences. Subtract opposite pairs, and the direction and strength of the vibration fall out at every pixel. A fly does the same with pairs of light-sensing cells set at right angles.

S1 = image 0° − image 90° S2 = image 45° − image 135° angle = ½ · atan2(S2, S1) strength = √(S1² + S2²) ÷ total light
subtract opposite pairs

Many patches of sky, one answer

Every patch of sky says the same thing: the sun lies at right angles to my vibration. Find the one direction that agrees with all of them, trusting strongly polarized patches most.

Clouds take patches away. The answer barely moves, because the rest of the sky still agrees. A ring of compass cells holds the result as a bump of activity that turns as the body turns.

Simulated: 320 sky patches, each read with 6° of random error.

40°heading read from sky
0.0°error

Why it matters: getting home

Two travellers leave the nest on the same wandering route, each counting steps and tracking heading so it can walk straight home afterwards.

One reads heading from the sky: a little noisy, but it never drifts. The other relies on a gyroscope alone: smooth, but a small bias builds up for the whole trip.

Simulated: 10 minutes at 1 m/s. Sky compass error 2° per reading. Gyro bias 0.05° per second, uncorrected.

Sky compass missed home by–
Gyro alone missed home by–

The same chain, on a chip

Every stage is additions, subtractions and one weighted sum. That fits the clocked, fixed-point style of our fly-eye motion circuit, with no search and no large matrices.

Pixels with four filters

Each group of four pixels looks through polarizers at 0°, 45°, 90° and 135°.

Add and subtract

Opposite pairs are subtracted to give the angle and strength at every point of the sky.

A ring that holds heading

The whole sky votes into a ring of cells, modelled on the fly's central complex.