Change the mass and velocities of the two carts, then press play. Click on the carts to change their velocities and masses. Currently only supports inelastic collisions. Just for the sake of simplicity the starting velocities of the cars are not divided by their mass. Also for the sake of simplicity, friction is not included.
All code and art by me. Formula: (m1*v1)+(m2*v2)/(m1+m2) Thanks to my physics teacher for the formulas. V2.0 will include elastic collisions. *note: if the carts are moving in very small jerks, either the resultant velocity (after the collision) is very low or your computer is lagging.