James Ashton MathsFREE MATHEMATICS. OPEN TO EVERYONE.
HomeIB DiplomaA levelAbout
IB Diploma › Maths AA HL › Topic 3: Geometry & trigonometry › Vector equation of a line

Vector equation of a line

Lines in 2D and 3D in vector, parametric and Cartesian form; checking whether a point lies on a line; the angle between lines; motion along a line with constant velocity; and the shortest distance from a point to a line.

AHL 3.143.15HL onlyPaper 1Paper 2≈ 75 min to work through
Before you start: vectors and the scalar product. See Vectors: the basics and The scalar product.

1What you need to know

Tick these off as you go. By the end of the page you should be able to do all of them without notes.

  • Write a line as 𝐫=𝐚+λ𝐛, in parametric form and in Cartesian formAHL 3.14
  • Convert between the three formsAHL 3.14
  • Decide whether a point lies on a lineAHL 3.14
  • Find the angle between two linesAHL 3.14
  • Model motion with 𝐫=𝐚+t𝐯: position, velocity, speed, closest approachAHL 3.15
  • Find the shortest distance from a point to a lineAHL 3.14

2Notes & worked examples

Each idea is followed by a worked example. Try the question yourself first, then reveal the solution one step at a time.

The big idea

To describe a line you need one point on it and a direction. Start at the point 𝐚 and walk any multiple λ of the direction 𝐛: every point you can reach, 𝐫=𝐚+λ𝐛, is on the line. If λ is time and 𝐛 is a velocity, the same equation describes a moving object.

2.1 Three forms of a line

Equation of a line In formula booklet
𝐫=𝐚+λ𝐛{x=a1+λb1y=a2+λb2z=a3+λb3x−a1b1=y−a2b2=z−a3b3

Vector form, parametric form and Cartesian form. 𝐛 is the direction vector.

Worked example 1Paper 1
Write the line through A(1,2,−1) with direction (3−12) in all three forms.
𝐫=(12−1)+λ(3−12)
x=1+3λ, y=2−λ, z=−1+2λ
x−13=y−2−1=z+12
Make λ the subject of each parametric equation.
Worked example 2Paper 1
Write 4−x2=y+15=z in vector form.
Rewrite 4−x2=x−4−2.
The coefficient of x must be +1 before reading off the direction.
Point (4,−1,0), direction (−251)
𝐫=(4−10)+λ(−251)

A line through two points A and B has direction AB→=𝐛−𝐚. The equation of a line is not unique: any point on it and any multiple of the direction will do.

2.2 Is a point on the line?

Worked example 3Paper 1
Does P(7,0,3) lie on the line in WE1?
x: 1+3λ=7⇒λ=2
Check y=2−2=0 ✓ and z=−1+4=3 ✓
The same λ must work for every component.
Yes, P is on the line (at λ=2).

2.3 The angle between two lines

The angle between two lines is the angle between their direction vectors. Take the acute angle, using cosθ=|𝐛1·𝐛2||𝐛1||𝐛2|.

Worked example 4Paper 1
Find the angle between lines with directions (122) and (2−21).
2−4+2=0
The lines are perpendicular: 90°.

2.4 Motion along a line

An object moving with constant velocity 𝐯 from position 𝐚 has position 𝐫=𝐚+t𝐯 at time t. Its speed is |𝐯|. To find the closest approach to a fixed point P, make the vector from P to the object perpendicular to 𝐯.

Worked example 5Paper 1
A ship moves with position 𝐫=(21)+t(34) km after t hours. Find its speed, and its closest distance to a lighthouse at L(11,3).
Speed =|(34)|=5 km h−1
LS→=(−9+3t−2+4t). Perpendicular to the velocity: 3(−9+3t)+4(−2+4t)=0
25t=35⇒t=1.4; ship at (6.2,6.6)
Distance =|(−4.83.6)|=6 km

2.5 Shortest distance from a point to a line

The shortest distance from P to a line is along the perpendicular. Let F be a general point on the line (in terms of λ), set PF→·𝐛=0 to find λ, then find |PF→|.

Worked example 6Paper 1
Find the shortest distance from P(5,0,2) to the line 𝐫=λ(122).
PF→=(λ−52λ2λ−2)
PF→·(122)=9λ−9=0⇒λ=1
F(1,2,2), PF→=(−420), distance 20=25
F is called the foot of the perpendicular.
Worked example 7 (faded)Paper 1
Find the direction vector of the line through A(2,0,1) and B(5,−2,4).
𝐛−𝐚= (3, −2, 3)  ← you work this out
On your TI-Nspire Calculator tricks →

For closest approach on Paper 2, write d(t)=|PS→| as a function of t and find its minimum on a Graphs page. This avoids the algebra but still needs the expression written down.

3Explore it

The line is 𝐫=𝐚+λ𝐛. Move λ to walk along it. The green point is the foot of the perpendicular from P: the closest point on the line.

4Common mistakes & exam tips

Common mistakes

  • Reading the direction from a Cartesian equation without first making each coefficient of x, y, z equal to 1.
  • Using a different value of λ for each component when checking a point.
  • Giving an obtuse angle between lines when the acute angle is wanted.
  • Confusing position and velocity in motion problems: speed is |𝐯|, not |𝐫|.
  • Using the same parameter letter for two different lines.

Exam tips

  • Use different parameters (λ, μ) for different lines from the start.
  • If a Cartesian equation is missing a variable (e.g. z=3), that component of the direction is 0.
  • For closest approach, the condition "PF→ is perpendicular to the direction" earns the method mark.
  • Check your foot of perpendicular by substituting it back into the line equation.

5Practice

Fluency questions build the basics. Problem-solving questions make you think about which method to use.

FluencyP1
Find a vector equation of the line through A(1,0,−2) and B(3,4,0).
𝐫=(10−2)+λ(242)
FluencyP2
Write 𝐫=(2−10)+λ(13−2) in Cartesian form.
x−2=y+13=z−2
FluencyP3
Does (4,5,−4) lie on the line in the previous question?
λ=2: y=5 ✓, z=−4 ✓. Yes.
FluencyP4
A particle has velocity (2−12) m s−1. Find its speed.
3 m s−1
Problem solvingP5
Find the acute angle between 𝐫=λ(110) and 𝐫=μ(011).
cosθ=12: 60°
Problem solvingP6
Find the foot of the perpendicular from (3,1,4) to 𝐫=λ(101).
(λ−3)+(λ−4)=0⇒λ=3.5: (3.5,0,3.5)

6Exam-style questions

Original questions in the style of the IB exam, with full markschemes. Give yourself about 1 minute per mark.

Question 1Paper 1[6 marks]

The line L passes through A(1,−2,3) and B(3,0,−1).

  • (a)Find a vector equation of L.[2]
  • (b)Show that C(7,4,−9) lies on L.[2]
  • (c)Write down a Cartesian equation of L.[2]
(a)
AB→=(22−4)A1
𝐫=(1−23)+λ(22−4)A1
(b)
λ=3 from one componentM1
checks the other two componentsA1
(c)
x−12=y+22=z−3−4A2
Question 2Paper 2[8 marks]

Two boats move with constant velocities. At time t hours their positions, in km, are 𝐫A=t(43) and 𝐫B=(10−2)+t(−15).

  • (a)Find the speed of boat B.[2]
  • (b)Show that the distance between the boats at time t is d(t)=(5t−10)2+(2−2t)2.[2]
  • (c)Find the minimum distance between the boats and the time at which it occurs.[4]
(a)
1+25M1
5.10 km h−1A1
(b)
𝐫A−𝐫B=(5t−102−2t)M1A1
(c)
minimise d(t) or d2M1
t=1.86 hoursA1
1.86 kmA2
Question 3Paper 1[6 marks]

The line L has equation 𝐫=λ(122) and the point P has coordinates (5,0,2).

  • (a)Find the coordinates of the point F on L closest to P.[4]
  • (b)Hence find the shortest distance from P to L.[2]
(a)
PF→=(λ−52λ2λ−2)A1
PF→·(122)=0M1
λ=1A1
F(1,2,2)A1
(b)
|PF→|=16+4M1
25A1

7Check yourself

Six quick questions, marked instantly. Aim for 6/6 before moving on. Fractions like 3/2 are accepted.

8Past-paper practice

Once you're scoring well above, try real IB questions. Your school or teacher will have these papers.

PaperQuestionFocusDifficulty
May 2025 · TZ2 · Paper 1Q2Cartesian to vector form, and intersecting lines★★
Nov 2025 · TZ3 · Paper 1Q10Vector equations of two lines★★
Nov 2024 · Paper 2Q11Minimum distance from the origin to a line★★★
May 2022 · TZ2 · Paper 2Q11Two aircraft moving along lines: closest approach★★★
Spotted a mistake on this page?Tell me and I'll fix it. The button opens an email with this page already named, or write to jamesashtonmaths@gmail.com.
Report a mistake