A compass needle which can be moved (by dragging the mouse with pressed mouse button) shows the direction of the magnetic field (blue) at a given position. North and south pole of the compass needle are painted with red respectively green colour. The influence of the earth's magnetic field is neglected in this simulation.
The magnetic field lines of a straight current-carrying wire form concentric circles around the wire. The direction of the magnetic field (blue arrows) is given by the right-hand rule: When the thumb of the right hand points in the direction of the conventional current, the fingers curl around the wire in the direction of the magnetic field.