Distance between parallel lines

Two railway tracks never meet, yet a train inspector can still ask a precise question: how far apart are they, measured straight across? In three-dimensional vector geometry that question has a clean answer whenever the two lines are parallel — pointing in exactly the same (or opposite) direction. This article covers the dedicated formula for that constant perpendicular separation, distinct from the scalar-triple-product formula used for skew lines that cross direction without meeting. It is the parallel-line special case inside the shortest-distance topic of the Three-Dimensional Geometry chapter of CBSE Class 12 Mathematics, and it leans directly on the cross product from Vector Algebra: recognise proportional direction ratios, then reach for this formula instead of the skew-line one.

The core insight

For two parallel lines sharing direction vector b⃗\vec b, the constant distance between them is d=∣AB⃗×b⃗∣b⃗∣∣d = \left|\dfrac{\vec{AB}\times\vec b}{|\vec b|}\right|, where AB⃗\vec{AB} joins any point AA on the first line to any point BB on the second.

The core idea

Write the two parallel lines in vector form, both using the same direction vector b⃗\vec b (the lines are parallel exactly when their direction ratios are proportional, so we can always scale to one common b⃗\vec b), through fixed points with position vectors a1⃗\vec{a_1} and a2⃗\vec{a_2}:

r⃗=a1⃗+λb⃗andr⃗=a2⃗+μb⃗\vec r = \vec{a_1}+\lambda\vec b \qquad\text{and}\qquad \vec r=\vec{a_2}+\mu\vec b

where: λ,μ\lambda,\mu are scalar parameters that trace out each line, and a1⃗,a2⃗\vec{a_1},\vec{a_2} pin down one specific point on each line. Because both lines share b⃗\vec b, the general skew-line formula — which divides by ∣b1⃗×b2⃗∣|\vec{b_1}\times\vec{b_2}| — breaks down here, since b⃗×b⃗=0⃗\vec b\times\vec b=\vec 0. Parallel lines need their own formula, built from the vector AB⃗=a2⃗−a1⃗\vec{AB}=\vec{a_2}-\vec{a_1} joining one point on each line:

d=∣AB⃗×b⃗∣b⃗∣∣d=\left|\frac{\vec{AB}\times\vec b}{|\vec b|}\right|

where: AB⃗\vec{AB} is the join of any convenient point AA on line 1 to any convenient point BB on line 2, and ∣b⃗∣|\vec b| is the length of the shared direction vector. Only the component of AB⃗\vec{AB} perpendicular to b⃗\vec b actually separates the lines — the component along b⃗\vec b just slides a point further down its own line without moving it away from the other line. The cross product magnitude ∣AB⃗×b⃗∣=∣AB⃗∣∣b⃗∣sin⁡θ|\vec{AB}\times\vec b|=|\vec{AB}||\vec b|\sin\theta already isolates that perpendicular piece (∣AB⃗∣sin⁡θ|\vec{AB}|\sin\theta is exactly the perpendicular component), and dividing by ∣b⃗∣|\vec b| strips off the leftover factor. This distance does not depend on which points AA and BB you chose. Parallel lines have infinitely many common perpendiculars — one through every point of either line — and they are all the same length, unlike skew lines, which have exactly one shortest-distance segment and larger separations everywhere else. That uniformity is what makes "the distance between two parallel lines" a well-defined single number rather than a minimum over many candidates.

Figure
Two parallel lines with a joining vector AB and the perpendicular distance d marked between them
Parallel lines share direction b; d is the constant perpendicular gap A B AB d direction b direction b Every common perpendicular between the two lines has the same length d
Derivation ADistance between two parallel lines

The goal is to show, starting only from the vector equations of two parallel lines and the geometric meaning of the cross product, that the formula d=∣AB⃗×b⃗∣b⃗∣∣d=\left|\dfrac{\vec{AB}\times\vec b}{|\vec b|}\right| correctly gives the constant perpendicular separation between them, no matter which points on the two lines are used to build AB⃗\vec{AB}, and to see exactly why the ordinary skew-line formula cannot be reused in this parallel case.

Step 1. Set up the two lines with a common direction vector. Since the lines are parallel, their direction ratios are proportional, so scale one of them until both share the same b⃗\vec b: r⃗=a1⃗+λb⃗\vec r=\vec{a_1}+\lambda\vec b and r⃗=a2⃗+μb⃗\vec r=\vec{a_2}+\mu\vec b. Take a fixed point AA on line 1 (position vector a1⃗\vec{a_1}) and a fixed point BB on line 2 (position vector a2⃗\vec{a_2}), and form AB⃗=a2⃗−a1⃗\vec{AB}=\vec{a_2}-\vec{a_1}.

Step 2. Resolve AB⃗\vec{AB} into a component along b⃗\vec b and a component perpendicular to b⃗\vec b. If θ\theta is the angle between AB⃗\vec{AB} and b⃗\vec b, the perpendicular component has length ∣AB⃗∣sin⁡θ|\vec{AB}|\sin\theta. Only this perpendicular piece measures how far apart the two lines truly are — the component along b⃗\vec b merely relocates you to a different point on the same line, without changing the gap to the other line.

Step 3. Bring in the cross product. By definition, ∣AB⃗×b⃗∣=∣AB⃗∣∣b⃗∣sin⁡θ|\vec{AB}\times\vec b| = |\vec{AB}||\vec b|\sin\theta, which is exactly ∣b⃗∣|\vec b| times the perpendicular component found in Step 2. So the cross product already contains the perpendicular distance, but scaled up by the extra factor ∣b⃗∣|\vec b|.

Step 4. Divide out the extra factor to isolate the true distance: d=∣AB⃗×b⃗∣∣b⃗∣=∣AB⃗×b⃗∣b⃗∣∣d=\dfrac{|\vec{AB}\times\vec b|}{|\vec b|} = \left|\dfrac{\vec{AB}\times\vec b}{|\vec b|}\right|. This is the perpendicular distance between the two lines, and Step 2 shows it depends only on the perpendicular component of AB⃗\vec{AB} — never on how far along b⃗\vec b the points AA and BB happened to sit — so any choice of AA on line 1 and BB on line 2 gives the same value of dd.

Step 5. Contrast with the skew case. The general shortest-distance formula for two lines with directions b1⃗\vec{b_1} and b2⃗\vec{b_2} divides by ∣b1⃗×b2⃗∣|\vec{b_1}\times\vec{b_2}|. Parallel lines force b1⃗×b2⃗=0⃗\vec{b_1}\times\vec{b_2}=\vec 0 (same or opposite direction, zero angle between them), which would make that formula divide by zero — the derivation above is precisely the fix, replacing the skew formula's cross product of two directions with the cross product of AB⃗\vec{AB} against the single shared direction b⃗\vec b.

Worked example

Problem. Find the distance between the parallel lines r⃗=(ı^+2ȷ^+4k^)+λ(2ı^+3ȷ^+6k^)\vec r=(\hat\imath+2\hat\jmath+4\hat k)+\lambda(2\hat\imath+3\hat\jmath+6\hat k) and r⃗=(3ı^+3ȷ^−5k^)+μ(2ı^+3ȷ^+6k^)\vec r=(3\hat\imath+3\hat\jmath-5\hat k)+\mu(2\hat\imath+3\hat\jmath+6\hat k).

Step 1. Confirm the lines are parallel: both use the same direction vector b⃗=2ı^+3ȷ^+6k^\vec b=2\hat\imath+3\hat\jmath+6\hat k, so the parallel-lines formula applies directly.

Step 2. Compute AB⃗=a2⃗−a1⃗=(3−1)ı^+(3−2)ȷ^+(−5−4)k^=2ı^+ȷ^−9k^\vec{AB}=\vec{a_2}-\vec{a_1}=(3-1)\hat\imath+(3-2)\hat\jmath+(-5-4)\hat k=2\hat\imath+\hat\jmath-9\hat k.

Step 3. Compute the cross product AB⃗×b⃗\vec{AB}\times\vec b:

∣ı^ȷ^k^21−9236∣=ı^[(1)(6)−(−9)(3)]−ȷ^[(2)(6)−(−9)(2)]+k^[(2)(3)−(1)(2)]\begin{vmatrix}\hat\imath&\hat\jmath&\hat k\\2&1&-9\\2&3&6\end{vmatrix}=\hat\imath[(1)(6)-(-9)(3)]-\hat\jmath[(2)(6)-(-9)(2)]+\hat k[(2)(3)-(1)(2)]
=ı^(6+27)−ȷ^(12+18)+k^(6−2)=33ı^−30ȷ^+4k^=\hat\imath(6+27)-\hat\jmath(12+18)+\hat k(6-2)=33\hat\imath-30\hat\jmath+4\hat k

Step 4. Take magnitudes: ∣AB⃗×b⃗∣=332+(−30)2+42=1089+900+16=2005|\vec{AB}\times\vec b|=\sqrt{33^2+(-30)^2+4^2}=\sqrt{1089+900+16}=\sqrt{2005}, and ∣b⃗∣=22+32+62=49=7|\vec b|=\sqrt{2^2+3^2+6^2}=\sqrt{49}=7.

Step 5. Apply the formula: d=20057d=\dfrac{\sqrt{2005}}{7}. The distance between the two lines is d=20057d=\dfrac{\sqrt{2005}}{7} units.

Competitive stretch

For lines given in Cartesian symmetric form, x−12=y+1−1=z3\dfrac{x-1}{2}=\dfrac{y+1}{-1}=\dfrac{z}{3} and x−34=y−2=z−26\dfrac{x-3}{4}=\dfrac{y}{-2}=\dfrac{z-2}{6}, the direction ratios (2,−1,3)(2,-1,3) and (4,−2,6)=2(2,−1,3)(4,-2,6)=2(2,-1,3) are proportional, so the lines are parallel with b⃗=2ı^−ȷ^+3k^\vec b=2\hat\imath-\hat\jmath+3\hat k. Taking A(1,−1,0)A(1,-1,0) and B(3,0,2)B(3,0,2) gives AB⃗=2ı^+ȷ^+2k^\vec{AB}=2\hat\imath+\hat\jmath+2\hat k, whose cross product with b⃗\vec b works out to 5ı^−2ȷ^−4k^5\hat\imath-2\hat\jmath-4\hat k, with magnitude 45=35\sqrt{45}=3\sqrt5; since ∣b⃗∣=14|\vec b|=\sqrt{14}, the distance is d=3514=37014d=\dfrac{3\sqrt5}{\sqrt{14}}=\dfrac{3\sqrt{70}}{14} units after rationalising. The extra work here is reading direction ratios off Cartesian form and simplifying them to a single common b⃗\vec b before applying the same formula.

Common traps

  • Reaching for the skew-line (scalar triple product) formula. Since b1⃗×b2⃗=0⃗\vec{b_1}\times\vec{b_2}=\vec 0 for parallel lines, that formula collapses to 0/00/0 — switch to the dedicated parallel-lines formula the moment proportional direction ratios are spotted.
  • Keeping two separate direction vectors. Once parallelism is confirmed, simplify to one common b⃗\vec b (any convenient scalar multiple) rather than juggling b1⃗\vec{b_1} and b2⃗\vec{b_2} inside the formula.
  • Forgetting to divide by ∣b⃗∣|\vec b|. The raw cross product AB⃗×b⃗\vec{AB}\times\vec b is scaled up by a factor of ∣b⃗∣|\vec b|; omitting the division overstates the distance.
  • Building AB⃗\vec{AB} from the wrong vectors. The formula needs the vector joining an actual point on each line — not a random combination of position vectors and direction vectors from the two equations.

Ask the tutor: Want to try the parallel-lines distance formula on a fresh pair of lines, or need help deciding whether two given lines are parallel, skew, or intersecting?

How do I quickly tell whether two lines are parallel before choosing a formula?

Compare their direction ratios (the coefficients of λ\lambda or μ\mu, or the denominators in Cartesian symmetric form). If one triple is a scalar multiple of the other — like (2,3,6)(2,3,6) and (4,6,12)=2(2,3,6)(4,6,12)=2(2,3,6) — the lines are parallel and you should use d=∣AB⃗×b⃗∣b⃗∣∣d=\left|\dfrac{\vec{AB}\times\vec b}{|\vec b|}\right|. If the ratios are not proportional, check whether the lines intersect; if they neither intersect nor are parallel, they are skew, and you need the scalar-triple-product formula instead.

Does it matter which points I pick for A and B on the two lines?

No. Any point on line 1 and any point on line 2 will give the same distance, because parallel lines have infinitely many common perpendiculars — one through every point of either line — and all of them are equally long. Pick whichever points make the arithmetic simplest, typically the ones already sitting in the given position vectors or Cartesian equations, so you avoid introducing extra parameters.

What is the actual difference between this formula and the shortest-distance formula for skew lines?

Both formulas measure a perpendicular gap using a cross product, but they build the cross product differently. The skew-line formula crosses the two lines' own direction vectors, b1⃗×b2⃗\vec{b_1}\times\vec{b_2}, because skew lines are not parallel and that cross product pins down the unique direction common to both perpendiculars. Parallel lines share one direction, so b1⃗×b2⃗=0⃗\vec{b_1}\times\vec{b_2}=\vec 0 and that approach fails; instead you cross the connecting vector AB⃗\vec{AB} with the single shared direction b⃗\vec b, which isolates the perpendicular component of AB⃗\vec{AB} directly.

Before this