This is a deliberately simplified 2D model, not the 3D cave flattened: everything moves in one plane, obstacles are plain circles with no vertical gaps to duck through, and the bat's sonar fan is drawn directly on screen as sweeping lines whose brightness is the actual computed echo strength — dim lines are directions the bat can't hear over the noise floor. The underlying formulas are the same real physics as the 3D scene:
d = c·Δt/2 (time-of-flight)
f_echo = f0·(c+v_t)(c+v_b) / [(c−v_b)(c−v_t)] (two-hop Doppler)
c = 343 m/s (speed of sound in air); v_b and v_t are the radial closing-velocity components of the bat and the target. Raising the chirp frequency increases the echo strength returned by the small moth (Rayleigh scattering ∝ (radius/wavelength)²) but the pulse also loses more energy to air absorption over distance — the same frequency/range trade-off a real bat makes when it switches to shorter, higher-pitched calls close to prey.