Abstract
A new and exact algorithm for the two-dimensional motion of an electron in a constant, perpendicular magnetic field has been derived. It is then extended to include a position-dependent force, of which the Coulomb force is an example. Such an algorithm can be readily used in any molecular dynamics simulation.