A simple physics simulation that is written in pure javascript. The simulation obeys the rules of momentum and also respects to variables such as gravity, mass of air and elasticity of the balls. Colors of the balls are determined by the ratio of mass divided by size.
For a demo, click here.