Home▸Physics & Mechanics▸Bouncing Bodies: Elastic Collisions & Energy Conservation (2D)

Bouncing Bodies: Elastic Collisions & Energy Conservation (2D)

A box of unequal-mass bodies bouncing under gravity and linear air drag, colliding elastically off the walls and each other, with kinetic energy, total momentum and a running collision count tracked live.

Physics & Mechanics2DEasy60 FPS📱 Mobile-adapted⇄ 3D version
2d-fizyka ↗ Open standalone

This 2D companion trades the 3D version's orbiting camera for a flat, readable box: bodies of different radius (and therefore different mass, since mass here scales with area) fall under an adjustable gravitational acceleration, lose a little speed each second to linear air drag, and bounce off the walls and each other with a tunable coefficient of restitution. Every collision — wall or body-to-body — resolves the way a real elastic impact does, using the standard restitution formula along the collision normal so momentum is exchanged correctly between unequal masses, and the live readouts (kinetic energy, total momentum magnitude, average speed and collision count) let you watch conservation laws hold, or watch them "leak" energy on purpose as you lower the restitution slider below 1.

⚙ Under the hood

2D elastic-collision box: unequal-mass bodies under gravity and linear drag, colliding off the walls and each other with a coefficient-of-restitution impulse solver, with live kinetic-energy, momentum and collision-count readouts.

elastic collisionmomentum conservationkinetic energycoefficient of restitutionrigid bodynewtonian mechanics

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

What did you find?

Add reproduction steps (optional)