A current-carrying coil reacts to an external magnetic field in the same way a magnetic dipole does (or a bar magnet). Like a magnetic dipole, a current-carrying coil placed in a magnetic field \(\vec{B}\) experiences a torque. In that sense, the coil is said to be a magnetic dipole.
To account for a torque τ on the coil due to the magnetic field, we assign a magnetic dipole moment \(\vec{μ}\) to the coil, such that
\(\vec{τ}\) = \(\vec{μ}×\vec{B}\) = \(NI\vec{A}×\vec{B}\)
where \(\vec{μ}\) = \(NI\vec{A}\) . Here, N is the number of turns in the coil, I is the current through the coil and A is the area enclosed by each turn of the coil.
The direction of (\vec{μ}\) is that of the area vector (\vec{A}\), given by a right hand rule
If the fingers of right hand are curled in the direction of current in the loop, the outstretched thumb is the direction of \(\vec{A}\) and \(\vec{μ}\). In magnitude, μ = NIA.
The torque tends to align \(\vec{μ}\) along \(\vec{B}\)