The Biot-Savart Law relates magnetic fields to the current which are their sources. Every single electron causes magnetic field, around the wire. Finding the magnetic field resulting from current distribution involves the vector product, and is inherently a calculus problem when the distance from the current to the field point is continuously changing.
where
dB – elementary magnetic field is caused by dL
I – current thru wire
dL – elementary length of wire,
1r – radius vector
r – radius to point