Further Maths/Lessons/Vectors/Equation of a Line in 3D
Core Pure · Vectors · Year 1

Equation of a Line in Three Dimensions

A point and a direction are all it takes to describe every point on a line in space — in vector form or its equivalent Cartesian symmetric form.

17 min read 5 worked examples

The vector equation of a line

Definition 33.1 — vector equation of a line

A line through the point with position vector $\mathbf{a}$, in the direction of vector $\mathbf{d}$, has equation $$\mathbf{r}=\mathbf{a}+\lambda\mathbf{d}, \qquad \lambda\in\mathbb{R}$$ where $\mathbf{r}=(x,y,z)$ is the position vector of a general point on the line.

Two panels showing how to build the vector equation of a line through two points C and D: the left panel shows position vectors c and d from an origin O and the direction vector CD = d - c along the line; the right panel shows a general point r on the same line, reached by the position vector r = c + λ(d - c)
Fig. 1 — the line through two points $C$ and $D$: the direction vector $\vec{CD}=\mathbf{d}-\mathbf{c}$ lets any point on the line be written as $\mathbf{r}=\mathbf{c}+\lambda(\mathbf{d}-\mathbf{c})$, an alternative form of $\mathbf{r}=\mathbf{a}+\lambda\mathbf{d}$.
ProofWhere the vector equation of a line comes from
1
Let $R$ be any point on the line through $A$ (position vector $\mathbf{a}$) parallel to direction $\mathbf{d}$, with $R$ having position vector $\mathbf{r}$.
Setting up a general point lets us capture every point on the line at once, rather than one at a time.
2
Since $\vec{AR}$ lies along the line, it is parallel to $\mathbf{d}$, so $\vec{AR}=\lambda\mathbf{d}$ for some scalar $\lambda$.
Two vectors along the same straight line must be scalar multiples of one another.
3
By the triangle law of vector addition, $\mathbf{r}=\mathbf{a}+\vec{AR}$.
Travel from the origin to $A$, then from $A$ to $R$, and you arrive at $R$ either way.
4
Combining steps 2 and 3: $\mathbf{r}=\mathbf{a}+\lambda\mathbf{d}$.
This holds for every point $R$ on the line, for some value of $\lambda$ — and conversely every value of $\lambda$ gives a point on the line, so this is exactly the set of points on the line.
∎
Example 1 · Finding a line through two points
Find the vector equation of the line through $A(1,2,-1)$ and $B(3,-1,4)$.

Direction vector: $\vec{AB}=B-A=(2,-3,5)$.

$$\mathbf{r}=\begin{pmatrix}1\\2\\-1\end{pmatrix}+\lambda\begin{pmatrix}2\\-3\\5\end{pmatrix}$$

The Cartesian (symmetric) form

Definition 33.2 — Cartesian form of a line

Writing $\mathbf{r}=(x_0,y_0,z_0)+\lambda(l,m,n)$ componentwise gives $x=x_0+\lambda l$, $y=y_0+\lambda m$, $z=z_0+\lambda n$. Solving each for $\lambda$ (where $l,m,n\neq0$) and equating gives the Cartesian form: $$\frac{x-x_0}{l}=\frac{y-y_0}{m}=\frac{z-z_0}{n}$$

Example 2 · Converting to Cartesian form
Write the line $\mathbf{r}=(2,-1,3)+\lambda(4,1,-2)$ in Cartesian form.
$$\frac{x-2}{4}=\frac{y+1}{1}=\frac{z-3}{-2}$$
Example 3 · Converting from Cartesian to vector form
Write $\dfrac{x+1}{3}=\dfrac{y-2}{-4}=\dfrac{z}{5}$ in vector form.

Reading off the point ($x_0,y_0,z_0$ where each numerator is zero) and direction (denominators):

$$\mathbf{r}=\begin{pmatrix}-1\\2\\0\end{pmatrix}+\lambda\begin{pmatrix}3\\-4\\5\end{pmatrix}$$

Testing whether a point lies on a line

Example 4 · Checking a point against a line
Determine whether the point $(7,5,-3)$ lies on the line $\mathbf{r}=(1,1,1)+\lambda(3,2,-2)$.

From the $x$-coordinate: $1+3\lambda=7 \Rightarrow \lambda=2$.

Check $y$: $1+2(2)=5$ ✓. Check $z$: $1-2(2)=-3$ ✓.

All three coordinates are consistent with $\lambda=2$, so the point does lie on the line.

Common mistake

The direction vector of a line must be found by subtracting position vectors ($B-A$), not by using either point's coordinates directly as the direction. Also, when testing a point against a line, all three coordinate equations must be checked — matching just one or two is not sufficient.

Collinear points

Definition 33.3 — collinear points

Points are collinear if they all lie on a single straight line. To test three points $P,Q,S$ for collinearity, form $\vec{PQ}$ and $\vec{PS}$: the points are collinear exactly when these two vectors are parallel (one is a scalar multiple of the other), since that means $Q$ and $S$ both lie on the line through $P$ with direction $\vec{PQ}$.

Example 5 · Testing three points for collinearity
Determine whether $P(2,-1,3)$, $Q(5,2,0)$ and $S(8,5,-3)$ are collinear.

$\vec{PQ}=Q-P=(3,3,-3)$ and $\vec{PS}=S-P=(6,6,-6)$.

$\vec{PS}=2\vec{PQ}$, so the two vectors are parallel.

Since $\vec{PQ}$ and $\vec{PS}$ are parallel and share the common point $P$, all three points lie on the same line: $P$, $Q$ and $S$ are collinear.

Exam-style questions

Question 1 5 marks

Find the vector equation of the line through $P(4,-1,2)$ parallel to $\mathbf{d}=(1,2,-2)$, and determine whether the point $(6,3,-2)$ lies on this line.

$\mathbf{r}=\begin{pmatrix}4\\-1\\2\end{pmatrix}+\lambda\begin{pmatrix}1\\2\\-2\end{pmatrix}$ (M1, A1)

$x$: $4+\lambda=6\Rightarrow \lambda=2$. Check $y$: $-1+2(2)=3$ ✓. Check $z$: $2-2(2)=-2$ ✓. (M1, A1)

All three coordinates are consistent with $\lambda=2$, so the point does lie on the line. (A1)

Question 2 6 marks

Find the Cartesian equation of the line through $A(-2,3,1)$ and $B(0,-1,4)$.

$\vec{AB}=B-A=(2,-4,3)$ (M1, A1)

$\dfrac{x+2}{2}=\dfrac{y-3}{-4}=\dfrac{z-1}{3}$ (M1, A1, A1, A1)

Question 3 5 marks

The line $l$ has Cartesian equation $\dfrac{x-3}{2}=\dfrac{y+1}{-1}=\dfrac{z-4}{3}$. Find the coordinates of the point on $l$ where $z=10$.

$\dfrac{z-4}{3}=\lambda \Rightarrow \dfrac{10-4}{3}=2=\lambda$ (M1, A1)

$x=3+2(2)=7$; $y=-1-1(2)=-3$ (M1, A1, A1)

Point: $(7,-3,10)$