Non Uniform Magnetic Field Formula