Shortest distance between skew lines

In three-dimensional geometry, we often encounter lines that do not intersect and are not parallel. These lines are called skew lines. Finding the shortest distance between two such lines is a fundamental problem with significant applications. The shortest distance between two skew lines is the length of the line segment that is perpendicular to both lines.

Understanding Skew Lines

Two lines in 3D space are skew if they are not coplanar. This means they do not lie on the same plane. If two lines are not coplanar, they cannot intersect, and they cannot be parallel.

Conditions for Skew Lines:

  • They do not intersect.
  • They are not parallel.
  • They do not lie in the same plane.

Representing Lines in 3D

Lines in 3D space can be represented in vector form or Cartesian form.

Vector Form:

The vector equation of a line passing through a point with position vector $\vec{a}$ and parallel to a vector $\vec{b}$ is given by $\vec{r} = \vec{a} + \lambda\vec{b}$, where $\lambda$ is a scalar parameter.

Consider two skew lines, $L_1$ and $L_2$, with equations: $L_1: \vec{r} = \vec{a}_1 + \lambda\vec{b}_1$ $L_2: \vec{r} = \vec{a}_2 + \mu\vec{b}_2$ Here, $\vec{a}_1$ and $\vec{a}_2$ are the position vectors of points on $L_1$ and $L_2$ respectively, and $\vec{b}_1$ and $\vec{b}_2$ are the direction vectors of $L_1$ and $L_2$ respectively.

Cartesian Form:

The Cartesian equation of a line passing through a point $(x_0, y_0, z_0)$ and having direction ratios $l, m, n$ is given by: $\frac{x - x_0}{l} = \frac{y - y_0}{m} = \frac{z - z_0}{n}$

For two skew lines in Cartesian form: $L_1: \frac{x - x_1}{a_1} = \frac{y - y_1}{b_1} = \frac{z - z_1}{c_1}$ $L_2: \frac{x - x_2}{a_2} = \frac{y - y_2}{b_2} = \frac{z - z_2}{c_2}$ The point on $L_1$ is $(x_1, y_1, z_1)$ and its direction ratios are $(a_1, b_1, c_1)$. The point on $L_2$ is $(x_2, y_2, z_2)$ and its direction ratios are $(a_2, b_2, c_2)$.

Formula for Shortest Distance between Skew Lines (Vector Form)

Let the two skew lines be $L_1: \vec{r} = \vec{a}_1 + \lambda\vec{b}_1$ and $L_2: \vec{r} = \vec{a}_2 + \mu\vec{b}_2$.

The shortest distance $d$ between these two lines is given by the formula: $d = \frac{|(\vec{a}_2 - \vec{a}_1) \cdot (\vec{b}_1 \times \vec{b}_2)|}{|\vec{b}_1 \times \vec{b}_2|}$

The term $(\vec{a}_2 - \vec{a}_1) \cdot (\vec{b}_1 \times \vec{b}_2)$ is the scalar triple product of the vectors $(\vec{a}_2 - \vec{a}_1)$, $\vec{b}_1$, and $\vec{b}_2$. It can be represented as a determinant: $d = \frac{\left| \begin{vmatrix} x_2 - x_1 & y_2 - y_1 & z_2 - z_1 \\ a_1 & b_1 & c_1 \\ a_2 & b_2 & c_2 \end{vmatrix} \right|}{\sqrt{(b_1c_2 - b_2c_1)^2 + (c_1a_2 - c_2a_1)^2 + (a_1b_2 - a_2b_1)^2}}$

Where $\vec{a}_1 = x_1\hat{i} + y_1\hat{j} + z_1\hat{k}$, $\vec{a}_2 = x_2\hat{i} + y_2\hat{j} + z_2\hat{k}$, $\vec{b}_1 = a_1\hat{i} + b_1\hat{j} + c_1\hat{k}$, and $\vec{b}_2 = a_2\hat{i} + b_2\hat{j} + c_2\hat{k}$.

The denominator, $|\vec{b}_1 \times \vec{b}_2|$, is the magnitude of the cross product of the direction vectors, which represents the area of the parallelogram formed by $\vec{b}_1$ and $\vec{b}_2$.

Memory Trick for Vector Form Formula: The shortest distance is the absolute value of the scalar triple product of the vector joining a point on the first line to a point on the second line, and the two direction vectors, divided by the magnitude of the cross product of the direction vectors. Think of it as: $d = \frac{|(\text{vector between points}) \cdot (\text{normal to both lines})|}{|\text{normal to both lines}|}$

Formula for Shortest Distance between Skew Lines (Cartesian Form)

For the lines: $L_1: \frac{x - x_1}{a_1} = \frac{y - y_1}{b_1} = \frac{z - z_1}{c_1}$ $L_2: \frac{x - x_2}{a_2} = \frac{y - y_2}{b_2} = \frac{z - z_2}{c_2}$

The shortest distance $d$ is given by: $d = \frac{\left| \begin{vmatrix} x_2 - x_1 & y_2 - y_1 & z_2 - z_1 \\ a_1 & b_1 & c_1 \\ a_2 & b_2 & c_2 \end{vmatrix} \right|}{\sqrt{(b_1c_2 - b_2c_1)^2 + (c_1a_2 - c_2a_1)^2 + (a_1b_2 - a_2b_1)^2}}$

This is the same formula derived from the vector form, where $(x_1, y_1, z_1)$ and $(x_2, y_2, z_2)$ are points on the lines, and $(a_1, b_1, c_1)$ and $(a_2, b_2, c_2)$ are their direction ratios.

Finding the Points and Direction Vectors

It is crucial to correctly identify the points and direction vectors from the given line equations.

Example 1: Line 1: $\vec{r} = (2\hat{i} - \hat{j} + 3\hat{k}) + \lambda(3\hat{i} + 2\hat{j} - \hat{k})$ Line 2: $\vec{r} = (\hat{i} + \hat{j} - \hat{k}) + \mu(- \hat{i} + 3\hat{j} + 2\hat{k})$

From Line 1: $\vec{a}_1 = 2\hat{i} - \hat{j} + 3\hat{k} \implies (x_1, y_1, z_1) = (2, -1, 3)$ $\vec{b}_1 = 3\hat{i} + 2\hat{j} - \hat{k} \implies (a_1, b_1, c_1) = (3, 2, -1)$

From Line 2: $\vec{a}_2 = \hat{i} + \hat{j} - \hat{k} \implies (x_2, y_2, z_2) = (1, 1, -1)$ $\vec{b}_2 = - \hat{i} + 3\hat{j} + 2\hat{k} \implies (a_2, b_2, c_2) = (-1, 3, 2)$

Calculating the Shortest Distance

Let's calculate the shortest distance for the example above.

First, find the vector connecting a point on $L_1$ to a point on $L_2$: $\vec{a}_2 - \vec{a}_1 = (\hat{i} + \hat{j} - \hat{k}) - (2\hat{i} - \hat{j} + 3\hat{k})$ $\vec{a}_2 - \vec{a}_1 = (1-2)\hat{i} + (1-(-1))\hat{j} + (-1-3)\hat{k}$ $\vec{a}_2 - \vec{a}_1 = -\hat{i} + 2\hat{j} - 4\hat{k}$

Next, find the cross product of the direction vectors $\vec{b}_1 \times \vec{b}_2$: $\vec{b}_1 \times \vec{b}_2 = \begin{vmatrix} \hat{i} & \hat{j} & \hat{k} \\ 3 & 2 & -1 \\ -1 & 3 & 2 \end{vmatrix}$ $= \hat{i}((2)(2) - (-1)(3)) - \hat{j}((3)(2) - (-1)(-1)) + \hat{k}((3)(3) - (2)(-1))$ $= \hat{i}(4 + 3) - \hat{j}(6 - 1) + \hat{k}(9 + 2)$ $= 7\hat{i} - 5\hat{j} + 11\hat{k}$

Now, find the magnitude of the cross product: $|\vec{b}_1 \times \vec{b}_2| = \sqrt{7^2 + (-5)^2 + 11^2}$ $= \sqrt{49 + 25 + 121}$ $= \sqrt{195}$

Finally, calculate the scalar triple product $(\vec{a}_2 - \vec{a}_1) \cdot (\vec{b}_1 \times \vec{b}_2)$: $(-\hat{i} + 2\hat{j} - 4\hat{k}) \cdot (7\hat{i} - 5\hat{j} + 11\hat{k})$ $= (-1)(7) + (2)(-5) + (-4)(11)$ $= -7 - 10 - 44$ $= -61$

The shortest distance $d$ is the absolute value of the scalar triple product divided by the magnitude of the cross product: $d = \frac{|-61|}{\sqrt{195}} = \frac{61}{\sqrt{195}}$

Condition for Lines to be Coplanar

Two lines are coplanar if the shortest distance between them is zero. This means the numerator of the shortest distance formula must be zero.

For lines $L_1: \vec{r} = \vec{a}_1 + \lambda\vec{b}_1$ and $L_2: \vec{r} = \vec{a}_2 + \mu\vec{b}_2$, they are coplanar if: $(\vec{a}_2 - \vec{a}_1) \cdot (\vec{b}_1 \times \vec{b}_2) = 0$

In Cartesian form, this condition is: $\begin{vmatrix} x_2 - x_1 & y_2 - y_1 & z_2 - z_1 \\ a_1 & b_1 & c_1 \\ a_2 & b_2 & c_2 \end{vmatrix} = 0$

Finding the Point of Shortest Distance

The shortest distance between two skew lines is along the line segment that is perpendicular to both. Let the points of shortest distance on $L_1$ and $L_2$ be $P_1$ and $P_2$ respectively.

The position vector of $P_1$ on $L_1$ is $\vec{r}_1 = \vec{a}_1 + \lambda\vec{b}_1$. The position vector of $P_2$ on $L_2$ is $\vec{r}_2 = \vec{a}_2 + \mu\vec{b}_2$.

The vector $\vec{P_1P_2} = \vec{r}_2 - \vec{r}_1$ must be perpendicular to both direction vectors $\vec{b}_1$ and $\vec{b}_2$. This means: $(\vec{r}_2 - \vec{r}_1) \cdot \vec{b}_1 = 0$ $(\vec{r}_2 - \vec{r}_1) \cdot \vec{b}_2 = 0$

Substituting the expressions for $\vec{r}_1$ and $\vec{r}_2$: $((\vec{a}_2 + \mu\vec{b}_2) - (\vec{a}_1 + \lambda\vec{b}_1)) \cdot \vec{b}_1 = 0$ $(\vec{a}_2 - \vec{a}_1 + \mu\vec{b}_2 - \lambda\vec{b}_1) \cdot \vec{b}_1 = 0$ $(\vec{a}_2 - \vec{a}_1) \cdot \vec{b}_1 + \mu(\vec{b}_2 \cdot \vec{b}_1) - \lambda(\vec{b}_1 \cdot \vec{b}_1) = 0$ $\lambda|\vec{b}_1|^2 = (\vec{a}_2 - \vec{a}_1) \cdot \vec{b}_1 + \mu(\vec{b}_1 \cdot \vec{b}_2)$ (Equation 1)

Similarly, for the second condition: $((\vec{a}_2 + \mu\vec{b}_2) - (\vec{a}_1 + \lambda\vec{b}_1)) \cdot \vec{b}_2 = 0$ $(\vec{a}_2 - \vec{a}_1 + \mu\vec{b}_2 - \lambda\vec{b}_1) \cdot \vec{b}_2 = 0$ $(\vec{a}_2 - \vec{a}_1) \cdot \vec{b}_2 + \mu(\vec{b}_2 \cdot \vec{b}_2) - \lambda(\vec{b}_1 \cdot \vec{b}_2) = 0$ $\mu|\vec{b}_2|^2 = (\vec{a}_1 - \vec{a}_2) \cdot \vec{b}_2 + \lambda(\vec{b}_1 \cdot \vec{b}_2)$ (Using $\vec{a}_1 - \vec{a}_2 = -(\vec{a}_2 - \vec{a}_1)$) $\mu|\vec{b}_2|^2 = -(\vec{a}_2 - \vec{a}_1) \cdot \vec{b}_2 + \lambda(\vec{b}_1 \cdot \vec{b}_2)$ (Equation 2)

We now have a system of two linear equations with two unknowns, $\lambda$ and $\mu$. Solving these equations gives the values of $\lambda$ and $\mu$ that correspond to the points of shortest distance. Once $\lambda$ and $\mu$ are found, we can find the position vectors $\vec{r}_1$ and $\vec{r}_2$.

The shortest distance is then the magnitude of the vector $\vec{P_1P_2} = \vec{r}_2 - \vec{r}_1$.

Important Note: While this method finds the points of shortest distance, the formula for the shortest distance itself is usually more direct and less computationally intensive for exams. However, understanding this perpendicularity condition is key to deriving the formula and for more advanced problems.

Example: Finding the Points of Shortest Distance

Consider the lines from the previous example: $L_1: \vec{r} = (2\hat{i} - \hat{j} + 3\hat{k}) + \lambda(3\hat{i} + 2\hat{j} - \hat{k})$ $L_2: \vec{r} = (\hat{i} + \hat{j} - \hat{k}) + \mu(- \hat{i} + 3\hat{j} + 2\hat{k})$

We have: $\vec{a}_1 = 2\hat{i} - \hat{j} + 3\hat{k}$, $\vec{b}_1 = 3\hat{i} + 2\hat{j} - \hat{k}$ $\vec{a}_2 = \hat{i} + \hat{j} - \hat{k}$, $\vec{b}_2 = - \hat{i} + 3\hat{j} + 2\hat{k}$ $\vec{a}_2 - \vec{a}_1 = -\hat{i} + 2\hat{j} - 4\hat{k}$

Calculate dot products: $|\vec{b}_1|^2 = 3^2 + 2^2 + (-1)^2 = 9 + 4 + 1 = 14$ $|\vec{b}_2|^2 = (-1)^2 + 3^2 + 2^2 = 1 + 9 + 4 = 14$ $\vec{b}_1 \cdot \vec{b}_2 = (3)(-1) + (2)(3) + (-1)(2) = -3 + 6 - 2 = 1$ $(\vec{a}_2 - \vec{a}_1) \cdot \vec{b}_1 = (-\hat{i} + 2\hat{j} - 4\hat{k}) \cdot (3\hat{i} + 2\hat{j} - \hat{k}) = (-1)(3) + (2)(2) + (-4)(-1) = -3 + 4 + 4 = 5$ $(\vec{a}_2 - \vec{a}_1) \cdot \vec{b}_2 = (-\hat{i} + 2\hat{j} - 4\hat{k}) \cdot (-\hat{i} + 3\hat{j} + 2\hat{k}) = (-1)(-1) + (2)(3) + (-4)(2) = 1 + 6 - 8 = -1$

Now, substitute into the equations for $\lambda$ and $\mu$: Equation 1: $\lambda(14) = 5 + \mu(1) \implies 14\lambda = 5 + \mu$ Equation 2: $\mu(14) = -(-1) + \lambda(1) \implies 14\mu = 1 + \lambda$

From Equation 1, $\mu = 14\lambda - 5$. Substitute this into Equation 2: $14(14\lambda - 5) = 1 + \lambda$ $196\lambda - 70 = 1 + \lambda$ $195\lambda = 71$ $\lambda = \frac{71}{195}$

Now find $\mu$: $\mu = 14\lambda - 5 = 14 \left(\frac{71}{195}\right) - 5$ $\mu = \frac{994}{195} - \frac{5 \times 195}{195} = \frac{994 - 975}{195} = \frac{19}{195}$

Now find the points of shortest distance: Point $P_1$ on $L_1$: $\vec{r}_1 = (2\hat{i} - \hat{j} + 3\hat{k}) + \frac{71}{195}(3\hat{i} + 2\hat{j} - \hat{k})$ $\vec{r}_1 = \left(2 + \frac{213}{195}\right)\hat{i} + \left(-1 + \frac{142}{195}\right)\hat{j} + \left(3 - \frac{71}{195}\right)\hat{k}$ $\vec{r}_1 = \left(\frac{390+213}{195}\right)\hat{i} + \left(\frac{-195+142}{195}\right)\hat{j} + \left(\frac{585-71}{195}\right)\hat{k}$ $\vec{r}_1 = \frac{603}{195}\hat{i} - \frac{53}{195}\hat{j} + \frac{514}{195}\hat{k}$

Point $P_2$ on $L_2$: $\vec{r}_2 = (\hat{i} + \hat{j} - \hat{k}) + \frac{19}{195}(- \hat{i} + 3\hat{j} + 2\hat{k})$ $\vec{r}_2 = \left(1 - \frac{19}{195}\right)\hat{i} + \left(1 + \frac{57}{195}\right)\hat{j} + \left(-1 + \frac{38}{195}\right)\hat{k}$ $\vec{r}_2 = \left(\frac{195-19}{195}\right)\hat{i} + \left(\frac{195+57}{195}\right)\hat{j} + \left(\frac{-195+38}{195}\right)\hat{k}$ $\vec{r}_2 = \frac{176}{195}\hat{i} + \frac{252}{195}\hat{j} - \frac{157}{195}\hat{k}$

The shortest distance vector is $\vec{P_1P_2} = \vec{r}_2 - \vec{r}_1$: $\vec{P_1P_2} = \left(\frac{176 - 603}{195}\right)\hat{i} + \left(\frac{252 - (-53)}{195}\right)\hat{j} + \left(\frac{-157 - 514}{195}\right)\hat{k}$ $\vec{P_1P_2} = \frac{-427}{195}\hat{i} + \frac{305}{195}\hat{j} - \frac{671}{195}\hat{k}$

The shortest distance is $|\vec{P_1P_2}|$: $|\vec{P_1P_2}|^2 = \left(\frac{-427}{195}\right)^2 + \left(\frac{305}{195}\right)^2 + \left(\frac{-671}{195}\right)^2$ This calculation is tedious. Let's verify if this distance matches the formula result $\frac{61}{\sqrt{195}}$. $\left(\frac{61}{\sqrt{195}}\right)^2 = \frac{3721}{195}$

The calculation of $|\vec{P_1P_2}|^2$ from the derived vectors $\vec{r}_1$ and $\vec{r}_2$ should yield $\frac{3721}{195}$. This is a good check for the correctness of $\lambda$ and $\mu$.

Shortest Distance between Parallel Lines

If two lines are parallel, their direction vectors are proportional, i.e., $\vec{b}_1 = k\vec{b}_2$ for some scalar $k$. We can assume $\vec{b}_1 = \vec{b}_2$ by adjusting the parameter.

Let the lines be $L_1: \vec{r} = \vec{a}_1 + \lambda\vec{b}$ and $L_2: \vec{r} = \vec{a}_2 + \mu\vec{b}$.

The shortest distance between parallel lines is the perpendicular distance from a point on one line to the other line.

Consider a point $A$ with position vector $\vec{a}_1$ on $L_1$ and a point $B$ with position vector $\vec{a}_2$ on $L_2$. The vector connecting these points is $\vec{a}_2 - \vec{a}_1$.

The shortest distance $d$ is the magnitude of the component of $(\vec{a}_2 - \vec{a}_1)$ that is perpendicular to the direction vector $\vec{b}$.

This can be found using the cross product: $d = \frac{|(\vec{a}_2 - \vec{a}_1) \times \vec{b}|}{|\vec{b}|}$

Key Distinction: For skew lines, we use the scalar triple product in the numerator. For parallel lines, we use the cross product.

Summary of Formulas

Let the two lines be $L_1: \vec{r} = \vec{a}_1 + \lambda\vec{b}_1$ and $L_2: \vec{r} = \vec{a}_2 + \mu\vec{b}_2$.

Case Condition Shortest Distance Formula
Skew Lines $\vec{b}_1$ is not parallel to $\vec{b}_2$ (i.e., $\vec{b}_1 \times \vec{b}_2 \neq \vec{0}$) and lines are not coplanar. $d = \frac{|(\vec{a}_2 - \vec{a}_1) \cdot (\vec{b}_1 \times \vec{b}_2)|}{|\vec{b}_1 \times \vec{b}_2|}$
Intersecting Lines Shortest distance $d=0$. This happens when $(\vec{a}_2 - \vec{a}_1) \cdot (\vec{b}_1 \times \vec{b}_2) = 0$. $d = 0$
Parallel Lines $\vec{b}_1$ is parallel to $\vec{b}_2$ (i.e., $\vec{b}_1 = k\vec{b}_2$). Let $\vec{b}_1 = \vec{b}_2 = \vec{b}$. $d = \frac{|(\vec{a}_2 - \vec{a}_1) \times \vec{b}|}{|\vec{b}|}$

Common Pitfalls and Tips

  • Direction Ratios vs. Direction Cosines: Ensure you are using direction ratios correctly. If direction cosines ($l, m, n$) are given, they can be used directly as they form a unit vector.
  • Vector Form vs. Cartesian Form: Be comfortable converting between the two forms and applying the correct formula.
  • Identifying $\vec{a}$ and $\vec{b}$: The vector $\vec{a}$ is the position vector of a point on the line, and $\vec{b}$ is the direction vector. Sometimes these are not immediately obvious and require rearrangement of the equation.
  • Sign Errors: Be extremely careful with signs, especially when calculating cross products, dot products, and the difference vector $(\vec{a}_2 - \vec{a}_1)$.
  • Denominator is Zero: If $|\vec{b}_1 \times \vec{b}_2| = 0$, it means $\vec{b}_1$ and $\vec{b}_2$ are parallel. The lines are either parallel or identical. You cannot use the skew line formula.
  • Check for Intersection: Before applying the skew line formula, sometimes it's useful to check if the lines intersect. If they do, the shortest distance is zero.

Example involving Cartesian Form

Find the shortest distance between the lines: $L_1: \frac{x - 1}{2} = \frac{y - 2}{3} = \frac{z - 3}{4}$ $L_2: \frac{x - 2}{3} = \frac{y - 4}{4} = \frac{z - 5}{5}$

From $L_1$: Point $(x_1, y_1, z_1) = (1, 2, 3)$ Direction ratios $(a_1, b_1, c_1) = (2, 3, 4)$

From $L_2$: Point $(x_2, y_2, z_2) = (2, 4, 5)$ Direction ratios $(a_2, b_2, c_2) = (3, 4, 5)$

First, check if the lines are parallel. The direction ratios $(2, 3, 4)$ and $(3, 4, 5)$ are not proportional, so they are not parallel.

Calculate the determinant for the numerator: $\begin{vmatrix} x_2 - x_1 & y_2 - y_1 & z_2 - z_1 \\ a_1 & b_1 & c_1 \\ a_2 & b_2 & c_2 \end{vmatrix} = \begin{vmatrix} 2 - 1 & 4 - 2 & 5 - 3 \\ 2 & 3 & 4 \\ 3 & 4 & 5 \end{vmatrix}$ $= \begin{vmatrix} 1 & 2 & 2 \\ 2 & 3 & 4 \\ 3 & 4 & 5 \end{vmatrix}$ $= 1(3 \times 5 - 4 \times 4) - 2(2 \times 5 - 4 \times 3) + 2(2 \times 4 - 3 \times 3)$ $= 1(15 - 16) - 2(10 - 12) + 2(8 - 9)$ $= 1(-1) - 2(-2) + 2(-1)$ $= -1 + 4 - 2 = 1$

Calculate the denominator: $\sqrt{(b_1c_2 - b_2c_1)^2 + (c_1a_2 - c_2a_1)^2 + (a_1b_2 - a_2b_1)^2}$ $= \sqrt{(3 \times 5 - 4 \times 4)^2 + (4 \times 3 - 5 \times 2)^2 + (2 \times 4 - 3 \times 3)^2}$ $= \sqrt{(15 - 16)^2 + (12 - 10)^2 + (8 - 9)^2}$ $= \sqrt{(-1)^2 + (2)^2 + (-1)^2}$ $= \sqrt{1 + 4 + 1} = \sqrt{6}$

The shortest distance $d$ is: $d = \frac{|1|}{\sqrt{6}} = \frac{1}{\sqrt{6}}$