The conservation of momentum as well as the conservation of kinetic energy define the elastic collision. You can change the masses and speeds of the colliding objects by clicking on them. The position of the center of mass is indicated.
Click and drag on a mass to set a new velocity.