The distance vector from point to point is the vector you’d add to to land at :
where and are the position vectors of and . Its magnitude is the distance between the two points:
The direction is “from to .” Reversing the order flips the sign: .
In cylindrical coordinates
For and , the distance between them is
This is the 3D law of cosines: gives the squared horizontal separation, and adds the vertical separation in quadrature.
In spherical coordinates
For and :
The bracket is , where is the angle subtended at the origin between the two position vectors — the spherical law of cosines.
Why it matters in electromagnetics
The distance vector from a source charge to an observation point is the natural variable in Coulomb’s law, the Biot-Savart law, and the integral expressions for field due to distributed sources:
The integrand walks the source point through the source region while stays fixed; the distance vector aims from each source bit to the observation point.