information:highlighting
Magnetic field due to moving charges and electric currents

A slightly more general way of relating the current I {\displaystyle I} to the B -field is through Ampère's law: ∮ B ⋅ d ℓ = μ 0 I e n c, {\displaystyle \oint \mathbf {B} \cdot \mathrm {d} {\boldsymbol {\ell }}=\mu _{0}I_{\mathrm {enc} },} where the line integral is over any arbitrary loop and I enc {\displaystyle I_{\text{enc}}} is the current enclosed by that loop. Ampère's law is always valid for steady currents and can be used to calculate the B -field for certain highly symmetric situations such as an infinite wire or an infinite solenoid.