calculate magnetic field