Home▸Everyday Physics▸Bouncing Balls (2D)

🧪 Bouncing Balls (2D)

A 2D canvas box of bouncing balls with real mass-weighted elastic collisions — tune gravity, restitution, ball count and air drag while a live readout tracks average speed and total kinetic energy.

Everyday Physics2DModerate60 FPS📱 Mobile-adapted⇄ 3D version
2d-bouncing-balls ↗ Open standalone

This 2D companion drives the same mass-weighted elastic-collision physics as the 3D version — gravity, wall restitution and pairwise impulse resolution between balls — on a plain canvas instead of an orbiting WebGL scene, with sliders for gravity, restitution, ball count and air drag plus a live readout of average speed and total kinetic energy.

⚙ Under the hood

Balls integrate under gravity, bounce off the four walls with a restitution coefficient, and resolve ball-ball overlaps with mass-weighted position correction and a normal-impulse elastic collision response.

bounce physicsenergy transfercollision detectionrestitutionelastic collision

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

What did you find?

Add reproduction steps (optional)