The Biot–Savart Law
Turn the test point and see the size of dB
Turning the test point with the slider around the gold current element flowing upward changes the length of the small magnetic-field arrow on the test point. Above and below, in line with the current, the arrow vanishes, and it is longest at the side, perpendicular to the current. The arrow always points out of the plane formed by the current and the test point, in the same direction as the faint ring that wraps around the current.
A magnetic field comes from current
Charges at rest make an electric field (EM-03). When charges move, that is, when current flows, another field appears around them: the magnetic field. Put a compass needle beside a wire, and the needle turns only while current flows. The magnetic field comes not from the amount of charge but from the flow of charge. The magnetism of a magnet also comes from electrons in atoms, whose sources are the electrons' orbital motion together with the spin that electrons carry by nature.
Biot–Savart, the tiny field
Cutting the path of a current into short pieces gives current elements I dl. The Biot-Savart law gives the small magnetic field that one such piece makes at a point a distance r away. dB = (μ₀/4π) I dl × r̂ / r². Its magnitude is inversely proportional to the square of the distance and proportional to sinθ, where θ is the angle between the current direction and the direction toward the point. Its direction is perpendicular to both the current direction and the direction toward the point, set by the right-hand rule. The constant μ₀ is the permeability of free space.
The field circles the current
The electric field ran straight out from a charge in every direction, but the magnetic field is different. Because of the cross product dl × r̂, dB wraps around the current as its axis. Above and below, in line with the current (θ=0), sinθ=0 so dB is 0, and it is strongest at the side, perpendicular to the current (θ=90°). That is why the magnetic field around a straight current draws concentric circles. Point your right thumb along the current, and your other four fingers show the direction the field circles.
The whole field = an integral
Once you know the dB of one piece, you add the dB of every piece as vectors along the whole path of the current to get the total magnetic field. B = ∫ dB. This is exactly the same structure as integrating a point charge's dE over a charge distribution in EM-04. For an infinitely long straight current, this integral works out neatly to B = μ₀I/(2πr), so the field is inversely proportional to distance: even though one piece falls off as the square of the distance, adding up an endless current lowers the power by one. With good symmetry, Ampère's law in the next unit lets you skip even this integral.
Back to the first screen
On the first screen, moving the test point above or below, in line with the current, made dB vanish to 0, and moving it to the side, perpendicular to the current, made it largest. Its size followed sinθ. And dB always pointed out of the plane of the current and the test point, wrapping around the current, as a result of the cross product dl × r̂. Adding up the dB of each piece along the current's path gives the total magnetic field B.
The Biot-Savart integral works for any shape of current but takes a lot of work. With good symmetry there is a shortcut: Ampère's law (EM-14), which says that the field added up around a closed loop, ∮B·dl, is directly proportional to the current passing through the loop. Just as Gauss's law did in electrostatics, it gives the fields of straight wires, solenoids, and toroids without integrating.