21.2 A Point and a Line

AHL 3.14

In this section you will learn
  • how to check whether a point lies on a line
  • how to find the foot of the perpendicular from a point to a line
  • three ways to find the shortest distance from a point to a line
  • how to find the reflection of a point in a line

Throughout this section the line is \(l: \boldsymbol{r} = \boldsymbol{a} + \lambda\boldsymbol{b}\), written as in Section 21.1.

Does a point lie on a line?

A point \(P(x, y, z)\) lies on \(l\) if there is one value of \(\lambda\) with \(\boldsymbol{a} + \lambda\boldsymbol{b} = \overrightarrow{OP}\).

To test whether \(P(x, y, z)\) lies on \(\boldsymbol{r} = \begin{pmatrix} x_0 \\ y_0 \\ z_0 \end{pmatrix} + \lambda\begin{pmatrix} l \\ m \\ n \end{pmatrix}\)

Write the three equations \(\quad x = x_0 + \lambda l, \quad y = y_0 + \lambda m, \quad z = z_0 + \lambda n .\)

Solve one of them for \(\lambda\), then check the other two. If the same \(\lambda\) satisfies all three, \(P\) is on the line. If not, \(P\) is not on the line.

Not in the formula booklet.

Example 1 The line \(l\) has equation \(\boldsymbol{r} = \begin{pmatrix} 2 \\ -1 \\ 3 \end{pmatrix} + \lambda \begin{pmatrix} 1 \\ 3 \\ -2 \end{pmatrix}, \; \lambda \in \mathbb{R}\). Determine whether the points \(A(5, 8, -3)\) and \(B(0, -7, 6)\) lie on \(l\).

Point \(A\). \(\;2 + \lambda = 5 \Rightarrow \lambda = 3\).

Check: \(\;y = -1 + 3 \times 3 = 8\) ✓, \(\;z = 3 - 2 \times 3 = -3\) ✓. So \(A\) lies on \(l\) (at \(\lambda = 3\)).

Point \(B\). \(\;2 + \lambda = 0 \Rightarrow \lambda = -2\).

Check: \(\;y = -1 + 3(-2) = -7\) ✓, but \(\;z = 3 - 2(-2) = 7 \ne 6\) ✗. So \(B\) does not lie on \(l\).

Example 2 The point \((k, 11, m)\) lies on the line \(\boldsymbol{r} = \begin{pmatrix} 1 \\ -1 \\ 4 \end{pmatrix} + \lambda \begin{pmatrix} 2 \\ 3 \\ -1 \end{pmatrix}\). Find \(k\) and \(m\).

Use the coordinate we know: \(\;-1 + 3\lambda = 11 \Rightarrow \lambda = 4\).

Then \(k = 1 + 2 \times 4 = 9\) and \(m = 4 - 4 = 0\).

The foot of the perpendicular and the shortest distance

Let \(P\) be a point that is not on \(l\). Draw the line through \(P\) that meets \(l\) at a right angle, at the point \(F\). \(F\) is called the foot of the perpendicular from \(P\) to \(l\). \(F\) is the point of \(l\) that is closest to \(P\), so \(|\overrightarrow{PF}|\) is the shortest distance from \(P\) to \(l\).

Figure 1: \(PF\) is perpendicular to the direction \(\boldsymbol{b}\) of the line.

Foot of the perpendicular from \(P\) to \(l: \boldsymbol{r} = \boldsymbol{a} + \lambda\boldsymbol{b}\)

  1. \(F\) is on \(l\), so \(\overrightarrow{OF} = \boldsymbol{a} + \lambda\boldsymbol{b}\) for some \(\lambda\). Write it with \(\lambda\) in each component.
  2. Find \(\overrightarrow{PF} = \overrightarrow{OF} - \overrightarrow{OP}\) (in terms of \(\lambda\)).
  3. \(PF\) is perpendicular to the line, so \(\;\overrightarrow{PF} \cdot \boldsymbol{b} = 0\). Solve for \(\lambda\).
  4. Put this \(\lambda\) into \(\overrightarrow{OF}\) to get \(F\). The shortest distance is \(|\overrightarrow{PF}|\).

Not in the formula booklet. The scalar product is; see Unit 20.

Example 3 Find the coordinates of the foot of the perpendicular from \(P(6, -3, 3)\) to the line \(l: \boldsymbol{r} = \begin{pmatrix} 1 \\ -2 \\ 3 \end{pmatrix} + t \begin{pmatrix} 2 \\ 1 \\ -2 \end{pmatrix}, \; t \in \mathbb{R}\). Hence find the shortest distance from \(P\) to \(l\), in exact form.

Step 1. \(\;\overrightarrow{OF} = \begin{pmatrix} 1 + 2t \\ -2 + t \\ 3 - 2t \end{pmatrix}\).

Step 2. \(\;\overrightarrow{PF} = \begin{pmatrix} 1 + 2t - 6 \\ -2 + t + 3 \\ 3 - 2t - 3 \end{pmatrix} = \begin{pmatrix} 2t - 5 \\ t + 1 \\ -2t \end{pmatrix}\).

Step 3.

\[ \overrightarrow{PF} \cdot \begin{pmatrix} 2 \\ 1 \\ -2 \end{pmatrix} = 2(2t - 5) + (t + 1) - 2(-2t) = 9t - 9 = 0 \quad\Longrightarrow\quad t = 1 . \]

Step 4. \(\;\overrightarrow{OF} = \begin{pmatrix} 3 \\ -1 \\ 1 \end{pmatrix}\), so \(F\) is \((3, -1, 1)\).

\[ \overrightarrow{PF} = \begin{pmatrix} -3 \\ 2 \\ -2 \end{pmatrix}, \qquad |\overrightarrow{PF}| = \sqrt{9 + 4 + 4} = \sqrt{17} . \]

The shortest distance is \(\sqrt{17}\) units.

Two other methods for the distance

Both methods below give the same answer for Example 3.

Method 2 — minimise the distance. For a general point \(R\) on the line, \(|\overrightarrow{PR}|^2\) is a quadratic in \(t\). Its minimum value is the square of the shortest distance. With the numbers above, \(\overrightarrow{PR} = \begin{pmatrix} 2t - 5 \\ t + 1 \\ -2t \end{pmatrix}\), so

\[ |\overrightarrow{PR}|^2 = (2t - 5)^2 + (t + 1)^2 + 4t^2 = 9t^2 - 18t + 26 = 9(t - 1)^2 + 17 . \]

The minimum is \(17\), when \(t = 1\). So the shortest distance is \(\sqrt{17}\), and it occurs at \(F(3, -1, 1)\), as before. (You can also find the minimum by differentiating and setting the derivative to \(0\).)

Method 3 — use the vector product. If \(A\) is the fixed point of the line, the shortest distance is

\[ d = \frac{|\overrightarrow{AP} \times \boldsymbol{b}|}{|\boldsymbol{b}|} . \]

This is because \(|\overrightarrow{AP} \times \boldsymbol{b}|\) is the area of a parallelogram with base \(|\boldsymbol{b}|\) and height \(d\) (the vector product is in Unit 20). Here \(A = (1, -2, 3)\), so \(\overrightarrow{AP} = \begin{pmatrix} 5 \\ -1 \\ 0 \end{pmatrix}\) and

\[ \overrightarrow{AP} \times \boldsymbol{b} = \begin{pmatrix} 5 \\ -1 \\ 0 \end{pmatrix} \times \begin{pmatrix} 2 \\ 1 \\ -2 \end{pmatrix} = \begin{pmatrix} (-1)(-2) - 0 \times 1 \\ 0 \times 2 - 5(-2) \\ 5 \times 1 - (-1) \times 2 \end{pmatrix} = \begin{pmatrix} 2 \\ 10 \\ 7 \end{pmatrix} . \]

\[ d = \frac{\sqrt{4 + 100 + 49}}{\sqrt{4 + 1 + 4}} = \frac{\sqrt{153}}{3} = \frac{3\sqrt{17}}{3} = \sqrt{17} . \]

Method 3 is quick for the distance, but it does not give the point \(F\). Use Method 1 when \(F\) is needed.

The formula \(d = \dfrac{|\overrightarrow{AP} \times \boldsymbol{b}|}{|\boldsymbol{b}|}\) is not in the formula booklet. The vector product is in the HL booklet (3.16).

Example 4 Find the shortest distance from \(P(4, 5, 7)\) to the line \(\boldsymbol{r} = (1 - 2\lambda)\boldsymbol{i} + (4 + \lambda)\boldsymbol{j} + 3\boldsymbol{k}\), where \(\lambda\) is a real parameter.

The direction is \(\boldsymbol{b} = \begin{pmatrix} -2 \\ 1 \\ 0 \end{pmatrix}\) (the \(\boldsymbol{k}\)-component does not contain \(\lambda\)).

For the foot \(F\): \(\;\overrightarrow{PF} = \begin{pmatrix} 1 - 2\lambda - 4 \\ 4 + \lambda - 5 \\ 3 - 7 \end{pmatrix} = \begin{pmatrix} -3 - 2\lambda \\ \lambda - 1 \\ -4 \end{pmatrix}\).

\[ \overrightarrow{PF} \cdot \boldsymbol{b} = -2(-3 - 2\lambda) + (\lambda - 1) + 0 = 5\lambda + 5 = 0 \quad\Longrightarrow\quad \lambda = -1 . \]

Then \(F = (3, 3, 3)\) and \(\overrightarrow{PF} = \begin{pmatrix} -1 \\ -2 \\ -4 \end{pmatrix}\), so the shortest distance is \(\sqrt{1 + 4 + 16} = \sqrt{21}\).

Example 5 The equation of a line is \(\boldsymbol{r} = \begin{pmatrix} 2\lambda - 1 \\ 5 \\ 3 - \lambda \end{pmatrix}\) and the point \(P\) has coordinates \((2, 3, 4)\). Find the perpendicular distance from \(P\) to the line.

Split the vector: \(\boldsymbol{r} = \begin{pmatrix} -1 \\ 5 \\ 3 \end{pmatrix} + \lambda \begin{pmatrix} 2 \\ 0 \\ -1 \end{pmatrix}\).

\[ \overrightarrow{PF} = \begin{pmatrix} 2\lambda - 3 \\ 2 \\ -1 - \lambda \end{pmatrix}, \qquad \overrightarrow{PF} \cdot \begin{pmatrix} 2 \\ 0 \\ -1 \end{pmatrix} = 4\lambda - 6 + 1 + \lambda = 5\lambda - 5 = 0 \;\Longrightarrow\; \lambda = 1 . \]

So \(F = (1, 5, 2)\), \(\;\overrightarrow{PF} = \begin{pmatrix} -1 \\ 2 \\ -2 \end{pmatrix}\), and the distance is \(\sqrt{1 + 4 + 4} = 3\).

Reflection of a point in a line

Let \(F\) be the foot of the perpendicular from \(P\) to \(l\). Extend \(PF\) beyond \(F\) by the same length, to the point \(P'\). Then \(P'\) is the reflection (image) of \(P\) in \(l\), and \(F\) is the midpoint of \(PP'\).

Figure 2: \(F\) is the midpoint of \(PP'\), and \(PP'\) is perpendicular to \(l\).

Reflection of \(P\) in a line Not in the formula booklet

First find the foot of the perpendicular \(F\). Then

\[ \overrightarrow{OP'} = \overrightarrow{OP} + 2\,\overrightarrow{PF} \qquad\text{or equivalently}\qquad \overrightarrow{OP'} = 2\,\overrightarrow{OF} - \overrightarrow{OP} . \]

  • \(O\): the origin
  • \(P'\): the image of \(P\) (the reflection of \(P\) in the line)
  • \(P\): the point that we reflect
  • \(F\): the foot of the perpendicular from \(P\) to the line

Example 6 The line \(l\) has equation \(\boldsymbol{r} = \begin{pmatrix} 2 \\ 0 \\ -1 \end{pmatrix} + \lambda \begin{pmatrix} 1 \\ -1 \\ 2 \end{pmatrix}, \; \lambda \in \mathbb{R}\). The point \(P\) has coordinates \((6, 0, 0)\). Find the coordinates of the reflection of \(P\) in \(l\).

Foot of the perpendicular: \(\;\overrightarrow{PF} = \begin{pmatrix} 2 + \lambda - 6 \\ -\lambda \\ -1 + 2\lambda \end{pmatrix} = \begin{pmatrix} \lambda - 4 \\ -\lambda \\ 2\lambda - 1 \end{pmatrix}\).

\[ \overrightarrow{PF} \cdot \begin{pmatrix} 1 \\ -1 \\ 2 \end{pmatrix} = (\lambda - 4) + \lambda + (4\lambda - 2) = 6\lambda - 6 = 0 \;\Longrightarrow\; \lambda = 1 . \]

So \(F = (3, -1, 1)\) and \(\overrightarrow{PF} = \begin{pmatrix} -3 \\ -1 \\ 1 \end{pmatrix}\).

\[ \overrightarrow{OP'} = \overrightarrow{OP} + 2\overrightarrow{PF} = \begin{pmatrix} 6 \\ 0 \\ 0 \end{pmatrix} + \begin{pmatrix} -6 \\ -2 \\ 2 \end{pmatrix} = \begin{pmatrix} 0 \\ -2 \\ 2 \end{pmatrix} . \]

The reflection is \(P'(0, -2, 2)\). Check: the midpoint of \(PP'\) is \((3, -1, 1) = F\) ✓.

Common errors

✗ Wrong ✓ Right Why
\(\lambda = 3\) from the \(x\)-equation, so \(P\) is on the line Check \(\lambda = 3\) in all three equations One equation always has a solution. All three must agree.
\(\overrightarrow{PF} \cdot \overrightarrow{OF} = 0\) \(\overrightarrow{PF} \cdot \boldsymbol{b} = 0\) \(PF\) is perpendicular to the direction of the line, not to the position vector of \(F\).
Distance \(= |\overrightarrow{AP}|\), with \(A\) the given point of the line Distance \(= |\overrightarrow{PF}|\) \(A\) is just one point on the line; it is usually not the closest one.
Direction of \((1 - 2\lambda)\boldsymbol{i} + (4 + \lambda)\boldsymbol{j} + 3\boldsymbol{k}\) is \(\begin{pmatrix} -2 \\ 1 \\ 3 \end{pmatrix}\) \(\begin{pmatrix} -2 \\ 1 \\ 0 \end{pmatrix}\) Only the coefficients of \(\lambda\) give the direction. \(3\boldsymbol{k}\) is part of the fixed point.
\(\overrightarrow{OP'} = \overrightarrow{OP} + \overrightarrow{PF}\) \(\overrightarrow{OP'} = \overrightarrow{OP} + 2\overrightarrow{PF}\) \(\overrightarrow{OP} + \overrightarrow{PF}\) only reaches \(F\). You must go the same distance again.

Exercises

1 Show that the point \((7, -1, 9)\) lies on the line \(\boldsymbol{r} = \begin{pmatrix} 1 \\ 2 \\ 3 \end{pmatrix} + \lambda \begin{pmatrix} 2 \\ -1 \\ 2 \end{pmatrix}\).

\(1 + 2\lambda = 7 \Rightarrow \lambda = 3\). Then \(y = 2 - 3 = -1\) ✓ and \(z = 3 + 6 = 9\) ✓. The same \(\lambda\) works, so the point is on the line.

2 The line \(l\) has Cartesian equations \(\dfrac{x - 1}{2} = \dfrac{y - 1}{-1} = \dfrac{z + 2}{3}\). Determine whether each point lies on \(l\).

(a) \((-3, 3, -8)\)

(b) \((5, -1, 5)\)

Substitute into each fraction; the point is on \(l\) only if all three values are equal.

(a) \(\dfrac{-4}{2} = -2\), \(\;\dfrac{2}{-1} = -2\), \(\;\dfrac{-6}{3} = -2\). All equal, so the point is on \(l\).

(b) \(\dfrac{4}{2} = 2\), \(\;\dfrac{-2}{-1} = 2\), \(\;\dfrac{7}{3} \ne 2\). Not on \(l\).

3 The point \((a, b, 7)\) lies on the line \(\boldsymbol{r} = \begin{pmatrix} 2 \\ -3 \\ 1 \end{pmatrix} + \lambda \begin{pmatrix} 1 \\ 4 \\ 3 \end{pmatrix}\). Find \(a\) and \(b\).

\(1 + 3\lambda = 7 \Rightarrow \lambda = 2\). So \(a = 2 + 2 = 4\) and \(b = -3 + 8 = 5\).

4 Find the foot of the perpendicular from \(P(4, 2, 1)\) to the line \(\boldsymbol{r} = \begin{pmatrix} 0 \\ 1 \\ 2 \end{pmatrix} + t \begin{pmatrix} 1 \\ 1 \\ -1 \end{pmatrix}\), and the shortest distance from \(P\) to the line.

\(\overrightarrow{PF} = \begin{pmatrix} t - 4 \\ t - 1 \\ 1 - t \end{pmatrix}\), and \(\overrightarrow{PF} \cdot \begin{pmatrix} 1 \\ 1 \\ -1 \end{pmatrix} = (t - 4) + (t - 1) - (1 - t) = 3t - 6 = 0\), so \(t = 2\).

\(F = (2, 3, 0)\), \(\;\overrightarrow{PF} = \begin{pmatrix} -2 \\ 1 \\ -1 \end{pmatrix}\), and the distance is \(\sqrt{6}\).

5 Find the shortest distance from the origin to the line \(\boldsymbol{r} = \begin{pmatrix} 5 \\ 1 \\ -1 \end{pmatrix} + \lambda \begin{pmatrix} 1 \\ 2 \\ 1 \end{pmatrix}\).

Here \(P = O\), so \(\overrightarrow{OF} \cdot \boldsymbol{b} = 0\): \((5 + \lambda) + 2(1 + 2\lambda) + (-1 + \lambda) = 6 + 6\lambda = 0\), so \(\lambda = -1\).

\(F = (4, -1, -2)\) and the distance is \(\sqrt{16 + 1 + 4} = \sqrt{21}\).

6 Find the reflection of \(P(4, 4, -1)\) in the line \(\boldsymbol{r} = \begin{pmatrix} 1 \\ 1 \\ 0 \end{pmatrix} + \lambda \begin{pmatrix} 2 \\ 0 \\ 1 \end{pmatrix}\).

\(\overrightarrow{PF} = \begin{pmatrix} 2\lambda - 3 \\ -3 \\ \lambda + 1 \end{pmatrix}\); \(\;\overrightarrow{PF} \cdot \begin{pmatrix} 2 \\ 0 \\ 1 \end{pmatrix} = 4\lambda - 6 + \lambda + 1 = 5\lambda - 5 = 0\), so \(\lambda = 1\) and \(F = (3, 1, 1)\).

\(\overrightarrow{OP'} = 2\overrightarrow{OF} - \overrightarrow{OP} = \begin{pmatrix} 6 - 4 \\ 2 - 4 \\ 2 + 1 \end{pmatrix}\), so \(P' = (2, -2, 3)\).

7 The line \(l\) passes through \(A(1, 0, 2)\) and \(B(3, 4, -2)\).

(a) Find a vector equation of \(l\).

(b) Find the foot of the perpendicular from \(P(4, 3, 2)\) to \(l\), and the distance from \(P\) to \(l\).

(a) \(\overrightarrow{AB} = \begin{pmatrix} 2 \\ 4 \\ -4 \end{pmatrix} = 2\begin{pmatrix} 1 \\ 2 \\ -2 \end{pmatrix}\), so \(\boldsymbol{r} = \begin{pmatrix} 1 \\ 0 \\ 2 \end{pmatrix} + \lambda \begin{pmatrix} 1 \\ 2 \\ -2 \end{pmatrix}\).

(b) \(\overrightarrow{PF} = \begin{pmatrix} \lambda - 3 \\ 2\lambda - 3 \\ -2\lambda \end{pmatrix}\); \(\;\overrightarrow{PF} \cdot \begin{pmatrix} 1 \\ 2 \\ -2 \end{pmatrix} = \lambda - 3 + 4\lambda - 6 + 4\lambda = 9\lambda - 9 = 0\), so \(\lambda = 1\).

\(F = (2, 2, 0)\), \(\;\overrightarrow{PF} = \begin{pmatrix} -2 \\ -1 \\ -2 \end{pmatrix}\), distance \(= 3\).

8 Find the shortest distance from \(P(1, 4, 3)\) to the line \(\boldsymbol{r} = \begin{pmatrix} 2 \\ -1 \\ 0 \end{pmatrix} + \lambda \begin{pmatrix} 3 \\ 1 \\ -2 \end{pmatrix}\). Give your answer to 3 significant figures.

\(\overrightarrow{PF} = \begin{pmatrix} 1 + 3\lambda \\ -5 + \lambda \\ -3 - 2\lambda \end{pmatrix}\); \(\;\overrightarrow{PF} \cdot \begin{pmatrix} 3 \\ 1 \\ -2 \end{pmatrix} = 3 + 9\lambda - 5 + \lambda + 6 + 4\lambda = 14\lambda + 4 = 0\), so \(\lambda = -\dfrac{2}{7}\).

\(\overrightarrow{PF} = \dfrac{1}{7}\begin{pmatrix} 1 \\ -37 \\ -17 \end{pmatrix}\), so the distance is \(\dfrac{\sqrt{1 + 1369 + 289}}{7} = \dfrac{\sqrt{1659}}{7} \approx 5.82\).

9 The line \(l\) is \(\boldsymbol{r} = \begin{pmatrix} 0 \\ 1 \\ 2 \end{pmatrix} + t \begin{pmatrix} 1 \\ 1 \\ -1 \end{pmatrix}\) and \(P\) is \((4, 2, 1)\).

(a) Show that the distance from \(P\) to the point of \(l\) with parameter \(t\) is \(\sqrt{3(t - 2)^2 + 6}\).

(b) Find the two points on \(l\) that are a distance \(3\) from \(P\).

(a) \(\overrightarrow{PR} = \begin{pmatrix} t - 4 \\ t - 1 \\ 1 - t \end{pmatrix}\), so \(|\overrightarrow{PR}|^2 = (t - 4)^2 + 2(t - 1)^2 = 3t^2 - 12t + 18 = 3(t - 2)^2 + 6\).

(b) \(3(t - 2)^2 + 6 = 9 \Rightarrow (t - 2)^2 = 1 \Rightarrow t = 1\) or \(t = 3\). The points are \((1, 2, 1)\) and \((3, 4, -1)\).

10 Find the shortest distance from \(P(3, 4, -1)\) to the line through \((0, 1, 2)\) that is parallel to the \(x\)-axis.

The line is \(\boldsymbol{r} = \begin{pmatrix} 0 \\ 1 \\ 2 \end{pmatrix} + \lambda \begin{pmatrix} 1 \\ 0 \\ 0 \end{pmatrix}\). \(\overrightarrow{PF} \cdot \boldsymbol{i} = \lambda - 3 = 0\), so \(\lambda = 3\) and \(F = (3, 1, 2)\).

\(\overrightarrow{PF} = \begin{pmatrix} 0 \\ -3 \\ 3 \end{pmatrix}\), so the distance is \(\sqrt{18} = 3\sqrt{2}\).