Free access until 31 December 2026 · Physics and Maths questions and notes, updated continuously · Build a test

ExaminerPrep › IB Maths AA › Notes

IB Maths AA · Topic 3 · 3.14 · HL only

Vector equation of a line

This note covers the vector equation of a line in two and three dimensions, and the parametric and Cartesian forms that come from it. It also covers using lines to describe motion at constant velocity. A line in space cannot be written as a single equation like \(y=mx+c\), so this vector form is the standard way to describe it.

Key ideas

A line is fixed by a point on it and a direction. Let \(A\) be a known point with position vector \(\mathbf{a}\), and let \(\mathbf{b}\) be a vector parallel to the line. This vector \(\mathbf{b}\) is the direction vector. Then any point on the line has position vector \[\mathbf{r}=\mathbf{a}+\lambda\mathbf{b},\qquad\lambda\in\mathbb{R}.\] The number \(\lambda\) is the parameter. Each value of \(\lambda\) gives one point: \(\lambda=0\) gives \(A\), positive values move along the direction of \(\mathbf{b}\), and negative values move the opposite way.

Line through two points. If the line passes through \(A\) and \(B\), use the direction \(\overrightarrow{AB}=\mathbf{b}-\mathbf{a}\). Then \(\mathbf{r}=\mathbf{a}+\lambda(\mathbf{b}-\mathbf{a})\). Either point can be used as the starting point, and any non-zero multiple of the direction vector can be used. So the same line has many correct vector equations.

Parametric form. Write \(\mathbf{r}=\begin{pmatrix}x\\y\\z\end{pmatrix}\), \(\mathbf{a}=\begin{pmatrix}x_0\\y_0\\z_0\end{pmatrix}\) and \(\mathbf{b}=\begin{pmatrix}l\\m\\n\end{pmatrix}\). Reading off each row gives \[x=x_0+\lambda l,\qquad y=y_0+\lambda m,\qquad z=z_0+\lambda n.\]

Cartesian form. Make \(\lambda\) the subject of each parametric equation and set them equal. If \(l\), \(m\), \(n\) are all non-zero, \[\frac{x-x_0}{l}=\frac{y-y_0}{m}=\frac{z-z_0}{n}.\] If one component of the direction is zero, say \(n=0\), then \(z=z_0\) is a separate equation, and the other two are written as \(\dfrac{x-x_0}{l}=\dfrac{y-y_0}{m}\), \(z=z_0\).

Lines in two dimensions. The same form applies. For example, \(\mathbf{r}=\begin{pmatrix}1\\4\end{pmatrix}+\lambda\begin{pmatrix}2\\-3\end{pmatrix}\) is the line through \((1,4)\) with gradient \(\tfrac{-3}{2}\). Eliminating \(\lambda\) returns a form like \(y=mx+c\).

Testing whether a point is on a line. Substitute the point's coordinates into the three parametric equations and solve for \(\lambda\) from one of them. The point is on the line only if the same \(\lambda\) works in all three equations.

Kinematics. A particle moving at constant velocity \(\mathbf{v}\) from initial position \(\mathbf{r}_0\) has position \(\mathbf{r}=\mathbf{r}_0+t\mathbf{v}\) at time \(t\). This is the vector equation of a line with parameter \(t\). The speed is \(|\mathbf{v}|\), and its direction is \(\mathbf{v}\). Because \(t\) is a time, usually \(t\ge0\), the path is half of the line. The direction vector is the velocity only if the parameter is time. If you rescale the direction vector, the parameter no longer equals time.

Reading a Cartesian form. In \(\dfrac{x-2}{3}=\dfrac{y+1}{4}=\dfrac{z-5}{-2}\), the numbers in the denominators give the direction \(\begin{pmatrix}3\\4\\-2\end{pmatrix}\). The numbers subtracted in the numerators give a point, here \((2,-1,5)\). Be careful with signs: \(y+1\) means \(y_0=-1\).

Same line, different equations. Two vector equations describe the same line if their direction vectors are parallel and a point from one lies on the other. So \(\mathbf{r}=\begin{pmatrix}1\\0\end{pmatrix}+\lambda\begin{pmatrix}2\\2\end{pmatrix}\) and \(\mathbf{r}=\begin{pmatrix}3\\2\end{pmatrix}+\mu\begin{pmatrix}1\\1\end{pmatrix}\) are the same line. Do not worry if your answer looks different from someone else's. Check that the direction is parallel and that a point matches.

Definitions and formulae

Term or formulaMeaning / when to use
\(\mathbf{r}=\mathbf{a}+\lambda\mathbf{b}\)Vector equation: \(\mathbf{a}\) is a point on the line, \(\mathbf{b}\) the direction.
\(\mathbf{r}=\mathbf{a}+\lambda(\mathbf{b}-\mathbf{a})\)Line through the points with position vectors \(\mathbf{a}\) and \(\mathbf{b}\).
\(x=x_0+\lambda l,\ y=y_0+\lambda m,\ z=z_0+\lambda n\)Parametric form; use it to find points or test membership.
\(\dfrac{x-x_0}{l}=\dfrac{y-y_0}{m}=\dfrac{z-z_0}{n}\)Cartesian form; no parameter.
\(\mathbf{r}=\mathbf{r}_0+t\mathbf{v}\)Position at time \(t\) for constant velocity \(\mathbf{v}\).

Worked examples

Example 1 Find a vector equation of the line through \(A(1,-2,4)\) and \(B(3,1,-2)\). Determine whether the point \(C(5,4,-9)\) lies on the line.

Direction: \(\overrightarrow{AB}=\begin{pmatrix}2\\3\\-6\end{pmatrix}\).

Using \(A\) as the starting point: \(\mathbf{r}=\begin{pmatrix}1\\-2\\4\end{pmatrix}+\lambda\begin{pmatrix}2\\3\\-6\end{pmatrix}\).

For \(C\), set \(1+2\lambda=5\), giving \(\lambda=2\).

Check the other rows with \(\lambda=2\): \(y=-2+3(2)=4\), which matches. \(z=4-6(2)=-8\), but \(C\) has \(z=-9\). This does not match.

Answer: \(\mathbf{r}=\begin{pmatrix}1\\-2\\4\end{pmatrix}+\lambda\begin{pmatrix}2\\3\\-6\end{pmatrix}\). The point \(C\) does not lie on the line.

Example 2 Write the line \(\mathbf{r}=\begin{pmatrix}2\\-1\\5\end{pmatrix}+\lambda\begin{pmatrix}3\\4\\-2\end{pmatrix}\) in Cartesian form.

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

Make \(\lambda\) the subject of each: \(\lambda=\dfrac{x-2}{3}\), \(\lambda=\dfrac{y+1}{4}\), \(\lambda=\dfrac{z-5}{-2}\).

Set them equal.

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

Example 3 A ship starts at the point with position vector \(\begin{pmatrix}2\\5\end{pmatrix}\) km and moves with constant velocity \(\begin{pmatrix}4\\-3\end{pmatrix}\) km h\(^{-1}\). Find (a) its speed, (b) its position after 2.5 hours, (c) the time at which its \(x\)-coordinate is 18 km, and its position then.

(a) Speed \(=\sqrt{4^2+(-3)^2}=\sqrt{25}=5\) km h\(^{-1}\).

(b) \(\mathbf{r}=\begin{pmatrix}2\\5\end{pmatrix}+t\begin{pmatrix}4\\-3\end{pmatrix}\). With \(t=2.5\), \(\mathbf{r}=\begin{pmatrix}2+10\\5-7.5\end{pmatrix}=\begin{pmatrix}12\\-2.5\end{pmatrix}\).

(c) Set \(2+4t=18\), so \(t=4\). Then \(y=5-3(4)=-7\).

Answer: (a) 5 km h\(^{-1}\); (b) \((12,-2.5)\) km; (c) at \(t=4\) hours, at \((18,-7)\) km.

Common errors

  • Writing a line using two position vectors without subtracting, for example \(\mathbf{r}=\mathbf{a}+\lambda\mathbf{b}\) with \(\mathbf{b}\) the second point instead of the direction \(\mathbf{b}-\mathbf{a}\).
  • Checking only one coordinate when testing if a point is on a line. All three must give the same \(\lambda\).
  • Leaving out \(\mathbf{r}=\) at the start, so that the equation is not an equation.
  • Getting signs wrong when converting to Cartesian form, for example writing \(\dfrac{y-1}{4}\) instead of \(\dfrac{y+1}{4}\) when \(y_0=-1\).
  • Using the same parameter letter for two different lines in the same problem.

Exam tip: Write the line in parametric form, row by row, before doing anything else. Most follow-up questions, such as finding a point or testing membership, become simple equations.

Check yourself

  1. Write down a vector equation of the line through \((0,3,-1)\) with direction \(\begin{pmatrix}2\\0\\5\end{pmatrix}\).
    Answer\(\mathbf{r}=\begin{pmatrix}0\\3\\-1\end{pmatrix}+\lambda\begin{pmatrix}2\\0\\5\end{pmatrix}\).
  2. Find the point on \(\mathbf{r}=\begin{pmatrix}1\\2\\3\end{pmatrix}+\lambda\begin{pmatrix}2\\-1\\4\end{pmatrix}\) where \(\lambda=-2\).
    Answer\(\begin{pmatrix}1-4\\2+2\\3-8\end{pmatrix}=\begin{pmatrix}-3\\4\\-5\end{pmatrix}\), so the point is \((-3,4,-5)\).
  3. Does \((7,-1,13)\) lie on \(\mathbf{r}=\begin{pmatrix}1\\2\\3\end{pmatrix}+\lambda\begin{pmatrix}2\\-1\\4\end{pmatrix}\)?
    AnswerFrom \(x\): \(1+2\lambda=7\), so \(\lambda=3\). Then \(y=2-3=-1\) and \(z=3+12=15\). The \(z\)-value is 15, not 13, so the point is not on the line.
  4. Find the line in two dimensions \(\mathbf{r}=\begin{pmatrix}1\\4\end{pmatrix}+\lambda\begin{pmatrix}2\\-3\end{pmatrix}\) in the form \(y=mx+c\).
    Answer\(x=1+2\lambda\), so \(\lambda=\tfrac{x-1}{2}\). Then \(y=4-3\cdot\tfrac{x-1}{2}=-\tfrac32x+\tfrac{11}{2}\).