An explicit solution of the bargman-michel-telegdi equation for the polarization in a magnetic field