This Demonstration computes the magnetic field produced by a pair of square Helmholtz coils. The results are much more straightforward than those for the more conventional circular Helmholtz coils, which involve elliptic integrals. You can adjust the field at the center of the coils so that over a small region of space it cancels the Earth's magnetic field (which ranges from about 0.3 gauss to 0.6 gauss).
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 .