2D Elastic Ball Collision Physics

0WJYxW9FMN picture 0WJYxW9FMN · Feb 4, 2016 · Viewed 10k times · Source

I am making a program that involves elastic ball physics. I have worked out all of the maths for collision against walls and stationary objects, but I cannot figure out what happens when two moving balls collide. I have mass and velocity (x and y velocity to be exact, but velocity of each ball and their direction will do) and would like the formulae for those. Remember - this is a perfectly elastic collision - so no spinning balls, etc.

Answer

cromod picture cromod · Feb 4, 2016

This wikipedia article provides a formula to compute velocities after collision between two particles :

There are many reasons to use this formula :

  • you just need the velocity vectors of your balls before collision, their mass and their position,
  • you don't need to define angles of deviation,
  • the operations are simple (just dot product required),
  • the vectors can be expressed in any coordinates system.

There is no proof in the wikipedia article so I provide it below.


Definition of the problem

enter image description here

For each ball we define :

  • mi the mass
  • vi the vector of velocity before collision
  • v'i the vector of velocity after collision
  • Oi the point of center
  • xi the vector of Oi position

The unit vector n is normal to the surfaces of balls at the point of contact.

The unit vector t is tangent to the surfaces of balls at the point of contact.


Physics law to use

The conservation of the total momentum is expressed by :

The conservation of total kinetic energy is expressed by :

As there is no force applied in the tangential direction, the tangential components of velocities are unchanged after collision :


Proof

The tangential components of velocities are unchanged. So we can rewrite the conservation laws with normal components and we have a 1D problem now :

The conservation of kinetic energy can be factorized then simplified with the conservation of momentum :

We combine this last expression with the conservation of momentum and we get the normal component of v'1 :

Finally, we find the formula of the wikipedia article for v'1 :

The formula of v'2 is symmetrical.