# DIY: Derive It Yourself

This is Simon’s preferred way of learning math and physics: try to work out the formulas independently. This time it’s the collision formulas which he attempts to depict geometrically. You will ask, why collisions? It’s something Simon often needs to incorporate in his code, like when balls or particles collide in the physics visualizations he makes.

I rearranged the formulae for the conservation of energy and conservation of momentum and I plotted it. I plotted all the points in abstract phase space. every point represents one possible state of the collision set-up.

the circle represents all of the states where the conservation of energy holds and the line represents all the states where conservation of momentum holds. So the intersections are where they both hold. There’re two intersections, before the collision and after the collision. They both have the same energy and momentum. Now I just need to find those intersections!

Circle-circle collision is harder than circle-wall collision, because you have to take the mass of the two circles into account, as well as the conservation of energy and the conservation of momentum.

x is actually not the value I’m looking for. I defined x to be the velocity.

The following day Simon took his calculations to derive collision resolution further during a jamming session with his math tutor/friend Sven. He realized, however, that his eqiations were convoluted:

I assumed I was calculating x while I was calculating v1. So I ended up in a stage where you need v1 to calculate v1.