21.1 Equations of a Line

AHL 3.14

In this section you will learn
  • how to write the vector equation of a line, \(\boldsymbol{r} = \boldsymbol{a} + \lambda\boldsymbol{b}\), from a point and a direction
  • how to find the vector equation of a line through two points
  • the parametric and Cartesian forms of a line, and how to change from one form to another
  • what happens when one component of the direction vector is \(0\), and how to write lines along or parallel to the axes

In earlier work, a straight line in the \(x\)-\(y\) plane was fixed by a point and a gradient. In three dimensions there is no single “gradient”, so we use a point and a direction vector instead. The vector tools you need (position vectors, displacement vectors, magnitude) are in Unit 20.

The vector equation of a line

Let \(l\) be the line through the point \(A\) that is parallel to the vector \(\boldsymbol{b}\). Let \(\overrightarrow{OA} = \boldsymbol{a}\), and let \(R\) be any point on \(l\), with \(\overrightarrow{OR} = \boldsymbol{r}\).

Figure 1: The point \(R\) is reached by going to \(A\), then moving along the line by a multiple of \(\boldsymbol{b}\).

Since \(R\) is on the line, \(\overrightarrow{AR}\) is parallel to \(\boldsymbol{b}\), so \(\overrightarrow{AR} = \lambda\boldsymbol{b}\) for some number \(\lambda\). Going from \(O\) to \(A\) and then from \(A\) to \(R\) (Figure 1):

\[ \boldsymbol{r} = \overrightarrow{OR} = \overrightarrow{OA} + \overrightarrow{AR} = \boldsymbol{a} + \lambda\boldsymbol{b} . \]

As \(\lambda\) takes every real value, \(R\) moves along the whole line. The number \(\lambda\) is called a parameter.

Vector equation of a line In the HL formula booklet

\[ \boldsymbol{r} = \boldsymbol{a} + \lambda\boldsymbol{b}, \qquad \lambda \in \mathbb{R} \]

  • \(\boldsymbol{r}\): the position vector of a general point on the line
  • \(\boldsymbol{a}\): the position vector of one fixed point on the line
  • \(\lambda\): the parameter (a real number); each value of \(\lambda\) gives one point on the line
  • \(\boldsymbol{b}\): a direction vector (any non-zero vector parallel to the line)

A line has many vector equations. You may start at any point on the line, and you may use any non-zero multiple of the direction vector. For example, \(\begin{pmatrix} 2 \\ 4 \\ -6 \end{pmatrix}\) and \(\begin{pmatrix} 1 \\ 2 \\ -3 \end{pmatrix}\) give the same direction. It is good practice to simplify the direction vector.

Example 1 Find a vector equation of the line through \(A(3, -2, 5)\) that is parallel to \(\begin{pmatrix} 1 \\ 4 \\ -2 \end{pmatrix}\). Hence find the points on the line given by \(\lambda = 1\) and \(\lambda = -1\).

\[ \boldsymbol{r} = \begin{pmatrix} 3 \\ -2 \\ 5 \end{pmatrix} + \lambda \begin{pmatrix} 1 \\ 4 \\ -2 \end{pmatrix}, \qquad \lambda \in \mathbb{R} \]

\(\lambda = 1\): \(\;\boldsymbol{r} = \begin{pmatrix} 3 + 1 \\ -2 + 4 \\ 5 - 2 \end{pmatrix} = \begin{pmatrix} 4 \\ 2 \\ 3 \end{pmatrix}\), so the point is \((4, 2, 3)\).

\(\lambda = -1\): \(\;\boldsymbol{r} = \begin{pmatrix} 3 - 1 \\ -2 - 4 \\ 5 + 2 \end{pmatrix} = \begin{pmatrix} 2 \\ -6 \\ 7 \end{pmatrix}\), so the point is \((2, -6, 7)\).

The same idea works in two dimensions. For example, \(\boldsymbol{r} = \begin{pmatrix} 1 \\ 5 \end{pmatrix} + \lambda\begin{pmatrix} 2 \\ -1 \end{pmatrix}\) is the line through \((1, 5)\) with gradient \(\dfrac{-1}{2}\), that is \(y = -\dfrac{1}{2}x + \dfrac{11}{2}\).

A line through two points

If the line passes through \(A\) and \(C\), then \(\overrightarrow{AC} = \boldsymbol{c} - \boldsymbol{a}\) is a direction vector.

Figure 2: The vector \(\boldsymbol{c} - \boldsymbol{a} = \overrightarrow{AC}\) is parallel to the line.

Line through two points \(A\) and \(C\) Not in the formula booklet

\[ \boldsymbol{r} = \boldsymbol{a} + \lambda(\boldsymbol{c} - \boldsymbol{a}), \qquad \lambda \in \mathbb{R} \]

  • \(\boldsymbol{r}\): the position vector of a general point on the line
  • \(\boldsymbol{a}\): the position vector of \(A\)
  • \(\lambda\): the parameter (a real number)
  • \(\boldsymbol{c}\): the position vector of \(C\)

The HL booklet gives only \(\boldsymbol{r} = \boldsymbol{a} + \lambda\boldsymbol{b}\): use it with \(\boldsymbol{b} = \overrightarrow{AC}\).

Example 2 Find a vector equation of the line through \(P(2, -1, 3)\) and \(Q(5, 1, -1)\).

Direction vector:

\[ \overrightarrow{PQ} = \begin{pmatrix} 5 - 2 \\ 1 - (-1) \\ -1 - 3 \end{pmatrix} = \begin{pmatrix} 3 \\ 2 \\ -4 \end{pmatrix} . \]

Use \(P\) as the fixed point:

\[ \boldsymbol{r} = \begin{pmatrix} 2 \\ -1 \\ 3 \end{pmatrix} + \lambda \begin{pmatrix} 3 \\ 2 \\ -4 \end{pmatrix}, \qquad \lambda \in \mathbb{R} . \]

Using \(Q\) instead, \(\boldsymbol{r} = \begin{pmatrix} 5 \\ 1 \\ -1 \end{pmatrix} + \mu \begin{pmatrix} 3 \\ 2 \\ -4 \end{pmatrix}\), is also correct. It is the same line; only the value of the parameter at each point changes.

Parametric and Cartesian equations

Write the general point as \(\boldsymbol{r} = \begin{pmatrix} x \\ y \\ z \end{pmatrix}\) and the line as

\[ \begin{pmatrix} x \\ y \\ z \end{pmatrix} = \begin{pmatrix} x_0 \\ y_0 \\ z_0 \end{pmatrix} + \lambda \begin{pmatrix} l \\ m \\ n \end{pmatrix} . \]

Comparing the three components gives the parametric equations. If \(l\), \(m\) and \(n\) are all non-zero, make \(\lambda\) the subject of each one:

\[ \lambda = \frac{x - x_0}{l}, \qquad \lambda = \frac{y - y_0}{m}, \qquad \lambda = \frac{z - z_0}{n} . \]

These are all equal, which removes \(\lambda\) and gives the Cartesian equations.

Three forms of the same line, through \((x_0, y_0, z_0)\) with direction \(\begin{pmatrix} l \\ m \\ n \end{pmatrix}\) In the HL formula booklet

Vector form: \(\quad \boldsymbol{r} = \begin{pmatrix} x_0 \\ y_0 \\ z_0 \end{pmatrix} + \lambda \begin{pmatrix} l \\ m \\ n \end{pmatrix}\)

Parametric form: \(\quad x = x_0 + \lambda l, \quad y = y_0 + \lambda m, \quad z = z_0 + \lambda n\)

Cartesian form: \(\quad \dfrac{x - x_0}{l} = \dfrac{y - y_0}{m} = \dfrac{z - z_0}{n}\)

  • \((x_0, y_0, z_0)\): the coordinates of a fixed point on the line
  • \(l, m, n\): the components of the direction vector
  • \(\boldsymbol{r}\): the position vector of a general point on the line
  • \(\lambda\): the parameter (a real number)
  • \(x, y, z\): the coordinates of a general point on the line

In Cartesian form, the numerators contain the point (with the signs changed) and the denominators are the direction vector. Each numerator must be exactly \(x - (\ldots)\), \(y - (\ldots)\), \(z - (\ldots)\), with coefficient \(+1\).

Example 3 Write down Cartesian equations for each line.

(a) \(\boldsymbol{r} = \begin{pmatrix} 4 \\ -3 \\ 1 \end{pmatrix} + \mu \begin{pmatrix} 5 \\ 2 \\ -3 \end{pmatrix}, \; \mu \in \mathbb{R}\) \(\qquad\) (b) \(\boldsymbol{r} = (2 - \lambda)\boldsymbol{i} + (5 + 3\lambda)\boldsymbol{j} + (4\lambda - 1)\boldsymbol{k}, \; \lambda \in \mathbb{R}\)

(a) Point \((4, -3, 1)\), direction \(\begin{pmatrix} 5 \\ 2 \\ -3 \end{pmatrix}\):

\[ \frac{x - 4}{5} = \frac{y + 3}{2} = \frac{z - 1}{-3} . \]

(b) First read off the parametric equations: \(x = 2 - \lambda\), \(\;y = 5 + 3\lambda\), \(\;z = -1 + 4\lambda\). So the point is \((2, 5, -1)\) and the direction is \(\begin{pmatrix} -1 \\ 3 \\ 4 \end{pmatrix}\).

\[ \frac{x - 2}{-1} = \frac{y - 5}{3} = \frac{z + 1}{4} \]

(This can also be written \(2 - x = \dfrac{y - 5}{3} = \dfrac{z + 1}{4}\).)

When a component of the direction vector is zero

If, say, \(n = 0\), then the third parametric equation is \(z = z_0\) for every value of \(\lambda\). We cannot divide by \(0\), so the Cartesian equations are written in two parts.

Direction with one zero component Not in the formula booklet

If \(\boldsymbol{b} = \begin{pmatrix} l \\ m \\ 0 \end{pmatrix}\) \((l, m \ne 0)\), the Cartesian equations are

\[ \frac{x - x_0}{l} = \frac{y - y_0}{m}, \qquad z = z_0 . \]

The same idea works when \(l = 0\) (then \(x = x_0\)) or \(m = 0\) (then \(y = y_0\)).

  • \(\boldsymbol{b}\): the direction vector of the line
  • \(l, m\): the components of \(\boldsymbol{b}\) (here the \(z\)-component is \(0\))
  • \(x, y, z\): the coordinates of a general point on the line
  • \((x_0, y_0, z_0)\): the coordinates of a fixed point on the line

Example 4 Write down Cartesian equations of the line \(\boldsymbol{r} = \begin{pmatrix} 3 \\ -1 \\ 4 \end{pmatrix} + \lambda \begin{pmatrix} 2 \\ 5 \\ 0 \end{pmatrix}, \; \lambda \in \mathbb{R}\).

Parametric form: \(x = 3 + 2\lambda\), \(\;y = -1 + 5\lambda\), \(\;z = 4\).

The first two give \(\lambda = \dfrac{x - 3}{2} = \dfrac{y + 1}{5}\). The third has no \(\lambda\). So

\[ \frac{x - 3}{2} = \frac{y + 1}{5}, \qquad z = 4 . \]

Every point of this line has \(z = 4\): the line lies in the horizontal plane \(z = 4\).

From Cartesian form to vector form

Read the point from the numerators and the direction from the denominators. Before you do this, check that every numerator has the form \(x - x_0\) (coefficient \(+1\) in front of \(x\), \(y\), \(z\)).

Example 5 Write each line in vector form.

(a) \(\dfrac{x + 2}{4} = \dfrac{3 - y}{2} = \dfrac{z}{5}\) \(\qquad\) (b) \(\dfrac{2x - 1}{6} = \dfrac{y + 4}{3} = 2 - z\)

(a) Rewrite the middle fraction so that \(y\) has coefficient \(+1\): \(\;\dfrac{3 - y}{2} = \dfrac{y - 3}{-2}\). Also \(z = z - 0\). So

\[ \frac{x - (-2)}{4} = \frac{y - 3}{-2} = \frac{z - 0}{5} \quad\Longrightarrow\quad \boldsymbol{r} = \begin{pmatrix} -2 \\ 3 \\ 0 \end{pmatrix} + \lambda \begin{pmatrix} 4 \\ -2 \\ 5 \end{pmatrix}, \; \lambda \in \mathbb{R} . \]

(b) Divide top and bottom of the first fraction by \(2\): \(\;\dfrac{2x - 1}{6} = \dfrac{x - \frac{1}{2}}{3}\). Also \(2 - z = \dfrac{z - 2}{-1}\). So

\[ \frac{x - \frac{1}{2}}{3} = \frac{y + 4}{3} = \frac{z - 2}{-1} \quad\Longrightarrow\quad \boldsymbol{r} = \begin{pmatrix} \frac{1}{2} \\ -4 \\ 2 \end{pmatrix} + \lambda \begin{pmatrix} 3 \\ 3 \\ -1 \end{pmatrix}, \; \lambda \in \mathbb{R} . \]

Check: \(\lambda = 1\) gives \(\left(\frac{7}{2}, -1, 1\right)\), and \(\dfrac{2 \times \frac{7}{2} - 1}{6} = 1\), \(\dfrac{-1 + 4}{3} = 1\), \(2 - 1 = 1\) ✓.

Lines along and parallel to the axes

The coordinate axes are lines through the origin \(O\). Their directions are the unit vectors \(\boldsymbol{i}\), \(\boldsymbol{j}\) and \(\boldsymbol{k}\).

Figure 3: The axes have directions \(\boldsymbol{i}\), \(\boldsymbol{j}\), \(\boldsymbol{k}\). The navy line through \((2, 2, 0)\) is parallel to the \(z\)-axis.

Equations of the axes Not in the formula booklet

Line Vector equation Cartesian equations
\(x\)-axis \(\boldsymbol{r} = \lambda\begin{pmatrix} 1 \\ 0 \\ 0 \end{pmatrix}\) \(y = 0, \; z = 0\)
\(y\)-axis \(\boldsymbol{r} = \lambda\begin{pmatrix} 0 \\ 1 \\ 0 \end{pmatrix}\) \(x = 0, \; z = 0\)
\(z\)-axis \(\boldsymbol{r} = \lambda\begin{pmatrix} 0 \\ 0 \\ 1 \end{pmatrix}\) \(x = 0, \; y = 0\)
  • \(\boldsymbol{r}\): the position vector of a general point on the axis
  • \(\lambda\): the parameter (a real number)

A line parallel to an axis has the same direction vector but a different fixed point. Two of the components of the direction are \(0\), so two coordinates stay constant. For example, the line in Figure 3 is \(\boldsymbol{r} = \begin{pmatrix} 2 \\ 2 \\ 0 \end{pmatrix} + \lambda\begin{pmatrix} 0 \\ 0 \\ 1 \end{pmatrix}\), or \(x = 2,\; y = 2\).

Example 6 (a) Find a vector equation and Cartesian equations of the line through \((4, 1, -3)\) that is parallel to the \(y\)-axis.

(b) Describe the line with Cartesian equations \(x = 2\), \(y = -5\), and write it in vector form.

(a) The direction is \(\boldsymbol{j}\):

\[ \boldsymbol{r} = \begin{pmatrix} 4 \\ 1 \\ -3 \end{pmatrix} + \lambda \begin{pmatrix} 0 \\ 1 \\ 0 \end{pmatrix} . \]

In parametric form, \(x = 4\), \(y = 1 + \lambda\), \(z = -3\). Only \(y\) changes, so the Cartesian equations are \(x = 4\), \(z = -3\).

(b) Here \(x\) and \(y\) are fixed and \(z\) can take any value. So the line is parallel to the \(z\)-axis and passes through \((2, -5, 0)\):

\[ \boldsymbol{r} = \begin{pmatrix} 2 \\ -5 \\ 0 \end{pmatrix} + \lambda \begin{pmatrix} 0 \\ 0 \\ 1 \end{pmatrix} . \]

Common errors

✗ Wrong ✓ Right Why
\(\boldsymbol{r} = \boldsymbol{a} + \lambda\boldsymbol{c}\) for the line through \(A\) and \(C\) \(\boldsymbol{r} = \boldsymbol{a} + \lambda(\boldsymbol{c} - \boldsymbol{a})\) \(\boldsymbol{c}\) is a position vector, not a direction. The direction is \(\overrightarrow{AC}\).
\(\dfrac{x - 4}{5} = \dfrac{y - 3}{2}\) for the point \((4, -3, \ldots)\) \(\dfrac{x - 4}{5} = \dfrac{y + 3}{2}\) The numerator is \(y - y_0 = y - (-3)\).
From \(\dfrac{3 - y}{2}\): direction component \(2\) Direction component \(-2\) First rewrite as \(\dfrac{y - 3}{-2}\).
From \(\dfrac{2x - 1}{6}\): point \(x_0 = 1\), \(l = 6\) \(x_0 = \frac{1}{2}\), \(l = 3\) Divide by \(2\) to make the coefficient of \(x\) equal to \(1\).
\(\dfrac{x - 3}{2} = \dfrac{y + 1}{5} = \dfrac{z - 4}{0}\) \(\dfrac{x - 3}{2} = \dfrac{y + 1}{5}, \; z = 4\) You cannot divide by \(0\). A zero component means that coordinate is constant.

Exercises

1 Find a vector equation of the line through \((4, -1, 2)\) parallel to \(\begin{pmatrix} 3 \\ 0 \\ -5 \end{pmatrix}\). Find the point on the line where \(\lambda = -1\).

\(\boldsymbol{r} = \begin{pmatrix} 4 \\ -1 \\ 2 \end{pmatrix} + \lambda \begin{pmatrix} 3 \\ 0 \\ -5 \end{pmatrix}\). \(\;\lambda = -1\): \(\begin{pmatrix} 4 - 3 \\ -1 \\ 2 + 5 \end{pmatrix}\), the point \((1, -1, 7)\).

2 Find a vector equation and Cartesian equations of the line through \(A(-2, 3, 1)\) and \(B(1, 5, -3)\).

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

Cartesian: \(\dfrac{x + 2}{3} = \dfrac{y - 3}{2} = \dfrac{z - 1}{-4}\).

3 Write the line \(\boldsymbol{r} = \begin{pmatrix} 0 \\ 2 \\ -5 \end{pmatrix} + \mu \begin{pmatrix} 1 \\ -3 \\ 4 \end{pmatrix}\) in parametric form and in Cartesian form.

Parametric: \(x = \mu\), \(\;y = 2 - 3\mu\), \(\;z = -5 + 4\mu\).

Cartesian: \(x = \dfrac{y - 2}{-3} = \dfrac{z + 5}{4}\).

4 Write the line \(\dfrac{x - 6}{2} = \dfrac{y + 4}{5} = \dfrac{1 - z}{3}\) in vector form.

\(\dfrac{1 - z}{3} = \dfrac{z - 1}{-3}\). So the point is \((6, -4, 1)\) and the direction is \(\begin{pmatrix} 2 \\ 5 \\ -3 \end{pmatrix}\):

\[ \boldsymbol{r} = \begin{pmatrix} 6 \\ -4 \\ 1 \end{pmatrix} + \lambda \begin{pmatrix} 2 \\ 5 \\ -3 \end{pmatrix} . \]

5 Write the line \(\dfrac{3x - 6}{6} = \dfrac{2y + 1}{4} = z\) in vector form.

\(\dfrac{3x - 6}{6} = \dfrac{x - 2}{2}\) and \(\dfrac{2y + 1}{4} = \dfrac{y + \frac{1}{2}}{2}\), and \(z = \dfrac{z - 0}{1}\).

\[ \boldsymbol{r} = \begin{pmatrix} 2 \\ -\frac{1}{2} \\ 0 \end{pmatrix} + \lambda \begin{pmatrix} 2 \\ 2 \\ 1 \end{pmatrix} \]

6 Find Cartesian equations of the line \(\boldsymbol{r} = \begin{pmatrix} 5 \\ 2 \\ -1 \end{pmatrix} + \lambda \begin{pmatrix} 3 \\ 0 \\ 4 \end{pmatrix}\).

\(x = 5 + 3\lambda\), \(\;y = 2\), \(\;z = -1 + 4\lambda\). So

\[ \frac{x - 5}{3} = \frac{z + 1}{4}, \qquad y = 2 . \]

7 Find a vector equation of the line with Cartesian equations \(x = 4\), \(\;\dfrac{y - 1}{2} = \dfrac{z + 3}{5}\).

\(x\) is constant, so the first component of the direction is \(0\). The point is \((4, 1, -3)\):

\[ \boldsymbol{r} = \begin{pmatrix} 4 \\ 1 \\ -3 \end{pmatrix} + \lambda \begin{pmatrix} 0 \\ 2 \\ 5 \end{pmatrix} . \]

8 A line passes through \((2, -3, 6)\) and is parallel to the \(z\)-axis.

(a) Write down its vector equation and its Cartesian equations.

(b) Find the point where the line meets the \(x\)-\(y\) plane (\(z = 0\)).

(a) \(\boldsymbol{r} = \begin{pmatrix} 2 \\ -3 \\ 6 \end{pmatrix} + \lambda \begin{pmatrix} 0 \\ 0 \\ 1 \end{pmatrix}\); Cartesian: \(x = 2\), \(y = -3\).

(b) \(z = 6 + \lambda = 0\) gives \(\lambda = -6\), so the point is \((2, -3, 0)\).

9 The line \(l\) passes through \(A(1, 2, 3)\) and is parallel to the line \(\dfrac{x + 1}{4} = \dfrac{y}{-2} = \dfrac{z - 5}{6}\).

(a) Find a vector equation of \(l\), using the simplest direction vector.

(b) Show that \(B(7, -1, 12)\) lies on \(l\).

(a) The direction \(\begin{pmatrix} 4 \\ -2 \\ 6 \end{pmatrix} = 2\begin{pmatrix} 2 \\ -1 \\ 3 \end{pmatrix}\), so \(\boldsymbol{r} = \begin{pmatrix} 1 \\ 2 \\ 3 \end{pmatrix} + \lambda \begin{pmatrix} 2 \\ -1 \\ 3 \end{pmatrix}\).

(b) \(1 + 2\lambda = 7 \Rightarrow \lambda = 3\). Then \(y = 2 - 3 = -1\) ✓ and \(z = 3 + 9 = 12\) ✓. The same \(\lambda\) works for all three coordinates, so \(B\) is on \(l\).

10 In two dimensions, a line passes through \((1, 4)\) and \((5, -2)\).

(a) Find a vector equation of the line.

(b) Find its equation in the form \(y = mx + c\).

(a) Direction \(\begin{pmatrix} 4 \\ -6 \end{pmatrix} = 2\begin{pmatrix} 2 \\ -3 \end{pmatrix}\), so \(\boldsymbol{r} = \begin{pmatrix} 1 \\ 4 \end{pmatrix} + \lambda \begin{pmatrix} 2 \\ -3 \end{pmatrix}\).

(b) The gradient is \(m = \dfrac{-3}{2}\). Then \(y - 4 = -\dfrac{3}{2}(x - 1)\), so \(y = -\dfrac{3}{2}x + \dfrac{11}{2}\).

(Equivalently, \(\dfrac{x - 1}{2} = \dfrac{y - 4}{-3}\).)