Collisions, games, physics
This simple stack provides a function that allows one to allow for collisions between circular graphic objects. It is based on the physics of an ideal, elastic collision in which the total momentum and energy are conserved.
Given the position and velocities of each ball just before the collision, the "getVel" function will return the velocities of each ball just after the collision.