Bar magnets as dipoles

Drag a magnet body to move it, drag its end (pole) to rotate. Drag the compass to probe the field; click empty space to move it there.