The following is a simulation for elastic collision which means that

1. the momentum is conserved: $m_1vec{V_1}+m_2vec{V_2}=m_1vec{V'_1}+m_2 vec{V'_2}$ where $m_1,m_2$ are mass for each object, $vec{V_1},vec{V_2}$ are velocity vectors before collision,$vec{V'_1},vec{V'_2}$ are velocity vectors after collision.

2. the total energy is conserved: $frac{1}{2}m_1vec{V_1}^2+frac{1}{2}m_2vec{V_2}^2=frac{1}{2}m_1vec{V'_1}^2+frac{1}{2}m_2vec{V'_2}^2$

For collision in 2D, there are four unknow, however, there are only three equations. Because the contact point is missing in the above equations.

To solve the above problem, we can break 2D collision problem into two 1D collision problem once we know the contact point (when collision happened).

We use x-y coordinate to describe the position of those two balls before and after the collision.

At the time when two balls just in contact with each other, we can choose a new coordinate system:

1. direction from center of mass of $m_1$ to center of mass of $m_2$: The interaction forces bwteen those two balls during collision is limited to this direction. It become a

1D collision problem in this direction.

2. direction which is perpendicular to the above direction: Assume there is no friction between those two balls, no rotation effect to be considered, then the velocity component for those two balls in this direction will not be changed when collision happened (Because the interaction force dose not have component in this direction).

This simulation shows the physics of two ball collide in 2D (without any rotation motion).

What can be changed:

- The sliders on either side change the vertical position of each ball

- mass(m) and initial horizontal velocity(vx) can be adjusted with slider bar

- Use mouse click and drag to change the position (click near the center of the ball) or the velocity vector (click near the arrow)

- check out the "paused when collide" checkbox to show more detail process during collision,

Click mouse in the area to play it again

Physics processes:

- when two ball meets, the program shows two components of the velocity for each ball (along the line connect two ball and perpendicular to it)

- Interaction (force) between balls is along the line connect two balls

- Velocitys perpendicular to connection line are not changed (No force/interaction in that direction)

- The rest of the problem is similar to 1D collision problem for ball with velocity along the line

- Because this is a 2D simulation, so the radius is proportional to the square root of the mass to keep the same density (for those balls).

You need to understand conservation of momentum and conservation of energy.

The velocity of two objecs after collision (V

_{1}',V

_{2}')can be calculated from velocity before collisions (V

_{1},V

_{2}) and mass of two objects (m

_{1},m

_{2}).

V

_{1}'= (m

_{1}-m

_{2})*V

_{1}/(m

_{1}+m

_{2}) + 2*m

_{2}*V

_{2}/(m

_{1}+m

_{2})= (m

_{1}V

_{1}+m

_{2}V

_{2})/(m

_{1}+m

_{2})+(V

_{2}-V

_{1})*m

_{2}/(m

_{1}+m

_{2})=V

_{cm}+(V

_{2}-V

_{1})*m

_{2}/(m

_{1}+m

_{2});

V

_{2}'=2*m

_{1}*V

_{1}/(m

_{1}+m

_{2})+(m

_{2}-m

_{1})*V

_{2}/(m

_{1}+m

_{2})=(m

_{1}V

_{1}+m

_{2}V

_{2})/(m

_{1}+m

_{2})+(V

_{1}-V

_{2})*m

_{1}/(m

_{1}+m

_{2})=V

_{cm}+(V

_{1}-V

_{2})*m

_{1}/(m

_{1}+m

_{2});

Where V

_{cm}=(m

_{1}V

_{1}+m

_{2}V

_{2})/(m

_{1}+m

_{2});

Before the collision, the velocity of m

_{1} relative to V

_{cm} is

V

_{1}-V

_{cm}=V

_{1}-(m

_{1}V

_{1}+m

_{2}V

_{2})/(m

_{1}+m

_{2})=m

_{2}(V

_{1}-V

_{2})/(m

_{1}+m

_{2})

compare it with the second term in V

_{1}'

If m

_{1}=m

_{2} then V

_{1}'=V

_{2}, V

_{2}'-V

_{1} ;

it means that both particles just exchange velocity.

If m

_{1}>> m

_{2} then V

_{1}' ? V

_{1} ; V

_{2}'? 2V

_{1}+V

_{2};

i.e.

**If a heavy car hit you with velocity V**_{1}=50km/hr , you will fly out with velocity 2V_{1}=100km/hr.

If m

_{1}<< m

_{2} then V

_{1}' ? -V

_{1}+2V

_{2} ; V

_{2}'? V

_{2};

i.e. If a small ball hit a wall (V

_{2}=0),then the ball will be bounced back (same magnitude,oppositive direction).

For collision 2D, the trick is to transform it into collision 1D problem:

In the direction of red arows, and another direction normal to red arrows (i.e. direction of green arrows).

If friction is not considered (which will cause both balls to rotate due to friction force),

Then green arrow velocity is not changed after the collision because there is no force in that direction.

And collision in red arrow direction is 1D collision problem, so you can use the above equation.

However, you need to calculate the component of velocity in red arrow direction. (This you need to understand the meaning of inner product -- mathematic operation).