Motion in a magnetic field