  An expression is presented for the relativistic equations of motion,
including field gradients, of a particle and its spin with electric and
magnetic dipole moments aligned along the spin axis. An electromagnetic duality
transformation is used to generalize a Thomas-BMT equation with gradient terms.
Corrections to particle dynamics in storage rings for precision $(g-2)$ and
electric dipole moment measurements are calculated, and applications to
precision particle tracking programs are considered.
