20 Balls in a Rotating Heptagon

Hand-written 2D physics — gravity, ball–ball & moving-wall collisions, restitution, friction and spin. The heptagon makes one revolution every 5 seconds.

Balls 20 Heptagon 0° Period 5.0 s / rev Elapsed 0.0 s State Running Collisions 0

Each number rotates with its ball, and the small rim dot makes spin easy to see. Wall bounces use the moving wall’s velocity, so the spinning heptagon can flick balls as it turns.
Tip: press Space to pause / resume, R to reset.