Magnetostatic fields originate from steady currents like direct currents in wires. Most equations for electric fields can also describe magnetic fields by substituting analogous quantities. According to Biot-Savart's law, the magnetic field produced by a current element is proportional to the current and inversely proportional to the distance squared. Ampere's circuital law relates the line integral of magnetic field around a closed loop to the current passing through the enclosed surface. Forces can act on moving charges and on current-carrying wires placed in magnetic fields.