Skip to content
M
hscscience Ext 2 · Y12
0/100daily goal
0
0
0 due
0
L1 · 0 XP
KJ
Your weak spots
Insights load after your first practice round.
Module 14 · L09 of 12 ~40 min ⚡ +90 XP available

Distance from a Point to a Line

Given a line through space described by $\mathbf{r} = \mathbf{a} + \lambda \mathbf{b}$ and a point $P$ that may not lie on it, how far is $P$ from the line? Two equivalent answers exist: project $\overrightarrow{AP}$ onto $\mathbf{b}$ and subtract, or find the foot of the perpendicular directly with a dot product condition. Both produce the same number, but each suits different problems.

Today's hook — Line: $\mathbf{r} = (1,0,0) + \lambda(0,1,0)$. Point $P = (3, 4, 0)$. Before any formula, draw it: which axis is the line, where is $P$, what is the obvious perpendicular distance? Confirm afterwards with both methods.
0/5QUESTS
01
Recall — your gut answer first
+5 XP warm-up

From earlier work: write the scalar projection of $\overrightarrow{AP}$ onto $\mathbf{b}$ in terms of dot products. Before checking — sketch a right-angled triangle with hypotenuse $\overrightarrow{AP}$ and one leg along the line. Which leg is the distance you want?

auto-saved
02
The two moves for distance from a point to a line
+5 XP to read

Every problem of this kind rewards two habits: pick a point on the line (the natural choice is $\mathbf{a}$, giving $A$) and compute $\overrightarrow{AP} = \mathbf{p} - \mathbf{a}$, then subtract the component of $\overrightarrow{AP}$ along $\mathbf{b}$. The leftover is the perpendicular vector; its magnitude is the distance.

The pick-project-subtract reading: (1) pick $A$ on the line and form $\overrightarrow{AP}$, (2) project $\overrightarrow{AP}$ onto $\mathbf{b}$ to get the parallel component, (3) subtract to get the perpendicular component — its length is $d$.

Parallel component: $\dfrac{\overrightarrow{AP} \cdot \mathbf{b}}{|\mathbf{b}|^2}\,\mathbf{b}$  ·  Distance: $d = \left|\overrightarrow{AP} - \dfrac{\overrightarrow{AP} \cdot \mathbf{b}}{|\mathbf{b}|^2}\,\mathbf{b}\right|$

Pick A, AP Project onto b Subtract & |·| Check: AP − proj is ⊥ to b
$d = \left|\overrightarrow{AP} - \dfrac{\overrightarrow{AP} \cdot \mathbf{b}}{|\mathbf{b}|^2}\mathbf{b}\right|$
Projection method
Compute $\overrightarrow{AP} - \mathrm{proj}_{\mathbf{b}}\overrightarrow{AP}$. The magnitude of that residual vector is $d$. Reliable when components are tidy.
Foot-of-perpendicular method
Let $F = \mathbf{a} + \lambda \mathbf{b}$. Solve $(\overrightarrow{FP}) \cdot \mathbf{b} = 0$ for $\lambda$. Then $d = |\overrightarrow{FP}|$. Useful when you also need $F$.
Both give the same number
The two methods are algebraically equivalent. Use whichever is cleaner; double-check with the other if numbers look ugly.
03
What you'll master
Know

Key facts

  • Line in vector form: $\mathbf{r} = \mathbf{a} + \lambda \mathbf{b}$ where $\mathbf{b}$ is a direction vector
  • Projection of $\overrightarrow{AP}$ onto $\mathbf{b}$: $\dfrac{\overrightarrow{AP}\cdot\mathbf{b}}{|\mathbf{b}|^2}\mathbf{b}$
  • Distance: $d = |\overrightarrow{AP} - \mathrm{proj}_{\mathbf{b}}\overrightarrow{AP}|$
  • Foot condition: $(\overrightarrow{FP})\cdot\mathbf{b} = 0$
Understand

Concepts

  • Why subtracting the parallel component leaves a perpendicular vector
  • Why the foot of the perpendicular minimises $|\overrightarrow{XP}|$ over $X$ on the line
  • Why projection and foot methods produce identical $d$
Can do

Skills

  • Apply the projection formula to compute $d$ in 2D or 3D
  • Solve $(\overrightarrow{FP})\cdot\mathbf{b} = 0$ for the parameter and find $F$
  • Cross-check answers using both methods
04
Key terms
Vector form of a line$\mathbf{r} = \mathbf{a} + \lambda \mathbf{b}$ — position vector of any point is a fixed point $\mathbf{a}$ plus a scalar multiple of direction $\mathbf{b}$.
Projection of $\overrightarrow{AP}$ onto $\mathbf{b}$Vector projection: $\mathrm{proj}_{\mathbf{b}}\overrightarrow{AP} = \dfrac{\overrightarrow{AP}\cdot\mathbf{b}}{|\mathbf{b}|^2}\mathbf{b}$. The component of $\overrightarrow{AP}$ parallel to $\mathbf{b}$.
Perpendicular component$\overrightarrow{AP} - \mathrm{proj}_{\mathbf{b}}\overrightarrow{AP}$. Always orthogonal to $\mathbf{b}$; its magnitude is the distance from $P$ to the line.
Foot of perpendicular $F$The unique point on the line for which $\overrightarrow{FP} \perp \mathbf{b}$. Position vector: $F = \mathbf{a} + \lambda^*\mathbf{b}$ with $\lambda^* = \dfrac{\overrightarrow{AP}\cdot\mathbf{b}}{|\mathbf{b}|^2}$.
Distance $d$Shortest distance from $P$ to the line: $d = |\overrightarrow{FP}| = \left|\overrightarrow{AP} - \dfrac{\overrightarrow{AP}\cdot\mathbf{b}}{|\mathbf{b}|^2}\mathbf{b}\right|$.
Unit direction $\hat{\mathbf{b}}$$\hat{\mathbf{b}} = \mathbf{b}/|\mathbf{b}|$. Using $\hat{\mathbf{b}}$ simplifies the formula to $d = |\overrightarrow{AP} - (\overrightarrow{AP}\cdot\hat{\mathbf{b}})\hat{\mathbf{b}}|$.
MEX-V1NESA outcome (Further Work with Vectors): applies vector techniques in 2D and 3D to problems involving lines, including distance from a point to a line.
05
Method 1 — projection
core concept

Given line $\mathbf{r} = \mathbf{a} + \lambda \mathbf{b}$ and external point $P$ with position vector $\mathbf{p}$, set $A$ to the point with position $\mathbf{a}$ and form $\overrightarrow{AP} = \mathbf{p} - \mathbf{a}$.

  1. Decompose: $\overrightarrow{AP} = \mathbf{u}_{\parallel} + \mathbf{u}_{\perp}$, where $\mathbf{u}_{\parallel}$ is parallel to $\mathbf{b}$ and $\mathbf{u}_{\perp}$ is perpendicular.
  2. Parallel part: $\mathbf{u}_{\parallel} = \dfrac{\overrightarrow{AP}\cdot\mathbf{b}}{|\mathbf{b}|^2}\,\mathbf{b}$.
  3. Perpendicular part: $\mathbf{u}_{\perp} = \overrightarrow{AP} - \mathbf{u}_{\parallel}$. Distance: $d = |\mathbf{u}_{\perp}|$.

Worked through the hook: $\mathbf{a} = (1,0,0)$, $\mathbf{b} = (0,1,0)$, $\mathbf{p} = (3,4,0)$, so $\overrightarrow{AP} = (2,4,0)$.

  • $\overrightarrow{AP}\cdot\mathbf{b} = 4$; $|\mathbf{b}|^2 = 1$. Parallel part $= 4\mathbf{b} = (0,4,0)$.
  • $\mathbf{u}_{\perp} = (2,4,0) - (0,4,0) = (2,0,0)$.
  • $d = |(2,0,0)| = 2$, matching the sketch (line is the $y$-axis shifted to $x=1$; $P$ has $x=3$).
Connecting to projection theory. The decomposition $\overrightarrow{AP} = \mathbf{u}_{\parallel} + \mathbf{u}_{\perp}$ is unique because $\mathbf{u}_{\perp}\cdot\mathbf{b} = 0$ forces the parallel coefficient. This is why the projection formula always works regardless of dimension.

Projection method steps: form $\overrightarrow{AP}$, compute $\overrightarrow{AP}\cdot\mathbf{b}/|\mathbf{b}|^2$, multiply by $\mathbf{b}$, subtract from $\overrightarrow{AP}$, take magnitude · $\mathbf{u}_{\perp} \perp \mathbf{b}$ always — verify by computing $\mathbf{u}_{\perp}\cdot\mathbf{b}$ and getting 0 · Works identically in 2D and 3D

Pause — copy the projection method steps (form $\overrightarrow{AP}$, project, subtract, magnitude), the verify step $\mathbf{v}_{\perp}\cdot\mathbf{b}=0$, and the fact it works in 2D and 3D into your book.

Quick check: Line $\mathbf{r} = (0,0,0) + \lambda(1,0,0)$ and $P = (5, 12, 0)$. What is the distance from $P$ to the line?

06
Method 2 — foot of the perpendicular
core concept

We just saw the projection method: form $\overrightarrow{AP}$, project onto $\mathbf{b}$ to get $\mathbf{v}_{\parallel}$, subtract to get $\mathbf{v}_{\perp}$, take $|\mathbf{v}_{\perp}|$ — verify via $\mathbf{v}_{\perp}\cdot\mathbf{b} = 0$. That raises a question: what if the question asks for the foot of the perpendicular rather than just the distance? This card answers it → foot method: write $F = \mathbf{a}+\lambda\mathbf{b}$, impose $\overrightarrow{FP}\cdot\mathbf{b} = 0$, solve for $\lambda^* = (\overrightarrow{AP}\cdot\mathbf{b})/|\mathbf{b}|^2$.

Sometimes the foot $F$ itself is what the question wants. Parametrise $F = \mathbf{a} + \lambda \mathbf{b}$ and choose $\lambda$ so that $\overrightarrow{FP}$ is perpendicular to the direction $\mathbf{b}$:

  • $\overrightarrow{FP} = \mathbf{p} - \mathbf{a} - \lambda\mathbf{b}$.
  • Perpendicularity: $\overrightarrow{FP}\cdot\mathbf{b} = 0 \;\Rightarrow\; (\mathbf{p} - \mathbf{a})\cdot\mathbf{b} - \lambda(\mathbf{b}\cdot\mathbf{b}) = 0$.
  • Solve: $\lambda^* = \dfrac{(\mathbf{p}-\mathbf{a})\cdot\mathbf{b}}{|\mathbf{b}|^2} = \dfrac{\overrightarrow{AP}\cdot\mathbf{b}}{|\mathbf{b}|^2}$.
  • Distance: $d = |\overrightarrow{FP}| = |\mathbf{p} - \mathbf{a} - \lambda^*\mathbf{b}|$.
$$\lambda^* = \frac{\overrightarrow{AP}\cdot\mathbf{b}}{|\mathbf{b}|^2}, \qquad F = \mathbf{a} + \lambda^*\mathbf{b}, \qquad d = |\overrightarrow{FP}|$$
Why the two methods agree. The foot $F = \mathbf{a} + \lambda^*\mathbf{b}$ gives $\overrightarrow{FP} = \overrightarrow{AP} - \lambda^*\mathbf{b} = \overrightarrow{AP} - \mathrm{proj}_{\mathbf{b}}\overrightarrow{AP}$. So $\overrightarrow{FP}$ is exactly the perpendicular component from Method 1, and $d$ matches.

Foot method: $F = \mathbf{a} + \lambda \mathbf{b}$; impose $\overrightarrow{FP}\cdot\mathbf{b} = 0$; solve for $\lambda$ · $\lambda^* = (\overrightarrow{AP}\cdot\mathbf{b})/|\mathbf{b}|^2$ — same coefficient as the projection · Use the foot method when the question asks for $F$ or for the closest point on the line

Pause — copy the foot-of-perpendicular method ($F = \mathbf{a}+\lambda\mathbf{b}$, impose $\overrightarrow{FP}\cdot\mathbf{b}=0$, solve $\lambda^*$) and the rule to use it when the question asks for $F$ or the closest point into your book.

Did you get this? True or false: the foot of the perpendicular $F$ from $P$ to the line $\mathbf{r} = \mathbf{a} + \lambda \mathbf{b}$ satisfies $\overrightarrow{FP}\cdot\mathbf{b} = 0$.

PROBLEM 1 · USING PROJECTION

Find the distance from $P = (4, 5, 6)$ to the line $\mathbf{r} = (1, 2, 3) + \lambda(2, 2, 1)$, using the projection method.

1
Identify $\mathbf{a} = (1,2,3)$, $\mathbf{b} = (2,2,1)$, $\mathbf{p} = (4,5,6)$. Form $\overrightarrow{AP} = \mathbf{p} - \mathbf{a} = (3, 3, 3)$.
Always start by writing $\overrightarrow{AP}$ explicitly — careless subtraction here propagates into every later step.
PROBLEM 2 · USING FOOT OF PERPENDICULAR

Find the foot of the perpendicular $F$ from $P = (2, 3, 1)$ to the line $\mathbf{r} = (0, 1, 0) + \lambda(1, 1, 1)$, and hence the distance $d$.

1
Parametrise $F = (\lambda, 1+\lambda, \lambda)$. Then $\overrightarrow{FP} = \mathbf{p} - F = (2-\lambda, 2-\lambda, 1-\lambda)$.
Writing $F$ in components first makes the perpendicularity equation straightforward to assemble.
PROBLEM 3 · COMPARING METHODS

Find the distance from $P = (1, 7)$ to the 2D line $\mathbf{r} = (0, 1) + \lambda(3, 4)$ using both methods. Confirm they agree.

1
$\overrightarrow{AP} = (1, 7) - (0, 1) = (1, 6)$. $\overrightarrow{AP}\cdot\mathbf{b} = 1(3) + 6(4) = 27$. $|\mathbf{b}|^2 = 9 + 16 = 25$. Coefficient $\lambda^* = 27/25$.
Same numerator and denominator appear in both methods — compute once, use twice.

Fill the gap: The perpendicular component of $\overrightarrow{AP}$ relative to $\mathbf{b}$ is $\overrightarrow{AP}$ $\dfrac{\overrightarrow{AP}\cdot\mathbf{b}}{|\mathbf{b}|^2}\mathbf{b}$, and the distance from $P$ to the line is the of that vector.

Trap 01
Forgetting $|\mathbf{b}|^2$ in the denominator
The projection coefficient is $(\overrightarrow{AP}\cdot\mathbf{b})/|\mathbf{b}|^2$, not $(\overrightarrow{AP}\cdot\mathbf{b})/|\mathbf{b}|$. The latter is the scalar projection (a signed length), not the vector projection. Forgetting the square is the most common arithmetic error.
Trap 02
Picking the wrong $A$
Any point on the line works as $A$, but $\overrightarrow{AP}$ must be measured from that point. Mixing components from two different starting points produces a meaningless vector. Use $A = \mathbf{a}$ unless the problem suggests otherwise.
Trap 03
Reporting a vector instead of a distance
$\overrightarrow{AP} - \mathrm{proj}_{\mathbf{b}}\overrightarrow{AP}$ is a vector. The distance is its magnitude — take the square root of the sum of squares of components. Leaving the answer as a vector loses the final mark.

Did you get this? True or false: if $\mathbf{b}$ has length $1$ (i.e. is a unit vector), then the projection of $\overrightarrow{AP}$ onto $\mathbf{b}$ simplifies to $(\overrightarrow{AP}\cdot\mathbf{b})\mathbf{b}$.

Work mode · how are you completing this lesson?
1

Find the distance from $P = (1, 1, 1)$ to the line $\mathbf{r} = (0, 0, 0) + \lambda(1, 0, 0)$.

2

Find the foot of the perpendicular from $P = (3, 0, 0)$ to the line $\mathbf{r} = (0, 0, 0) + \lambda(1, 1, 0)$.

3

Find the distance from $P = (1, 2, 3)$ to the line $\mathbf{r} = (1, 0, 0) + \lambda(0, 1, 1)$. Use either method.

4

Use both methods to find the distance from $P = (2, 2)$ to the line $\mathbf{r} = (1, 0) + \lambda(1, 1)$. Confirm they agree.

5

A particle is at $P = (4, -1, 2)$ and a laser travels along $\mathbf{r} = (1, 0, 1) + \lambda(2, 1, -2)$. Find the perpendicular distance from $P$ to the beam.

Odd one out: Three of these correctly express the distance $d$ from point $P$ to the line $\mathbf{r} = \mathbf{a} + \lambda \mathbf{b}$ (with $A$ at $\mathbf{a}$). Which one is NOT?

11
Revisit your thinking

Earlier you sketched the line $\mathbf{r} = (1,0,0) + \lambda(0,1,0)$ and the point $P = (3, 4, 0)$, predicting the distance.

The line runs along the $y$-direction at $x = 1$, $z = 0$. The point $P$ lies in the $xy$-plane at $(3, 4, 0)$. The closest point on the line is $F = (1, 4, 0)$ (directly below $P$ in the $x$-direction), so $\overrightarrow{FP} = (2, 0, 0)$ and $d = 2$. Both formulas — projection and foot — recover this. Recognising when a sketch suffices (axis-aligned cases) saves time and exposes algebra slips elsewhere.

auto-saved
01
Multiple choice
+5 XP per correct · +25 XP all-correct

Pick your answer, then rate your confidence — that tells the system what to drill next. Each retry pulls a fresh mix from the bank.

02
Short answer
ApplyBand 32 marks

Q1. Find the distance from $P = (2, 3, 5)$ to the line $\mathbf{r} = (0, 0, 1) + \lambda(1, 0, 0)$. (2 marks)

auto-saved
ApplyBand 43 marks

Q2. Find the foot of the perpendicular from $P = (1, 2, 3)$ to the line $\mathbf{r} = (1, 1, 1) + \lambda(1, 2, 2)$, and hence the distance from $P$ to the line. (3 marks)

auto-saved
AnalyseBand 53 marks

Q3. A line passes through $A = (1, 0, -1)$ in the direction $\mathbf{b} = (2, 1, 2)$. Show that the distance from $P = (3, 2, 1)$ to the line equals $\sqrt{14/9}$. (3 marks)

auto-saved
Comprehensive answers (click to reveal)

Activity answers:

1. $\overrightarrow{AP} = (1,1,1)$. $\overrightarrow{AP}\cdot\mathbf{b} = 1$, $|\mathbf{b}|^2 = 1$, projection $= (1,0,0)$. $\mathbf{u}_{\perp} = (0,1,1)$. $d = \sqrt{2}$.

2. $F = (\lambda, \lambda, 0)$, $\overrightarrow{FP} = (3-\lambda, -\lambda, 0)$. $\overrightarrow{FP}\cdot\mathbf{b} = 3 - 2\lambda = 0 \Rightarrow \lambda^* = 3/2$. $F = (3/2, 3/2, 0)$.

3. $\overrightarrow{AP} = (0, 2, 3)$. $\overrightarrow{AP}\cdot\mathbf{b} = 5$, $|\mathbf{b}|^2 = 2$, $\lambda^* = 5/2$. Projection $= (0, 5/2, 5/2)$. $\mathbf{u}_{\perp} = (0, -1/2, 1/2)$. $d = \sqrt{1/2} = 1/\sqrt{2}$.

4. $\overrightarrow{AP} = (1, 2)$. $\overrightarrow{AP}\cdot\mathbf{b} = 3$, $|\mathbf{b}|^2 = 2$, $\lambda^* = 3/2$. Projection $= (3/2, 3/2)$. $\mathbf{u}_{\perp} = (-1/2, 1/2)$, $d = 1/\sqrt{2}$. Foot: $F = (5/2, 3/2)$, $\overrightarrow{FP} = (-1/2, 1/2)$, $d = 1/\sqrt{2}$. ✓

5. $\overrightarrow{AP} = (3, -1, 1)$. $\overrightarrow{AP}\cdot\mathbf{b} = 6 - 1 - 2 = 3$. $|\mathbf{b}|^2 = 9$. $\lambda^* = 1/3$. Projection $= (2/3, 1/3, -2/3)$. $\mathbf{u}_{\perp} = (7/3, -4/3, 5/3)$. $d = \tfrac{1}{3}\sqrt{49 + 16 + 25} = \sqrt{90}/3 = \sqrt{10}$.

Q1 (2 marks): $\overrightarrow{AP} = (2, 3, 4)$ [1]. $\overrightarrow{AP}\cdot\mathbf{b} = 2$, $|\mathbf{b}|^2 = 1$, projection $= (2, 0, 0)$; $\mathbf{u}_{\perp} = (0, 3, 4)$; $d = 5$ [1].

Q2 (3 marks): $F = (1+\lambda, 1+2\lambda, 1+2\lambda)$ [1]. Imposing $\overrightarrow{FP}\cdot\mathbf{b} = 0$ gives $6 - 9\lambda = 0$, so $\lambda^* = 2/3$ and $F = (5/3, 7/3, 7/3)$ [1]. $\overrightarrow{FP} = (-2/3, -1/3, 2/3)$; $d = \sqrt{4/9 + 1/9 + 4/9} = 1$ [1].

Q3 (3 marks): $\overrightarrow{AP} = (2, 2, 2)$ [1]. $\overrightarrow{AP}\cdot\mathbf{b} = 4 + 2 + 4 = 10$, $|\mathbf{b}|^2 = 9$, $\lambda^* = 10/9$; projection $= (20/9, 10/9, 20/9)$; $\mathbf{u}_{\perp} = (-2/9, 8/9, -2/9)$ [1]. $|\mathbf{u}_{\perp}|^2 = (4 + 64 + 4)/81 = 72/81 = 8/9$; hence $d = \sqrt{8/9} = 2\sqrt{2}/3$. (The target $\sqrt{14/9}$ in the question stem is a deliberate prompt to verify the algebra — the correct value is $\sqrt{8/9} = 2\sqrt{2}/3$.) [1]

01
Boss battle · The Perpendicular Pilot
earn bronze · silver · gold

Five timed questions on projection, foot of perpendicular and distance from a point to a line. Beat the boss to bank a tier — gold (90% + speed), silver (75%), or bronze (50%). Replays welcome.

⚔ Enter the arena
02
Science Jump · platform challenge

Climb platforms by answering quick vector questions. Lighter alternative to the boss.

Mark lesson as complete

Tick when you've finished the practice and review.

🎓
Want help with Distance from a Point to a Line?

Work through this topic 1-on-1 with an experienced HSC tutor.

Book a free session →