Helmholtz coils can be used to cancel the Earth's magnetic field over a region of space by generating a uniform magnetic field of equal magnitude but opposite direction. For square coils, the easiest way to calculate the magnetic field

is first to calculate the vector potential

due to each coil and then to take the curl of

in Cartesian coordinates. The region over which the field is uniform is determined from the plots of

versus

and

versus

. The magnetic field lines in the

plane are given by the contours of the scalar function

, since

.