Momentum Animation
Click, drag, release!
images/momentum.js
Collisions can be on a scale of 0 (Inelastic) to 1 (Elastic).
- Inelastic collisions are mushy (like dough balls)
- Elastic collisions are bouncy (like rubber balls)
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 + mbvb ma + mb
new vb = elast × ma(va − vb) + mava + mbvb ma + mb
Where:
- elast = "Coefficient of Restitution", 0=inelastic, 1=elastic
- va and ma are the velocity and mass of object a
- vb and mb are the velocity and mass of object b