Thanks, I wrote the physics simulator and collision from scratch - the maths is actually a combination of these three techniques:
- https://hoani.net/guides/engineering/mathematics/lagranges-equations
- https://hoani.net/guides/mathematics/geometry-and-collisions
- https://hoani.net/guides/mathematics/runge-kutta
Not that I expect you to read them unless you're a big nerd like me, haha