Class 12 Maths, Worked in Full Past papersGet updates
Chapter 11 · Three Dimensional Geometry

Example 9: Shortest distance between two skew lines in vector form

ExamplesShortest distance between skew lines · Section 11.5.1
The question

Find the shortest distance between the lines l1l_1 and l2l_2 whose vector equations are

r⃗=i^+j^+λ(2i^−j^+k^)…(1)\begin{aligned} \vec r = {}&\hat i + \hat j \\ &+ \lambda(2\hat i - \hat j + \hat k) \quad\ldots(1) \end{aligned}

and

r⃗=2i^+j^−k^+μ(3i^−5j^+2k^)…(2)\begin{aligned} \vec r = {}&2\hat i + \hat j - \hat k \\ &+ \mu(3\hat i - 5\hat j + 2\hat k) \quad\ldots(2) \end{aligned}
Exam answer

Comparing (1) and (2) with r⃗=a⃗1+λb⃗1\vec r = \vec a_1 + \lambda\vec b_1 and r⃗=a⃗2+μb⃗2\vec r = \vec a_2 + \mu\vec b_2⁠:

a⃗1=i^+j^\vec a_1 = \hat i + \hat j⁠, b⃗1=2i^−j^+k^\vec b_1 = 2\hat i - \hat j + \hat k

a⃗2=2i^+j^−k^\vec a_2 = 2\hat i + \hat j - \hat k⁠, b⃗2=3i^−5j^+2k^\vec b_2 = 3\hat i - 5\hat j + 2\hat k

a⃗2−a⃗1=i^−k^\vec a_2 - \vec a_1 = \hat i - \hat k b⃗1×b⃗2=∣i^j^k^2−113−52∣=(−2+5)i^−(4−3)j^+(−10+3)k^=3i^−j^−7k^\begin{aligned} \vec b_1\times\vec b_2 &= \begin{vmatrix} \hat i & \hat j & \hat k \\ 2 & -1 & 1 \\ 3 & -5 & 2 \end{vmatrix} \\ &= (-2 + 5)\hat i - (4 - 3)\hat j \\ &\quad + (-10 + 3)\hat k \\ &= 3\hat i - \hat j - 7\hat k \end{aligned} ∣b⃗1×b⃗2∣=9+1+49=59|\vec b_1\times\vec b_2| = \sqrt{9 + 1 + 49} = \sqrt{59} (b⃗1×b⃗2)⋅(a⃗2−a⃗1)=3(1)+(−1)(0)+(−7)(−1)=3−0+7=10\begin{aligned} &(\vec b_1\times\vec b_2)\cdot(\vec a_2 - \vec a_1) \\ &= 3(1) + (-1)(0) + (-7)(-1) \\ &= 3 - 0 + 7 = 10 \end{aligned}

The shortest distance is

d=∣(b⃗1×b⃗2)⋅(a⃗2−a⃗1)∣b⃗1×b⃗2∣∣=∣1059∣\begin{aligned} d &= \left|\frac{(\vec b_1\times\vec b_2)\cdot(\vec a_2 - \vec a_1)}{|\vec b_1\times\vec b_2|}\right| \\ &= \left|\frac{10}{\sqrt{59}}\right| \end{aligned}

∴\therefore The shortest distance is 1059\dfrac{10}{\sqrt{59}} units.

Want the reason behind every step, the basics and the checks?

The one idea this problem is built on

The shortest segment between two skew lines is perpendicular to both lines, so it points along b⃗1×b⃗2\vec b_1\times\vec b_2⁠. Join any point of l1l_1 to any point of l2l_2 (we use a⃗1\vec a_1 and a⃗2\vec a_2⁠); the shadow of this joining vector on the direction b⃗1×b⃗2\vec b_1\times\vec b_2 is the shortest distance, whichever two points we chose.

Given, to find, and the plan
Given
l1l_1⁠: r⃗=i^+j^+λ(2i^−j^+k^)\vec r = \hat i + \hat j + \lambda(2\hat i - \hat j + \hat k)⁠; l2l_2⁠: r⃗=2i^+j^−k^\vec r = 2\hat i + \hat j - \hat k + μ(3i^−5j^+2k^)+\ \mu(3\hat i - 5\hat j + 2\hat k)⁠.
To find
The shortest distance dd between l1l_1 and l2l_2⁠.
Plan
(1) Read off a⃗1,b⃗1,a⃗2,b⃗2\vec a_1, \vec b_1, \vec a_2, \vec b_2⁠. (2) Find a⃗2−a⃗1\vec a_2 - \vec a_1⁠. (3) Find b⃗1×b⃗2\vec b_1\times\vec b_2⁠. (4) Find its length. (5) Find the dot product. (6) Put everything into the formula. (7) Check by finding the closest points themselves.

Basics you need

1Shortest distance between skew lines

For r⃗=a⃗1+λb⃗1\vec r = \vec a_1 + \lambda\vec b_1 and r⃗=a⃗2+μb⃗2\vec r = \vec a_2 + \mu\vec b_2 (Section 11.5.1):

d=∣(b⃗1×b⃗2)⋅(a⃗2−a⃗1)∣b⃗1×b⃗2∣∣.d = \left|\frac{(\vec b_1\times\vec b_2)\cdot(\vec a_2 - \vec a_1)}{|\vec b_1\times\vec b_2|}\right|.

Lesson: project onto the common perpendicular

2The cross product

b⃗1×b⃗2\vec b_1\times\vec b_2 is perpendicular to both b⃗1\vec b_1 and b⃗2\vec b_2⁠; it is computed as a determinant with i^,j^,k^\hat i, \hat j, \hat k in the top row (Section 10.6.3). Basics: the cross product

3Projection

The projection of v⃗\vec v on the direction of n⃗\vec n has length ∣v⃗⋅n⃗∣∣n⃗∣\frac{|\vec v\cdot\vec n|}{|\vec n|} (Section 10.6.2). Basics: the shadow on the gap direction

4Skew lines

Lines in space that are neither parallel nor intersecting (Section 11.5). Lesson: skew lines

Solution

  1. Read off the points and directions

    a⃗1=i^+j^,b⃗1=2i^−j^+k^,a⃗2=2i^+j^−k^,b⃗2=3i^−5j^+2k^.\begin{aligned} \vec a_1 &= \hat i + \hat j, & \vec b_1 &= 2\hat i - \hat j + \hat k, \\ \vec a_2 &= 2\hat i + \hat j - \hat k, & \vec b_2 &= 3\hat i - 5\hat j + 2\hat k. \end{aligned}
    Compare (1) with r⃗=a⃗1+λb⃗1\vec r = \vec a_1 + \lambda\vec b_1 and (2) with r⃗=a⃗2+μb⃗2\vec r = \vec a_2 + \mu\vec b_2⁠: the vector multiplied by the parameter is the direction, the rest is a point. So l1l_1 passes through S(1,1,0)S(1, 1, 0) (there is no k^\hat k term, so its zz-coordinate is 0) and l2l_2 through T(2,1,−1)T(2, 1, -1)⁠.
    Vector equation of a line, Section 11.3.1. Basics: a⃗ + λb⃗
  2. The joining vector a⃗2−a⃗1\vec a_2 - \vec a_1

    a⃗2−a⃗1=(2−1)i^+(1−1)j^+(−1−0)k^=i^−k^.\begin{aligned} \vec a_2 - \vec a_1 &= (2 - 1)\hat i + (1 - 1)\hat j \\ &\quad + (-1 - 0)\hat k \\ &= \hat i - \hat k. \end{aligned}
    This is ST→\overrightarrow{ST}⁠, from the point SS of l1l_1 to the point TT of l2l_2⁠. Its j^\hat j component is 0, which we must remember when taking the dot product later.
    Vector joining two points: terminal minus initial (Section 10.5.2). Basics: points in space
  3. The cross product b⃗1×b⃗2\vec b_1\times\vec b_2

    b⃗1×b⃗2=∣i^j^k^2−113−52∣=((−1)(2)−(1)(−5))i^−((2)(2)−(1)(3))j^+((2)(−5)−(−1)(3))k^=3i^−j^−7k^.\begin{aligned} \vec b_1\times\vec b_2 &= \begin{vmatrix} \hat i & \hat j & \hat k \\ 2 & -1 & 1 \\ 3 & -5 & 2 \end{vmatrix} \\ &= \big((-1)(2) - (1)(-5)\big)\hat i \\ &\quad - \big((2)(2) - (1)(3)\big)\hat j \\ &\quad + \big((2)(-5) - (-1)(3)\big)\hat k \\ &= 3\hat i - \hat j - 7\hat k. \end{aligned}
    Expand along the top row; the j^\hat j term carries a minus sign. The result is perpendicular to both directions: (3)(2)+(−1)(−1)+(−7)(1)=0(3)(2) + (-1)(-1) + (-7)(1) = 0 and (3)(3)+(−1)(−5)+(−7)(2)=0(3)(3) + (-1)(-5) + (-7)(2) = 0⁠. So it points along the common perpendicular of the two lines. It is not the zero vector, so the lines are not parallel.
    Determinant form of the cross product (Section 10.6.3). Basics: a⃗ × b⃗ stands up from both
  4. Its length

    ∣b⃗1×b⃗2∣=32+(−1)2+(−7)2=9+1+49=59.\begin{aligned} |\vec b_1\times\vec b_2| &= \sqrt{3^2 + (-1)^2 + (-7)^2} \\ &= \sqrt{9 + 1 + 49} = \sqrt{59}. \end{aligned}
    We divide by this length so that only the direction of b⃗1×b⃗2\vec b_1\times\vec b_2 counts: b⃗1×b⃗2∣b⃗1×b⃗2∣\frac{\vec b_1\times\vec b_2}{|\vec b_1\times\vec b_2|} is the unit vector n^\hat n of equation (3) in Section 11.5.1.
    Length of a vector. Basics: Pythagoras in 3D
  5. The dot product

    (b⃗1×b⃗2)⋅(a⃗2−a⃗1)=(3)(1)+(−1)(0)+(−7)(−1)=3−0+7=10.\begin{aligned} &(\vec b_1\times\vec b_2)\cdot(\vec a_2 - \vec a_1) \\ &= (3)(1) + (-1)(0) + (-7)(-1) \\ &= 3 - 0 + 7 = 10. \end{aligned}
    Multiply matching components of 3i^−j^−7k^3\hat i - \hat j - 7\hat k and i^+0j^−k^\hat i + 0\hat j - \hat k and add. The last product is (−7)(−1)=+7(-7)(-1) = +7⁠: two negatives give a positive.
    a⃗⋅b⃗=a1b1+a2b2+a3b3\vec a\cdot\vec b = a_1b_1 + a_2b_2 + a_3b_3⁠. Basics: the dot product
  6. Put it into the formula

    d=∣(b⃗1×b⃗2)⋅(a⃗2−a⃗1)∣b⃗1×b⃗2∣∣=∣1059∣=1059.\begin{aligned} d &= \left|\frac{(\vec b_1\times\vec b_2)\cdot(\vec a_2 - \vec a_1)}{|\vec b_1\times\vec b_2|}\right| \\ &= \left|\frac{10}{\sqrt{59}}\right| = \frac{10}{\sqrt{59}}. \end{aligned}
    This is the length of the projection of ST→\overrightarrow{ST} on the unit vector n^\hat n along the common perpendicular: d=ST ∣cos⁡θ∣d = ST\,|\cos\theta|⁠, where θ\theta is the angle between ST→\overrightarrow{ST} and n^\hat n⁠. The modulus makes the distance positive whichever way n^\hat n points. One misprint to watch: the final formula for dd on page 387 of the book (set in bold) prints (a⃗2×a⃗1)(\vec a_2 \times \vec a_1) where (a⃗2−a⃗1)(\vec a_2 - \vec a_1) is meant; the derivation just before it, and this example, both use the difference.
    Section 11.5.1, shortest distance between skew lines. Lesson: the shortest distance
  7. Check: find the closest points

    Let P=a⃗1+λb⃗1P = \vec a_1 + \lambda\vec b_1 on l1l_1 and Q=a⃗2+μb⃗2Q = \vec a_2 + \mu\vec b_2 on l2l_2⁠. The segment PQPQ is shortest when it is perpendicular to both lines:

    PQ→⋅b⃗1=0,PQ→⋅b⃗2=0.\overrightarrow{PQ}\cdot\vec b_1 = 0, \qquad \overrightarrow{PQ}\cdot\vec b_2 = 0.

    Here PQ→=(a⃗2−a⃗1)+μb⃗2−λb⃗1\overrightarrow{PQ} = (\vec a_2 - \vec a_1) + \mu\vec b_2 - \lambda\vec b_1⁠, that is

    PQ→=(1+3μ−2λ)i^+(λ−5μ)j^+(−1+2μ−λ)k^,\begin{aligned} \overrightarrow{PQ} &= (1 + 3\mu - 2\lambda)\hat i + (\lambda - 5\mu)\hat j \\ &\quad + (-1 + 2\mu - \lambda)\hat k, \end{aligned}

    and the two conditions become

    1+13μ−6λ=0,1+38μ−13λ=0,\begin{aligned} 1 + 13\mu - 6\lambda &= 0, \\ 1 + 38\mu - 13\lambda &= 0, \end{aligned}

    so λ=2559\lambda = \frac{25}{59} and μ=759\mu = \frac{7}{59}⁠. Then

    PQ→=1059(3i^−j^−7k^),PQ=105959=1059.\begin{aligned} \overrightarrow{PQ} &= \frac{10}{59}(3\hat i - \hat j - 7\hat k), \\ PQ &= \frac{10}{59}\sqrt{59} = \frac{10}{\sqrt{59}}. \end{aligned}
    S(1, 1, 0) T(2, 1, −1) P Q l₁ l₂ d = 10/√59
    Oblique projection, not to scale (lengths and right angles are not shown true). l1l_1 passes through S(1,1,0)S(1, 1, 0) and l2l_2 through T(2,1,−1)T(2, 1, -1)⁠. The common perpendicular PQPQ has length 1059\frac{10}{\sqrt{59}}⁠; STST (dashed) is longer, 2\sqrt2⁠.
    This works the problem from scratch, without the formula, and gets the same distance. PQ→\overrightarrow{PQ} comes out as a multiple of b⃗1×b⃗2\vec b_1\times\vec b_2⁠, as the formula assumes. Since d≠0d \ne 0⁠, the lines do not meet, and Step 3 showed they are not parallel, so they are skew. The given points are not the closest ones: ST=∣i^−k^∣=2>1059ST = |\hat i - \hat k| = \sqrt2 > \frac{10}{\sqrt{59}}⁠.
    The line of shortest distance is perpendicular to both lines (Section 11.5). Lesson: skew lines
Result

The shortest distance between l1l_1 and l2l_2 is 1059\frac{10}{\sqrt{59}} units (=105959)\left(= \frac{10\sqrt{59}}{59}\right)⁠. The lines are skew.

(Textbook answer: 1059\frac{10}{\sqrt{59}}⁠.)

Check it with numbers

59≈7.681146\sqrt{59} \approx 7.681146⁠, so d≈1.301889d \approx 1.301889⁠. The closest points are P(10959,3459,2559)P\left(\frac{109}{59}, \frac{34}{59}, \frac{25}{59}\right)⁠, about (1.847458, 0.576271, 0.423729)(1.847458,\ 0.576271,\ 0.423729)⁠, and Q(13959,2459,−4559)Q\left(\frac{139}{59}, \frac{24}{59}, -\frac{45}{59}\right)⁠, about (2.355932, 0.406780, −0.762712)(2.355932,\ 0.406780,\ -0.762712)⁠; the distance between them is 1.3018891.301889 again. For comparison, ST=2≈1.414214ST = \sqrt2 \approx 1.414214⁠.

Common mistakes
  1. The sign of the j^\hat j term. In the determinant the middle term is −((2)(2)−(1)(3))j^=−j^-\big((2)(2) - (1)(3)\big)\hat j = -\hat j⁠; forgetting the minus gives +j^+\hat j and the wrong dot product.
  2. Using a⃗2×a⃗1\vec a_2\times\vec a_1, copying the misprint in the book's final formula on page 387. The formula needs the difference a⃗2−a⃗1\vec a_2 - \vec a_1⁠.
  3. Forgetting the zero component. a⃗2−a⃗1=i^+0j^−k^\vec a_2 - \vec a_1 = \hat i + 0\hat j - \hat k⁠; the j^\hat j part contributes 0, not −1-1⁠.
  4. Dividing by the wrong length. The bottom is ∣b⃗1×b⃗2∣=59|\vec b_1\times\vec b_2| = \sqrt{59}⁠, not ∣b⃗1∣ ∣b⃗2∣|\vec b_1|\,|\vec b_2|⁠.
What to take away
  1. Skew lines: d=∣(b⃗1×b⃗2)⋅(a⃗2−a⃗1)∣∣b⃗1×b⃗2∣d = \frac{|(\vec b_1\times\vec b_2)\cdot(\vec a_2 - \vec a_1)|}{|\vec b_1\times\vec b_2|}⁠.
  2. b⃗1×b⃗2\vec b_1\times\vec b_2 gives the direction of the common perpendicular; the dot product projects the joining vector onto it.
  3. If the answer is 0 the lines meet; if b⃗1×b⃗2=0⃗\vec b_1\times\vec b_2 = \vec 0 the lines are parallel and a different formula is needed (Example 10).

Every fact used, and where it comes from

FactUsed inSource
Reading a⃗\vec a and b⃗\vec b from r⃗=a⃗+λb⃗\vec r = \vec a + \lambda\vec bStep 1Section 11.3.1 (Basics)
Vector joining two pointsStep 2Section 10.5.2
b⃗1×b⃗2\vec b_1\times\vec b_2 as a determinant; it is perpendicular to both vectorsStep 3Section 10.6.3 (Basics)
n^=b⃗1×b⃗2∣b⃗1×b⃗2∣\hat n = \frac{\vec b_1\times\vec b_2}{|\vec b_1\times\vec b_2|}⁠, d=ST ∣cos⁡θ∣d = ST\,|\cos\theta|Steps 4, 6Section 11.5.1, equation (3) and Fig 11.6 (Basics)
d=∣(b⃗1×b⃗2)⋅(a⃗2−a⃗1)∣b⃗1×b⃗2∣∣d = \left|\frac{(\vec b_1\times\vec b_2)\cdot(\vec a_2 - \vec a_1)}{|\vec b_1\times\vec b_2|}\right|⁠; the final form on p. 387 misprints a⃗2−a⃗1\vec a_2 - \vec a_1 as a⃗2×a⃗1\vec a_2\times\vec a_1Step 6Section 11.5.1 (Lesson)
Dot product in componentsSteps 3, 5, 7Section 10.6.1 (Basics)
Shortest segment is perpendicular to both skew lines; skew linesStep 7Section 11.5 (Lesson)
Found an error, or want more?

Tell us if something on this page is wrong or unclear, or if you would like a fuller explanation, another method or a new feature. Send feedback on this problem →