← Back to all lessons
Class 12Geometry9:14Published 5 Dec 2024

3D Geometry: Shortest Distance Between Parallel and Skew Lines

Three worked Class 12 questions on 3D lines: writing the equation of a line through a point in a given direction, and finding the shortest distance between skew lines and between parallel lines.

This lesson works through sure exam questions on three dimensional geometry. It starts by forming the vector and Cartesian equations of a line through a given point and parallel to a given vector. It then sets up two lines, recognises when they are skew and when they are parallel, and applies the matching distance formula to each, computing every cross product and dot product step by step.

What you'll learn

  • How to write the vector and Cartesian equations of a line through a point in a given direction
  • How to tell whether two lines are skew or parallel by comparing their direction vectors
  • How to find the shortest distance between two skew lines
  • How to find the distance between two parallel lines

Lesson chapters

0:00Equation of a line through a point
1:15Setting up the two skew lines
2:55Skew lines: cross product and distance
6:29Distance between two parallel lines

Lesson notes

This lesson works through three sure questions on lines in 3D geometry: forming the equation of a line, and finding the shortest distance between skew lines and between parallel lines.

Equation of a line through a point in a given direction

We want the line parallel to the vector b=2ı^ȷ^+3k^\vec b = 2\hat\imath - \hat\jmath + 3\hat k that passes through the point (5,2,4)(5, -2, 4).

The direction ratios are a=2, b=1, c=3a = 2,\ b = -1,\ c = 3, and the position vector of the given point is

a=5ı^2ȷ^+4k^.\vec a = 5\hat\imath - 2\hat\jmath + 4\hat k.

Vector form. The line is r=a+λb\vec r = \vec a + \lambda\,\vec b, that is

r=(5ı^2ȷ^+4k^)+λ(2ı^ȷ^+3k^).\vec r = (5\hat\imath - 2\hat\jmath + 4\hat k) + \lambda\,(2\hat\imath - \hat\jmath + 3\hat k).

Cartesian form. Using xx1a=yy1b=zz1c\dfrac{x - x_1}{a} = \dfrac{y - y_1}{b} = \dfrac{z - z_1}{c},

x52=y+21=z43.\frac{x - 5}{2} = \frac{y + 2}{-1} = \frac{z - 4}{3}.

Shortest distance between two skew lines

The two lines are given as

r=(1t)ı^+(t2)ȷ^+(32t)k^,\vec r = (1 - t)\hat\imath + (t - 2)\hat\jmath + (3 - 2t)\hat k, r=(s+1)ı^+(2s1)ȷ^(2s+1)k^.\vec r = (s + 1)\hat\imath + (2s - 1)\hat\jmath - (2s + 1)\hat k.

Writing them in r=a+(parameter)b\vec r = \vec a + (\text{parameter})\,\vec b form. Grouping the constant terms and the terms in tt and ss:

r=(ı^2ȷ^+3k^)+t(ı^+ȷ^2k^),\vec r = (\hat\imath - 2\hat\jmath + 3\hat k) + t\,(-\hat\imath + \hat\jmath - 2\hat k), r=(ı^ȷ^k^)+s(ı^+2ȷ^2k^).\vec r = (\hat\imath - \hat\jmath - \hat k) + s\,(\hat\imath + 2\hat\jmath - 2\hat k).

The direction vectors are not parallel, so the lines are skew. We read off

a1=ı^2ȷ^+3k^,b1=ı^+ȷ^2k^,\vec a_1 = \hat\imath - 2\hat\jmath + 3\hat k,\quad \vec b_1 = -\hat\imath + \hat\jmath - 2\hat k, a2=ı^ȷ^k^,b2=ı^+2ȷ^2k^.\vec a_2 = \hat\imath - \hat\jmath - \hat k,\quad \vec b_2 = \hat\imath + 2\hat\jmath - 2\hat k.

The distance formula for skew lines is

d=(b1×b2)(a2a1)b1×b2.d = \frac{\left|(\vec b_1 \times \vec b_2)\cdot(\vec a_2 - \vec a_1)\right|}{\left|\vec b_1 \times \vec b_2\right|}.

Cross product.

b1×b2=ı^ȷ^k^112122=2ı^4ȷ^3k^.\vec b_1 \times \vec b_2 = \begin{vmatrix} \hat\imath & \hat\jmath & \hat k \\ -1 & 1 & -2 \\ 1 & 2 & -2 \end{vmatrix} = 2\hat\imath - 4\hat\jmath - 3\hat k.

So b1×b2=22+(4)2+(3)2=4+16+9=29.\left|\vec b_1 \times \vec b_2\right| = \sqrt{2^2 + (-4)^2 + (-3)^2} = \sqrt{4 + 16 + 9} = \sqrt{29}.

The connecting vector.

a2a1=(ı^ȷ^k^)(ı^2ȷ^+3k^)=0ı^+ȷ^4k^.\vec a_2 - \vec a_1 = (\hat\imath - \hat\jmath - \hat k) - (\hat\imath - 2\hat\jmath + 3\hat k) = 0\hat\imath + \hat\jmath - 4\hat k.

Dot product.

(b1×b2)(a2a1)=(2)(0)+(4)(1)+(3)(4)=04+12=8.(\vec b_1 \times \vec b_2)\cdot(\vec a_2 - \vec a_1) = (2)(0) + (-4)(1) + (-3)(-4) = 0 - 4 + 12 = 8.

Result. Since distance is always positive,

d=829 units.d = \frac{8}{\sqrt{29}}\ \text{units}.

Distance between two parallel lines

The lines are

L1: r=(ı^+2ȷ^4k^)+λ(2ı^+3ȷ^+6k^),L_1:\ \vec r = (\hat\imath + 2\hat\jmath - 4\hat k) + \lambda\,(2\hat\imath + 3\hat\jmath + 6\hat k), L2: r=(3ı^+3ȷ^5k^)+μ(2ı^+3ȷ^+6k^).L_2:\ \vec r = (3\hat\imath + 3\hat\jmath - 5\hat k) + \mu\,(2\hat\imath + 3\hat\jmath + 6\hat k).

Both have the same direction vector, so the lines are parallel. Here

a1=ı^+2ȷ^4k^,a2=3ı^+3ȷ^5k^,b=2ı^+3ȷ^+6k^.\vec a_1 = \hat\imath + 2\hat\jmath - 4\hat k,\quad \vec a_2 = 3\hat\imath + 3\hat\jmath - 5\hat k,\quad \vec b = 2\hat\imath + 3\hat\jmath + 6\hat k.

The distance formula for parallel lines is

d=b×(a2a1)b.d = \frac{\left|\vec b \times (\vec a_2 - \vec a_1)\right|}{\left|\vec b\right|}.

The connecting vector.

a2a1=2ı^+ȷ^k^.\vec a_2 - \vec a_1 = 2\hat\imath + \hat\jmath - \hat k.

Cross product.

b×(a2a1)=ı^ȷ^k^236211=9ı^+14ȷ^4k^.\vec b \times (\vec a_2 - \vec a_1) = \begin{vmatrix} \hat\imath & \hat\jmath & \hat k \\ 2 & 3 & 6 \\ 2 & 1 & -1 \end{vmatrix} = -9\hat\imath + 14\hat\jmath - 4\hat k.

Its magnitude is (9)2+142+(4)2=81+196+16=293.\sqrt{(-9)^2 + 14^2 + (-4)^2} = \sqrt{81 + 196 + 16} = \sqrt{293}.

Also b=22+32+62=4+9+36=49=7.\left|\vec b\right| = \sqrt{2^2 + 3^2 + 6^2} = \sqrt{4 + 9 + 36} = \sqrt{49} = 7.

Result.

d=2937 units.d = \frac{\sqrt{293}}{7}\ \text{units}.

Key takeaways

  • A line through a point with position vector a\vec a and direction b\vec b is r=a+λb\vec r = \vec a + \lambda\,\vec b, with Cartesian form xx1a=yy1b=zz1c\dfrac{x - x_1}{a} = \dfrac{y - y_1}{b} = \dfrac{z - z_1}{c}.
  • Two lines are parallel when their direction vectors are proportional; otherwise (and when they do not meet) they are skew.
  • For skew lines, d=(b1×b2)(a2a1)b1×b2d = \dfrac{\left|(\vec b_1 \times \vec b_2)\cdot(\vec a_2 - \vec a_1)\right|}{\left|\vec b_1 \times \vec b_2\right|}; for parallel lines, d=b×(a2a1)bd = \dfrac{\left|\vec b \times (\vec a_2 - \vec a_1)\right|}{\left|\vec b\right|}.