Momentum Animation

Click, drag, release!

images/momentum.js

Try this: Drag the balls and let them collide. Then change the elasticity setting. What happens when it is 0? What about 1?

Explanation

Collisions can be on a scale of 0 (Inelastic) to 1 (Elastic).

A ball of dough splatting flat on a floor (inelastic) next to a rubber ball bouncing high (elastic).

In the Gravity Animation, the collisions are either inelastic (two objects smashing into each other) or elastic (the objects swing around each other and head off again).

Formula

The formulas used in this animation are:

new va = elast × mb(vb − va) + mava + mbvbma + mb

new vb = elast × ma(va − vb) + mava + mbvbma + mb

Where:

Let's see how these formulas work:

Example: Collision! 2 kg at 3 m/s hits 1kg at rest

  • Ball A: mass (ma) = 2 kg, moving at velocity (va) = 3 m/s
  • Ball B: mass (mb) = 1 kg, at rest (vb) = 0 m/s
  • Elasticity (elast) = 1 (perfectly bouncy)

Let's calculate the new velocity of Ball A:

new va = 1 × 1 × (0 − 3) + 2 × 3 + 1 × 02 + 1

new va = −3 + 6 + 03 = 33 = 1 m/s

Now let's calculate the new velocity of Ball B:

new vb = 1 × 2 × (3 − 0) + 2 × 3 + 1 × 02 + 1

new vb = 6 + 6 + 03 = 123 = 4 m/s

After the collision, Ball A slows down to 1 m/s, and Ball B shoots forward at 4 m/s!