Numerical Computation of Electric and Magnetic Fields