Home▸Perception & Optical Illusions▸Luna Moth Night Navigation: Light-Compass Spiral Trap (2D)

Luna Moth Night Navigation: Light-Compass Spiral Trap (2D)

2D light-compass model of real moth navigation: a fixed bearing angle to the brightest light source gives straight flight under distant moonlight, but the same rule spirals moths into a close artificial lamp.

Perception & Optical Illusions2DModerate60 FPS📱 Mobile-adapted⇄ 3D version
2d-luna-moth-night-navigation-lab ↗ Open standalone

This 2D companion replaces the 3D flock-animation original with the actual navigation mechanism implied by its title: a transverse-orientation light compass. Moths hold a fixed bearing angle to whichever light source currently dominates — far parallel moonlight versus a nearby point-source lamp — which produces straight-line flight under the moon and a real logarithmic spiral trap near the lamp, exactly as observed in nature. A side panel exposes moth count, lamp brightness, the bearing angle and the moth's turn rate, and a live readout tracks elapsed time, how many moths have been captured, their average distance to the lamp, and the mean spiral rate of the moths currently dominated by it.

⚙ Under the hood

2D light-compass model: moths blend a fixed-direction moonlight reference with an inverse-square point-source lamp by relative brightness, then steer toward a constant bearing angle to whichever one dominates — straight flight far from the lamp, an inward logarithmic spiral once it takes over.

moth navigationlight compasstransverse orientationlogarithmic spiralphototaxisinsect flight

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

What did you find?

Add reproduction steps (optional)