I'm trying to understand how to calculate the collision of two balls e.g. billiard balls. I found a java simualtion of colliding balls. However I don't understand the equations that were used there. The code for calculating the velocity vectors is at http://www.interactivepulp.com/pulpcore/bubblemark/src/Ball.java [Broken] in the doCollide method. The java applet is here http://www.interactivepulp.com/pulpcore/bubblemark/ [Broken] I don't get what the variable "mag" means? What does mag stand for?