This note covers how two lines in three-dimensional space can be related: coincident, parallel, intersecting or skew. It shows how to decide which case applies, how to find a point of intersection and how to find the angle between two lines. These tests are used in problems about flight paths, structures and robotics.
Key ideas
In a plane, two different lines either meet at a point or are parallel. In three dimensions there is a third possibility: lines can miss each other without being parallel. Such lines are called skew.
Take two lines \(L_1:\ \mathbf{r}=\mathbf{a}_1+\lambda\mathbf{d}_1\) and \(L_2:\ \mathbf{r}=\mathbf{a}_2+\mu\mathbf{d}_2\). Use different parameter letters, because the two lines reach a common point at different parameter values.
Step 1: compare directions. If \(\mathbf{d}_1\) is a scalar multiple of \(\mathbf{d}_2\), the lines are parallel or coincident.
- If a point of \(L_1\), such as \(\mathbf{a}_1\), also lies on \(L_2\), the lines are coincident (they are the same line).
- If not, the lines are parallel and distinct. They never meet.
Step 2: if the directions are not parallel, try to intersect. Set the position vectors equal: \(\mathbf{a}_1+\lambda\mathbf{d}_1=\mathbf{a}_2+\mu\mathbf{d}_2\). This gives three equations (one per coordinate) in the two unknowns \(\lambda\) and \(\mu\).
- Solve two of the equations for \(\lambda\) and \(\mu\).
- Substitute these into the third equation. If it is true, the lines intersect, at a single point. Substitute \(\lambda\) into \(L_1\) (or \(\mu\) into \(L_2\)) to find the point.
- If the third equation is false, there is no common point. The lines are skew.
In two dimensions there are only two equations, so non-parallel lines always intersect and skew lines do not occur.
Angle between two lines. The angle between two lines is the angle between their direction vectors. Use the scalar product: \(\cos\theta=\dfrac{\mathbf{d}_1\cdot\mathbf{d}_2}{|\mathbf{d}_1||\mathbf{d}_2|}\). If this gives an obtuse angle, the angle between the lines (as normally quoted) is the acute angle \(180^\circ-\theta\). A simple way to get the acute angle directly is to use the absolute value of the scalar product: \(\cos\theta=\dfrac{|\mathbf{d}_1\cdot\mathbf{d}_2|}{|\mathbf{d}_1||\mathbf{d}_2|}\). This works for intersecting lines and also for skew lines, where it describes the angle between their directions. Perpendicular lines have \(\mathbf{d}_1\cdot\mathbf{d}_2=0\).
Checking for intersection in practice. Choose the two equations that look easiest to solve, often those with the simplest coefficients. Keep the third equation for the check. Writing the coordinates in a tidy table, one row for each of \(x\), \(y\) and \(z\), makes it much easier to avoid copying slips.
Parallel lines. To decide if two lines are parallel, compare directions. The vectors \(\begin{pmatrix}2\\-4\\6\end{pmatrix}\) and \(\begin{pmatrix}-1\\2\\-3\end{pmatrix}\) are parallel because the first is \(-2\) times the second. A different length or sign does not matter.
Definitions and formulae
| Term or formula | Meaning / when to use |
|---|---|
| \(\mathbf{d}_1=k\mathbf{d}_2\) | Directions parallel, so the lines are parallel or coincident. |
| Coincident lines | Parallel, and a point of one line lies on the other. |
| Intersecting lines | Not parallel, and equations for \(\lambda,\mu\) are consistent in all three coordinates. |
| Skew lines | Not parallel and no common point; possible only in three or more dimensions. |
| \(\cos\theta=\dfrac{|\mathbf{d}_1\cdot\mathbf{d}_2|}{|\mathbf{d}_1||\mathbf{d}_2|}\) | Acute angle between two lines. |
Worked examples
Example 1 The lines are \(L_1:\ \mathbf{r}=\begin{pmatrix}1\\2\\3\end{pmatrix}+\lambda\begin{pmatrix}1\\2\\-1\end{pmatrix}\) and \(L_2:\ \mathbf{r}=\begin{pmatrix}1\\5\\4\end{pmatrix}+\mu\begin{pmatrix}2\\1\\-3\end{pmatrix}\). Show that they intersect, find the point of intersection and the acute angle between the lines.
The directions \((1,2,-1)\) and \((2,1,-3)\) are not multiples of each other, so the lines are not parallel.
Equate the coordinates: \(1+\lambda=1+2\mu\) (1); \(2+2\lambda=5+\mu\) (2); \(3-\lambda=4-3\mu\) (3).
From (1), \(\lambda=2\mu\). Substitute into (2): \(2+4\mu=5+\mu\), so \(3\mu=3\), \(\mu=1\) and \(\lambda=2\).
Check in (3): left side \(3-2=1\); right side \(4-3=1\). Both sides are equal, so the lines intersect.
Point: \(L_1\) with \(\lambda=2\) gives \((1+2,\ 2+4,\ 3-2)=(3,6,1)\).
Angle: \(\mathbf{d}_1\cdot\mathbf{d}_2=2+2+3=7\), \(|\mathbf{d}_1|=\sqrt6\), \(|\mathbf{d}_2|=\sqrt{14}\).
\(\cos\theta=\dfrac{7}{\sqrt{84}}=0.7638\), so \(\theta=40.2^\circ\) using the inverse cosine function on your GDC.
Answer: the lines intersect at \((3,6,1)\); the acute angle is \(40.2^\circ\).
Example 2 Show that \(L_1:\ \mathbf{r}=\begin{pmatrix}1\\0\\2\end{pmatrix}+\lambda\begin{pmatrix}1\\1\\0\end{pmatrix}\) and \(L_2:\ \mathbf{r}=\begin{pmatrix}0\\1\\0\end{pmatrix}+\mu\begin{pmatrix}0\\1\\1\end{pmatrix}\) are skew.
The directions \((1,1,0)\) and \((0,1,1)\) are not parallel.
Equate coordinates: \(1+\lambda=0\) (1); \(\lambda=1+\mu\) (2); \(2=\mu\) (3).
From (1), \(\lambda=-1\). From (2), \(\mu=\lambda-1=-2\).
But (3) says \(\mu=2\). This contradicts \(\mu=-2\), so no values of \(\lambda\) and \(\mu\) satisfy all three equations.
Answer: the lines are not parallel and do not intersect, so they are skew.
Example 3 Show that \(L_1:\ \mathbf{r}=\begin{pmatrix}1\\2\\3\end{pmatrix}+\lambda\begin{pmatrix}2\\-4\\6\end{pmatrix}\) and \(L_2:\ \mathbf{r}=\begin{pmatrix}3\\-2\\8\end{pmatrix}+\mu\begin{pmatrix}-1\\2\\-3\end{pmatrix}\) are parallel but not the same line.
The direction of \(L_1\) is \((2,-4,6)=-2\times(-1,2,-3)\), so the lines are parallel.
Test whether the point \((3,-2,8)\) of \(L_2\) lies on \(L_1\). From \(x\): \(1+2\lambda=3\), so \(\lambda=1\).
At \(\lambda=1\), \(y=2-4=-2\), which matches, and \(z=3+6=9\), but the point has \(z=8\).
The point is not on \(L_1\), so the lines are distinct.
Answer: the lines are parallel and distinct.
Common errors
- Using the same parameter letter for both lines, which forces the two parameters to be equal.
- Deciding the lines intersect after using only two of the three equations. The third must also be checked.
- Calling lines "skew" before checking whether they are parallel. Parallel lines in space are not skew.
- Stating an obtuse angle between lines. Give the acute angle unless the question says otherwise.
- Finding the point of intersection but substituting into the wrong line's equation, or making a sign error when substituting.
Exam tip: When you reach a contradiction in the third equation, state clearly that there is no solution and that the lines are skew. Give the reason in one sentence.
Check yourself
- Are the lines with directions \(\begin{pmatrix}3\\-6\\9\end{pmatrix}\) and \(\begin{pmatrix}-1\\2\\-3\end{pmatrix}\) parallel?
Answer
Yes. The first is \(-3\) times the second. - Find the acute angle between lines with directions \(\begin{pmatrix}1\\0\\0\end{pmatrix}\) and \(\begin{pmatrix}1\\1\\0\end{pmatrix}\).
Answer
\(\cos\theta=\dfrac{1}{1\times\sqrt2}\), so \(\theta=45^\circ\). - Do \(\mathbf{r}=\begin{pmatrix}0\\0\\0\end{pmatrix}+\lambda\begin{pmatrix}1\\1\\1\end{pmatrix}\) and \(\mathbf{r}=\begin{pmatrix}2\\0\\0\end{pmatrix}+\mu\begin{pmatrix}0\\1\\1\end{pmatrix}\) intersect?
Answer
Equate: \(\lambda=2\), \(\lambda=\mu\), \(\lambda=\mu\). So \(\lambda=2\) and \(\mu=2\) satisfy all three equations. The lines intersect at \((2,2,2)\). - For which value of \(p\) are the lines with directions \(\begin{pmatrix}2\\p\\1\end{pmatrix}\) and \(\begin{pmatrix}1\\3\\-5\end{pmatrix}\) perpendicular?
Answer
Scalar product zero: \(2+3p-5=0\), so \(p=1\).