We've all seen a traditional compass.  A ferromagnetic, magnetized needle is mounted on a rotating bearing (or floated on the surface of a liquid) so that it can rotate in the (x-y) plane.  If there is an in-plane magnetic field (\mathbf{B}), the needle will rotate to align with that component of the field.  (It stops in the aligned state because of friction; otherwise it would "librate", oscillating back and forth about the field direction.)  In first-year undergrad physics, we learn a simp