Orbiting billiard balls - How to not implement papers / books

Recently I found a beautiful, although unphysical behavior when I was implementing the dynamics of elastic billiard balls ( hard spheres in physics lingo). And the bug was not at all where I expected it to be. But since while debugging I did not find any resource helping me out with this, and I think there is a good general lesson to be learned, I thought I write it up. Pretty images Okay. Mindset we want to simulate balls flying around and bouncing off of things, with the total kinetic energy being conserved. There is nothing else acting on the balls. No gravity, no nada. ...

March 21, 2025 · 5 min · ericschmidt