Complex Representation and Computation of Two‐Dimensional Magnetic Fields