class plasmapy.formulary.magnetostatics.InfiniteStraightWire(direction, p0: Quantity, current: Quantity)[source]

Bases: Wire

Infinite straight wire class.

  • direction – Three-dimensional direction vector of the wire, also the positive current direction.

  • p0 (Quantity) – One point on the wire.

  • current (Quantity) – Electric current.

Methods Summary


Calculate magnetic field generated by this wire at position p.

Methods Documentation

magnetic_field(p) Quantity[source]

Calculate magnetic field generated by this wire at position p.


p (astropy.units.Quantity) – Three-dimensional position vector.


B – Magnetic field at the specified position.

Return type:



The magnetic field generated by a straight wire with infinite length and constant electric current is found at a point in 3D space using the Biot–Savart law.

Let the point where the magnetic field will be calculated be represented by the point \(p\), a point on the wire by \(p_0\), and the direction of the wire as the vector \(\vec{l}\). The magnetic field \(\vec{B}\) generated by the wire with constant current \(I\) at point \(p\) is then expressed using the Biot–Savart law which takes the form

\[\vec{B} = \frac{\mu_0 I}{2\pi |\vec{r}|} \hat{B}\]

where \(\mu_0\) is the permeability of free space, \(|\vec{r}| = |\vec{l} \times (\vec{p} - \vec{p}_0)|\) is the perpendicular distance between the wire and the point \(p\), and

\[\hat{B} = \frac{\vec{l} \times (\vec{p} - \vec{p}_0)} {|\vec{l} \times (\vec{p} - \vec{p}_0)|}\]

is the unit vector in the direction of the magnetic field at point \(p\).