Consider an infinitely long straight wire carrying a current I. The magnetic field at point P at a distance a from the origin can be calculated using the Biot-Savart law.
Consider a current element dx at a distance x from the origin. The current element makes an angle θ with the line joining dx and P. Using the Pythagorus theorum to express the distance between the current element and the point, the magnetic field due to the current element at point P can be estimated using Equation 1.
The wire is symmetrical about the origin. Hence, integrating Equation 1 within the limits of zero to infinity gives the equation for the magnetic field in terms of the current and the distance of point P from the wire.
The magnetic field lines of the infinite wire are circular and centered at the wire, and they are identical at every plane perpendicular to the wire. Since the intensity of the field decreases with the distance from the wire, the spacing of the field lines also increases correspondingly with distance.
The right-hand rule gives the direction of magnetic field lines. If the thumb points along the current, the fingers wrap around the wire in the same way as the magnetic field. Therefore, the field points into the page at point P. The magnetic fields due to all the current elements have the same direction.