the latter case; however, note that this is not guaranteed to do so in a way that is consistent with collision physics (that is, changes in momentum are not guaranteed to be realistic). Instead of implicitly changing the velocity term, one would need to explicitly control the final velocities of the objects colliding (by changing the recorded position from the previous time step). The two simplest methods for deciding on a new velocity are perfectly elastic and inelastic collisions. A slightly more complicated strategy that offers more control would involve using the coefficient of restitution. See also Courant–Friedrichs–Lewy condition Energy drift Symplectic integrator Leapfrog integration Beeman's algorithm Literature External links Verlet Integration Demo and Code as a Java Applet Advanced Character Physics by Thomas Jakobsen Theory of Molecular Dynamics Simulations – bottom of page Numerical differential equations Articles with example C++ code Computational physics Molecular dynamics