3 Magnetic Field and Field Lines
To determine the magnetic force on an ionised atom or molecule the magnetic field must be known. Determining the magnetic field is a non-trivial exercise which we will omit (except for the brave, see [[section]]4). Instead we will see what the magnetic field lines for charge travelling in a line and in a circle will look like.
The most striking characteristic of the magnetic field lines for a straight line of current is that the field lines are continuous, figure 2. That is, unlike electrostatic field lines, they do not originate from one location and end at another. This continuity of the field lines is always true of the magnetic field. In order to be consistent with our definition of the field in the Lorentz force we define the direction of the field lines by the right hand screw rule.

Figure 2. The magnetic field around a straight current carrier.
You can remember the right hand rule by pointing the thumb of your right hand in the direction of the current and making a fist of the rest of your fingers. The direction in which your fingers point indicate the field direction. The only other thing you need to remember is that the current is defined as moving in the direction that positive charge travels!
The field pattern for a current loop can be sketched by remembering that the lines are continuous and they circulate around the conductor, figure 3. The field pattern has obvious similarities to the electrostatic dipole and is called, by analogy, the magnetic dipole. Clearly an electron circulating around the nucleus would constitute a current loop and as such we would expect it to produce a magnetic dipole field. In fact not only does the atom possess a magnetic dipole field, but so do electrons and protons. The magnetic dipole from these cannot be described classically, they are an intrinsic quantum mechanical property. However, the ways in which these magnetic dipoles interact with each other and external fields is important in the interpretation of the spectroscopic behaviour of atoms and molecules.

Figure 3. The magnetic dipole. The current loop is coming out of the page and has been cut in half.
4 Determining the Magnetic Field
We now turn to the determination of the magnetic field using the Biot-Savart law. This is the magnetic equivalent of the superposition principle, but its appearance is far more daunting!
The Biot-Savart law expresses the magnetic field as the sum of tiny sections of a current carrying circuit.

Figure 4. The Biot-Savart construction.
The contribution to the magnetic field at the point defined by position vector r from the circuit element dl' (which points in the direction of current flow) is given by
(7),
where I is the current, r - r' is the vector pointing from the circuit element to the location where the field is being calculated and μ0 is a universal constant, the permeability of free space, which is 4πx10-7 kg.m.C-2 exactly. The current is defined as the flow of charge per unit time in the circuit and has units of Ampères ( 1A = 1 Coulomb per second).
To see how one uses this equation we will look at the calculation of the magnetic dipole field along the axis of a current loop.

Figure 5. The construction for calculating the axial dipole field.
We place the origin at the centre of the loop and let r - r' = R for simplicity, figure 5. The field contribution from dl' is perpendicular to R and faces radially outwards from the axis for the current circulation shown. This means that if we sum up all elements dl', the field component perpendicular to the axis must, by symmetry, be zero. The field will only add up along the axis. The axial contribution, dBaxis, from our element is
(8),
where we omit vector notation for the moment. Summing up all elements, we see that all the quantities are independent of dl', so we get
(9).
The total length of the current loop is of course 2πa, and expressing R and sinα in terms of a and r we get the magnetic field along the dipole axis.
(10),
where the unit vector is shown on the figure and can be determined by the right hand screw rule.
When r2>>a2 we can approximate the denominator, as we have done previously, to get
(11),
where m is the magnetic dipole moment, in analogy with the electrostatic case, and is equal to Iπa2n, i.e. the magnitude of the dipole moment is given by the area circumscribed by the loop times the current.
Using similar methods it is possible to show that the magnitude of the axially symmetric, tangential field around a straight conductor is given by
(12),
where r is the perpendicular distance measured from the conductor.
5 Torque on a Magnetic Dipole - Precessional Motion
We have calculated the torque on an electrostatic dipole due to an electric field, so let's now calculate the torque on a magnetic dipole due to an external magnetic field.
To simplify the problem (but without losing generality) we will model the dipole as a current circulating around a square path rather than a circular one, figure 6.

Figure 6. The torque on the magnetic dipole. The subscripts on the force vector refer to the number of each edge.
The dipole is placed in a uniform field so that edges 2 and 4 are perpendicular to the field lines and 1 and 3 are oriented at an angle φ (not shown on figure). The positive charge q, circulating around the square with speed v will experience a Lorentz force of magnitude Bqv on edges 2 and 4 and Bqvsinφ on 1 and 3. The direction of the force on edges 1 and 3 is equal and opposite and produces no torque. The direction of the forces on edges 2 and 4 are also equal and opposite, but here there is a torque given by
(13),
where l is the length of each edge and Τ is the total torque on the dipole. Now the current, I, circulating around the dipole (units of charge per unit time) is equal to qv/l. Hence we can re cast the expression for the total torque
(14).
Now Il2 is the current times the area circumscribed by the circulating current and in analogy with the electrostatic dipole moment this is called the magnetic dipole moment m. The dipole moment vector is perpendicular to the plane defined by the circulating current and its direction is given by the right hand screw rule. The vectorial version of (14) is therefore
(15).
We now go on to consider what happens to a molecule, which has both angular momentum, i.e. the molecule is rotating, and a magnetic moment, i.e. circulating electrons. L and m need not be pointing in the same direction, so we will consider two cases; L and m mutually perpendicular to each other and B, figure 7, and L and m parallel, but perpendicular to B, figure 8.

Figure 7. In this example the applied torque (m x B) is in the same direction as L and hence the change in angular momentum in the time dt is (m x B) dt.
In figure 7 we can see that the torque resulting from the interaction between the dipole and magnetic field increases the magnitude of the angular momentum, but does not change its direction. (If the magnetic field were to point in the opposite direction it would of course reduce the angular momentum.)

Figure 8. In this case the torque is perpendicular to L and the molecule is made to precess.
When L, m are parallel but perpendicular to B something rather unexpected happens. Now the torque is at right angles to L and since T = dL/dt it is clear that the change in L after a short interval dt is Tdt. This is a vector pointing perpendicular to L in this case and therefore does not change the magnitude of L but does change its direction. In other words, since L and m are fixed in relation to the molecule, the molecule turns around in a circle (much more slowly than the spinning along L) perpendicular to B. This motion is called precession.
The precession of spinning molecules which have magnetic moment when they are placed in a magnetic field is a general phenomenon. The rate of the precession depends on the neighbouring chemical environment and can be probed electromagnetically. You will use this effect every time you examine a compound using nuclear magnetic resonance.