Magnetic Positioning Equations: Theory and Applications