This Demonstration implements a physics collision detection engine using priori (continuous) collision detection to simulate the motion of particles in 2D. You can have up to 6 particles at same time moving inside a closed unit size square.
Collisions between particles and the walls can be elastic or inelastic. Mass of particles can be the same or different (randomly generated). No friction nor gravity is present in this simulation, hence speed of particles between collisions is constant.