Home▸Neuroscience & Biophysics▸Bat Echolocation Cave (2D)

Bat Echolocation Cave (2D)

2D sonar-ranging lab: a bat's chirps are ray-marched against a procedurally generated cave, its rocks and its moths, with every echo delayed by its real time-of-flight (d = v·Δt/2) before it appears on the sound map.

Neuroscience & Biophysics2DModerate60 FPS📱 Mobile-adapted⇄ 3D version
2d-bat-echolocation-cave ↗ Open standalone

This 2D companion turns the 3D scene's title into a working sonar model: the bat casts 48 sample rays per chirp against a smooth radial cave wall, scattered rocks and wandering moths, and each echo is only drawn once its true round-trip delay (d = v·Δt/2 at 343 m/s) has elapsed. Toggle sonar view to see only what the bat's ears would — a fading point-cloud of returns — or full light to check that map against the real cave.

⚙ Under the hood

2D sonar-ranging lab: a bat emits chirps that reflect off cave walls, rocks and moths; every echo is delayed by its real time-of-flight before it appears, building a live sound map of the cave in the dark.

echolocationsonar rangingtime-of-flightbioacousticswavefront reflection

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

What did you find?

Add reproduction steps (optional)