Vector equations of lines in 2D and 3D (IB Math AI HL)
Updated October 2026
Quick answer: A line is r = a + λb: a is a point on it and b is its direction. For motion with constant velocity, r = r₀ + tv, where r₀ is the starting position, v the velocity and t the time. To find where two moving objects are closest, write the vector between them in terms of t and minimise its length.
r = a + λb for a line, and r = a + tv for an object moving with constant velocity. HL AI asks where two paths meet or how close two moving objects get. (Equations of planes are AA HL only.)
Practise Vector equations of lines in 2D and 3D with AI marking
Open the full HL AI engine — every question in this unit is worked through with instant AI-graded feedback on your handwritten workings.
In r = r₀ + tv, the speed is |v| and the direction of travel is v. The position after t hours is found by substituting t.
Two paths can cross without the objects meeting: the objects collide only if they are at the same point at the same time t.
To test for a collision, set the two position vectors equal and solve each component for t. A collision needs one value of t that works for every component.
For the closest approach, find d(t) = (position of B) − (position of A), then minimise |d(t)|², a quadratic in t. Differentiating or completing the square both work, and the GDC can find the minimum.
For two lines in 3D with different parameters (λ and μ), solve two components and check the third: if it fails, the lines are skew and never meet.
Worked example
Ship A's position is (2, 1) + t(3, 4) and ship B's position is (14, −3) + t(−1, 5), in km, t hours after noon. Show that the ships do not collide, and find the least distance between them and when it happens.
Collision test: the x-coordinates are equal when 2 + 3t = 14 − t, so t = 3. The y-coordinates are equal when 1 + 4t = −3 + 5t, so t = 4. There is no single time, so the ships do not collide.
Vector from A to B: (14 − t, −3 + 5t) − (2 + 3t, 1 + 4t) = (12 − 4t, t − 4).
5 quick questions on vector equations of lines. No sign-in needed.
Find the acute angle between the lines \(\mathbf{r} = \begin{pmatrix}0 \\ 2 \\ 1\end{pmatrix} + \lambda\begin{pmatrix}1 \\ 1 \\ -2\end{pmatrix}\) and \(\mathbf{r} = \begin{pmatrix}2 \\ 0 \\ 3\end{pmatrix} + \mu\begin{pmatrix}-3 \\ 1 \\ 1\end{pmatrix}\).
Find the acute angle between the lines \(\mathbf{r} = \begin{pmatrix}2 \\ 1 \\ 0\end{pmatrix} + \lambda\begin{pmatrix}3 \\ 0 \\ -4\end{pmatrix}\) and \(\mathbf{r} = \begin{pmatrix}1 \\ 4 \\ 2\end{pmatrix} + \mu\begin{pmatrix}-1 \\ 2 \\ 2\end{pmatrix}\).
A line has equation \(\mathbf{r} = \begin{pmatrix}1 \\ -2 \\ 3\end{pmatrix} + \lambda\begin{pmatrix}2 \\ 1 \\ -1\end{pmatrix}\). Find the point on the line where \(\lambda = 3\).
A line has equation \(\mathbf{r} = \begin{pmatrix}4 \\ 0 \\ -1\end{pmatrix} + \lambda\begin{pmatrix}-1 \\ 3 \\ 2\end{pmatrix}\). Find the point on the line where \(\lambda = 2\).
A line has equation \(\mathbf{r} = \begin{pmatrix}-2 \\ 5 \\ 1\end{pmatrix} + \lambda\begin{pmatrix}3 \\ -2 \\ 4\end{pmatrix}\). Find the point on the line where \(\lambda = -1\).
How do you find the closest approach of two moving objects?
Write each position as a starting point plus t times its velocity, subtract to get the vector between them, and find the value of t that makes its length smallest. Substitute that t back in to find the least distance.
Where can I practise vector equations of lines in 2D and 3D questions?
On the Vectors and Kinematics questions page: 44 exam-style HL AI questions with full mark schemes, plus free step-by-step worked examples.
Can I use my calculator for vector equations of lines in 2D and 3D?
Yes: a GDC is allowed on every HL AI paper, so practise the calculator method as well as the working. The Vectors guide gives the keystrokes for the TI-84 Plus CE, TI-Nspire CX II and Casio fx-CG50.