I'm currently writing a program for a particle simulator. One of the requirements is that the particles collide in a realistic way. However, I don't know how to calculate the final velocities.

For each collision, I have the $x$-component and $y$-component of each velocity, as well as the displacement and mass of each particle.

Is it possible to calculate the direction and magnitude of their velocities after the collision? If so, how?

## Best Answer

2 dimensional collision can be reduced to a 1-dimensional problem in the case of spheres--see here. The $\pm$ you encounter when solving the kinetic energy is likely because there are two solutions and the equations are satisfied by either one. One solution is simply where the particles pass right through eachother, which you can discard.