Skip to main content

Vector projection in HSC Mathematics Extension 2: the scalar projection, the vector projection, resolving a vector into parallel and perpendicular components, and the distance from a point to a line in 3D

Syllabus dot point

“Compute the projection of one vector onto another, distinguishing the scalar projection from the vector projection, and resolve a vector into parallel and perpendicular components”

HSCMaths Extension 2Further Work with Vectors (MEX-V1)13 min read

Quick answer

The scalar projection of a\mathbf{a} onto b\mathbf{b} is a⋅b∣b∣\dfrac{\mathbf{a}\cdot\mathbf{b}}{|\mathbf{b}|}, a signed length. The vector projection is proj⁡ba=a⋅b∣b∣2 b\operatorname{proj}_{\mathbf{b}}\mathbf{a} = \dfrac{\mathbf{a}\cdot\mathbf{b}}{|\mathbf{b}|^2}\,\mathbf{b}, the part of a\mathbf{a} parallel to b\mathbf{b}. The perpendicular component is a−proj⁡ba\mathbf{a} - \operatorname{proj}_{\mathbf{b}}\mathbf{a}, and the two components sum back to a\mathbf{a}. The length of the perpendicular component is the distance from a point to a line.

Jump to a section
  1. What this dot point is asking
  2. The scalar projection
  3. The vector projection
  4. Resolving a vector into components
  5. Distance from a point to a line
  6. How exam questions ask about projection
  7. Exam-style questions

What this dot point is asking

NESA wants you to project one vector onto the direction of another. You must compute the scalar projection (a signed number measuring how much of a\mathbf{a} points along b\mathbf{b}), the vector projection (the actual vector component of a\mathbf{a} along b\mathbf{b}), and use these to split a\mathbf{a} into a part parallel to b\mathbf{b} and a part perpendicular to b\mathbf{b}. In Extension 2 this runs in three dimensions and is the engine behind one headline application: the shortest distance from a point to a line.

The scalar projection

Given vectors a\mathbf{a} and b\mathbf{b} with b≠0\mathbf{b} \neq \mathbf{0}, the scalar projection of a\mathbf{a} onto b\mathbf{b} measures the signed length of the shadow a\mathbf{a} casts on the line through b\mathbf{b}. Since a⋅b=∣a∣∣b∣cos⁡θ\mathbf{a}\cdot\mathbf{b} = |\mathbf{a}||\mathbf{b}|\cos\theta, the scalar projection is

scalar projection=∣a∣cos⁡θ=a⋅b∣b∣.\text{scalar projection} = |\mathbf{a}|\cos\theta = \frac{\mathbf{a}\cdot\mathbf{b}}{|\mathbf{b}|}.

It is positive when the angle θ\theta between the vectors is acute, zero when they are perpendicular, and negative when θ\theta is obtuse. The sign carries genuine information about direction, so it must not be silently dropped.

The vector projection

The vector projection is the scalar projection multiplied by the unit vector in the direction of b\mathbf{b}, namely b^=b∣b∣\hat{\mathbf{b}} = \dfrac{\mathbf{b}}{|\mathbf{b}|}. Thus

proj⁡ba=(a⋅b∣b∣)b∣b∣=a⋅b∣b∣2 b=a⋅bb⋅b b.\operatorname{proj}_{\mathbf{b}}\mathbf{a} = \left(\frac{\mathbf{a}\cdot\mathbf{b}}{|\mathbf{b}|}\right)\frac{\mathbf{b}}{|\mathbf{b}|} = \frac{\mathbf{a}\cdot\mathbf{b}}{|\mathbf{b}|^2}\,\mathbf{b} = \frac{\mathbf{a}\cdot\mathbf{b}}{\mathbf{b}\cdot\mathbf{b}}\,\mathbf{b}.

This is a vector, parallel to b\mathbf{b}, representing the component of a\mathbf{a} lying along b\mathbf{b}. Its magnitude equals the absolute value of the scalar projection, and its direction is along b\mathbf{b} (or against it, when the scalar projection is negative). Geometrically, to project a\mathbf{a} onto b\mathbf{b} you drop a perpendicular from the head of a\mathbf{a} to the line carrying b\mathbf{b} and read off the arrow from OO to the foot. In three dimensions the picture is the same, with the perpendicular now dropping through space.

Projection in three dimensions Vectors a and b from O. A perpendicular dropped from the head of a to the line of b meets it at the foot F. The vector from O to F is the parallel part (the vector projection); the drop from F to the head of a is the perpendicular part. x y z O b a perp part proj of a on b F O to F is the vector projection of a onto b.

Key fact

For non-zero b\mathbf{b}:

scalar projection=a⋅b∣b∣ (a signed number),vector projection=a⋅b∣b∣2 b (a vector).\textbf{scalar projection} = \frac{\mathbf{a}\cdot\mathbf{b}}{|\mathbf{b}|}\ (\text{a signed number}), \qquad \textbf{vector projection} = \frac{\mathbf{a}\cdot\mathbf{b}}{|\mathbf{b}|^2}\,\mathbf{b}\ (\text{a vector}).

The numerator is the same dot product a⋅b\mathbf{a}\cdot\mathbf{b} both times, so compute it once. Note the denominators: ∣b∣|\mathbf{b}| for the scalar, ∣b∣2|\mathbf{b}|^2 for the vector. The magnitude of the vector projection equals the absolute value of the scalar projection.

Resolving a vector into components

Every vector a\mathbf{a} can be split into a part parallel to b\mathbf{b} and a part perpendicular to b\mathbf{b}:

a=a∥+a⊥,a∥=proj⁡ba,a⊥=a−proj⁡ba.\mathbf{a} = \mathbf{a}_{\parallel} + \mathbf{a}_{\perp}, \qquad \mathbf{a}_{\parallel} = \operatorname{proj}_{\mathbf{b}}\mathbf{a}, \qquad \mathbf{a}_{\perp} = \mathbf{a} - \operatorname{proj}_{\mathbf{b}}\mathbf{a}.

The perpendicular component is genuinely perpendicular to b\mathbf{b}. Checking the scalar product confirms it,

a⊥⋅b=a⋅b−a⋅b∣b∣2(b⋅b)=a⋅b−a⋅b=0,\mathbf{a}_{\perp}\cdot\mathbf{b} = \mathbf{a}\cdot\mathbf{b} - \frac{\mathbf{a}\cdot\mathbf{b}}{|\mathbf{b}|^2}(\mathbf{b}\cdot\mathbf{b}) = \mathbf{a}\cdot\mathbf{b} - \mathbf{a}\cdot\mathbf{b} = 0,

since b⋅b=∣b∣2\mathbf{b}\cdot\mathbf{b} = |\mathbf{b}|^2. The slick way to get the perpendicular part is therefore to find the vector projection first, then subtract it from a\mathbf{a}; what is left over must be perpendicular. This decomposition is the foundation for resolving forces in mechanics and for the distance from a point to a line.

Two edge cases worth knowing

  • If a\mathbf{a} is already parallel to b\mathbf{b}, the shadow is all of a\mathbf{a}: proj⁡ba=a\operatorname{proj}_{\mathbf{b}}\mathbf{a} = \mathbf{a} and the perpendicular part is 0\mathbf{0}.
  • If a\mathbf{a} is perpendicular to b\mathbf{b}, then a⋅b=0\mathbf{a}\cdot\mathbf{b} = 0, so both projections are zero: there is no shadow.

A common simplification: if b\mathbf{b} is a unit vector (∣b∣=1|\mathbf{b}| = 1), the formulas collapse to scalar projection =a⋅b= \mathbf{a}\cdot\mathbf{b} and vector projection =(a⋅b) b= (\mathbf{a}\cdot\mathbf{b})\,\mathbf{b}. Because both projections depend only on the direction of b\mathbf{b}, scaling b\mathbf{b} leaves the projection of a\mathbf{a} onto it unchanged.

Distance from a point to a line

The perpendicular component is what makes the distance from a point PP to a line accessible. The shortest distance is the length of the perpendicular dropped from PP to the line, because any slanted segment to the line is the hypotenuse of a right triangle with the perpendicular as one leg, hence longer. Build the construction up one stage at a time.

Stage 1, the line and the point. Take a line through a known point AA with direction d\mathbf{d}, and an external point PP. We want the shortest distance from PP to the line.

Stage 1: a line and a point off it A line through A with direction d, and a point P that is not on the line. We want the shortest distance from P to the line. x y z O the line d A P A line through A with direction d, and a point P off it.

Stage 2, drop the perpendicular. From PP, the perpendicular to the line meets it at the foot FF. There are two equivalent ways to find FF. Either project AP→\overrightarrow{AP} onto d\mathbf{d} to get AF→=proj⁡dAP→\overrightarrow{AF} = \operatorname{proj}_{\mathbf{d}}\overrightarrow{AP}, so F=A+AF→F = A + \overrightarrow{AF}; or write F=A+λdF = A + \lambda\mathbf{d} and impose FP→⋅d=0\overrightarrow{FP}\cdot\mathbf{d} = 0, which gives one equation for λ\lambda. Both encode the same condition: the connector to PP is perpendicular to the direction.

Stage 2: drop the perpendicular to the line From P, the perpendicular to the line meets it at the foot F. The connecting vector FP is perpendicular to the direction d, which fixes F. x y z O the line A P F FP is perpendicular to d; that condition fixes the foot F.

Stage 3, read off the distance. The shortest distance is the length ∣FP→∣|\overrightarrow{FP}| of the perpendicular. Equivalently, it is the magnitude of the perpendicular component of AP→\overrightarrow{AP} relative to d\mathbf{d}, that is ∣AP→−proj⁡dAP→∣\bigl|\overrightarrow{AP} - \operatorname{proj}_{\mathbf{d}}\overrightarrow{AP}\bigr|.

Stage 3: the shortest distance is FP The length of the perpendicular FP is the shortest distance from P to the line. Any other point on the line is further from P. x y z O the line distance A P F The shortest distance from P to the line is the length FP.

How exam questions ask about projection

  • "Find the scalar projection of a\mathbf{a} onto b\mathbf{b}" or "the component of a\mathbf{a} in the direction of b\mathbf{b}": compute a⋅b∣b∣\frac{\mathbf{a}\cdot\mathbf{b}}{|\mathbf{b}|} (a number, possibly negative).
  • "Find the vector projection of a\mathbf{a} onto b\mathbf{b}" or "the projection vector": compute a⋅b∣b∣2b\frac{\mathbf{a}\cdot\mathbf{b}}{|\mathbf{b}|^2}\mathbf{b} (a vector).
  • "Show that a−a⋅bb⋅bb\mathbf{a} - \frac{\mathbf{a}\cdot\mathbf{b}}{\mathbf{b}\cdot\mathbf{b}}\mathbf{b} is perpendicular to b\mathbf{b}": this is the standard HSC phrasing of the perpendicular component; dot it with b\mathbf{b} and get 00.
  • "Resolve a\mathbf{a} into components parallel and perpendicular to b\mathbf{b}": the parallel part is the vector projection; the perpendicular part is a\mathbf{a} minus it.
  • "Find the shortest (perpendicular) distance from the point PP to the line": find the foot FF via the projection or the FP→⋅d=0\overrightarrow{FP}\cdot\mathbf{d} = 0 condition, then report ∣FP→∣|\overrightarrow{FP}|.
  • "Find the component of the force in the direction of motion": a projection of the force onto the direction vector.
Exam technique

Compute a⋅b\mathbf{a}\cdot\mathbf{b} and ∣b∣2|\mathbf{b}|^2 once, then read off whichever projection is asked: scalar uses ∣b∣|\mathbf{b}|, vector uses ∣b∣2|\mathbf{b}|^2. Read the wording word for word: "scalar"/"component"/"how far along" wants a number; "vector projection"/"the shadow"/"resolve into" wants a vector. Keep answers exact (leave 115(1,2)\frac{11}{5}(1, 2) rather than decimalising) unless told otherwise. For a "resolve" question, finish with the two checks markers reward: dot the perpendicular part with b\mathbf{b} to confirm it is 00, and add the two parts to confirm they rebuild a\mathbf{a}. For a distance-to-line question, state clearly that the perpendicular gives the shortest distance and either set FP→⋅d=0\overrightarrow{FP}\cdot\mathbf{d} = 0 or use the perpendicular component; carry all three coordinates throughout.

Project one vector onto another and resolve into components

Project one vector onto another and resolve into components

Project a=3i+4j\mathbf{a} = 3\mathbf{i} + 4\mathbf{j} onto b=i+2j\mathbf{b} = \mathbf{i} + 2\mathbf{j}, finding the vector projection, the scalar projection, and the perpendicular component.

Compute the dot product: The dot product a⋅b\mathbf{a}\cdot\mathbf{b} measures how much of a\mathbf{a} lies along the direction of b\mathbf{b}. It appears in the numerator of both projection formulas, so we calculate it first:

a⋅b=(3)(1)+(4)(2)=3+8=11.\mathbf{a}\cdot\mathbf{b} = (3)(1) + (4)(2) = 3 + 8 = 11.

Find the squared magnitude of b\mathbf{b}: The vector projection divides by ∣b∣2|\mathbf{b}|^2, not ∣b∣|\mathbf{b}|. Computing the squared magnitude directly avoids an unnecessary square root at this stage:

∣b∣2=12+22=5.|\mathbf{b}|^2 = 1^2 + 2^2 = 5.

Compute the vector projection: Substituting into proj⁡ba=a⋅b∣b∣2b\operatorname{proj}_{\mathbf{b}}\mathbf{a} = \frac{\mathbf{a}\cdot\mathbf{b}}{|\mathbf{b}|^2}\mathbf{b} gives the component of a\mathbf{a} that lies exactly along b\mathbf{b}:

proj⁡ba=115(i+2j)=115i+225j.\operatorname{proj}_{\mathbf{b}}\mathbf{a} = \frac{11}{5}(\mathbf{i} + 2\mathbf{j}) = \frac{11}{5}\mathbf{i} + \frac{22}{5}\mathbf{j}.

Compute the scalar projection: The scalar projection divides the same dot product by ∣b∣|\mathbf{b}| rather than ∣b∣2|\mathbf{b}|^2, giving a signed length. Rationalising puts it in surd form:

a⋅b∣b∣=115=1155.\frac{\mathbf{a}\cdot\mathbf{b}}{|\mathbf{b}|} = \frac{11}{\sqrt{5}} = \frac{11\sqrt{5}}{5}.

Find the perpendicular component: Subtract the vector projection from a\mathbf{a} to isolate the part orthogonal to b\mathbf{b}:

a⊥=(3i+4j)−(115i+225j)=45i−25j.\mathbf{a}_{\perp} = (3\mathbf{i} + 4\mathbf{j}) - \left(\tfrac{11}{5}\mathbf{i} + \tfrac{22}{5}\mathbf{j}\right) = \tfrac{4}{5}\mathbf{i} - \tfrac{2}{5}\mathbf{j}.

Verify perpendicularity: Confirm a⊥⋅b=0\mathbf{a}_{\perp}\cdot\mathbf{b} = 0:

a⊥⋅b=45(1)+(−25)(2)=45−45=0.✓\mathbf{a}_{\perp}\cdot\mathbf{b} = \tfrac{4}{5}(1) + \left(-\tfrac{2}{5}\right)(2) = \tfrac{4}{5} - \tfrac{4}{5} = 0. \checkmark

Final answer: vector projection 115i+225j\dfrac{11}{5}\mathbf{i} + \dfrac{22}{5}\mathbf{j}, scalar projection 1155\dfrac{11\sqrt{5}}{5}, perpendicular component 45i−25j\dfrac{4}{5}\mathbf{i} - \dfrac{2}{5}\mathbf{j}.

Distance from a point to a line in 3D

Find the distance from a point to a line in 3D

Find the shortest distance from P(4,5,1)P(4, 5, 1) to the line r=(1,1,1)+λ(2,1,2)\mathbf{r} = (1, 1, 1) + \lambda(2, 1, 2), which passes through A(1,1,1)A(1, 1, 1) with direction d=(2,1,2)\mathbf{d} = (2, 1, 2).

Find the displacement from A to P: The point on the line we anchor to is A(1,1,1)A(1, 1, 1). The displacement is

AP→=P−A=(4−1, 5−1, 1−1)=(3,4,0).\overrightarrow{AP} = P - A = (4 - 1, \, 5 - 1, \, 1 - 1) = (3, 4, 0).

Project AP→\overrightarrow{AP} onto the direction d\mathbf{d}: The vector projection proj⁡dAP→\operatorname{proj}_{\mathbf{d}}\overrightarrow{AP} is the part of AP→\overrightarrow{AP} along the line. Compute the dot product and ∣d∣2|\mathbf{d}|^2:

AP→⋅d=(3)(2)+(4)(1)+(0)(2)=6+4+0=10,∣d∣2=22+12+22=9.\overrightarrow{AP}\cdot\mathbf{d} = (3)(2) + (4)(1) + (0)(2) = 6 + 4 + 0 = 10, \qquad |\mathbf{d}|^2 = 2^2 + 1^2 + 2^2 = 9.

So the parallel component is

proj⁡dAP→=109(2,1,2)=(209,109,209).\operatorname{proj}_{\mathbf{d}}\overrightarrow{AP} = \frac{10}{9}(2, 1, 2) = \left(\tfrac{20}{9}, \tfrac{10}{9}, \tfrac{20}{9}\right).

Subtract to get the perpendicular component: The perpendicular component is AP→\overrightarrow{AP} minus its projection:

AP→⊥=(3,4,0)−(209,109,209)=(79,269,−209).\overrightarrow{AP}_{\perp} = (3, 4, 0) - \left(\tfrac{20}{9}, \tfrac{10}{9}, \tfrac{20}{9}\right) = \left(\tfrac{7}{9}, \tfrac{26}{9}, -\tfrac{20}{9}\right).

The distance is the magnitude of the perpendicular component: The shortest distance from PP to the line is ∣AP→⊥∣|\overrightarrow{AP}_{\perp}|:

∣AP→⊥∣=1972+262+(−20)2=1949+676+400=11259=1559=553.|\overrightarrow{AP}_{\perp}| = \frac{1}{9}\sqrt{7^2 + 26^2 + (-20)^2} = \frac{1}{9}\sqrt{49 + 676 + 400} = \frac{\sqrt{1125}}{9} = \frac{15\sqrt{5}}{9} = \frac{5\sqrt{5}}{3}.

Verify perpendicularity: As a check, the perpendicular component should be orthogonal to d\mathbf{d}:

AP→⊥⋅d=19[(7)(2)+(26)(1)+(−20)(2)]=19(14+26−40)=0.✓\overrightarrow{AP}_{\perp}\cdot\mathbf{d} = \tfrac{1}{9}\bigl[(7)(2) + (26)(1) + (-20)(2)\bigr] = \tfrac{1}{9}(14 + 26 - 40) = 0. \checkmark

Final answer: the shortest distance is 553\dfrac{5\sqrt{5}}{3}.

Common traps

Dividing by ∣b∣|\mathbf{b}| instead of ∣b∣2|\mathbf{b}|^2 in the vector projection. The vector projection has b⋅b=∣b∣2\mathbf{b}\cdot\mathbf{b} = |\mathbf{b}|^2 in the denominator. Only the scalar projection divides by ∣b∣|\mathbf{b}|.

Projecting onto the wrong vector. proj⁡ba\operatorname{proj}_{\mathbf{b}}\mathbf{a} and proj⁡ab\operatorname{proj}_{\mathbf{a}}\mathbf{b} are different vectors. Read carefully which is projected onto which.

Dropping the sign of the scalar projection. A negative scalar projection means a\mathbf{a} points partly against b\mathbf{b}. Reporting only the magnitude loses information.

For a distance, reporting the parallel length instead of the perpendicular length. The shortest distance is the magnitude of the perpendicular component, ∣AP→−proj⁡dAP→∣|\overrightarrow{AP} - \operatorname{proj}_{\mathbf{d}}\overrightarrow{AP}|, not the projection itself.

Forgetting the perpendicular check. Confirming a⊥⋅b=0\mathbf{a}_{\perp}\cdot\mathbf{b} = 0 (or AP→⊥⋅d=0\overrightarrow{AP}_{\perp}\cdot\mathbf{d} = 0) catches arithmetic slips immediately.

Exam-style questions

Questions in the style of NESA exam questions on this dot point, each with a worked answer. They are written by ExamExplained unless tagged "Past paper"; the year shows the paper a question is modelled on.

2024 HSC-style3 marks
The vector a is (1, 2, 3) and the vector b is (2, 0, -4). (i) Find (a . b / (b . b)) b. (ii) Show that a - (a . b / (b . b)) b is perpendicular to b.
Show worked answer →

The expression (a . b / (b . b)) b is the vector projection of a onto b; subtracting it from a leaves the component of a perpendicular to b.

Part (i). Compute the dot products:
a . b = (1)(2) + (2)(0) + (3)(-4) = 2 + 0 - 12 = -10.
b . b = (2)^2 + 0^2 + (-4)^2 = 4 + 0 + 16 = 20.

So a . b / (b . b) = -10/20 = -1/2, and the projection is

(-1/2)(2, 0, -4) = (-1, 0, 2).

Part (ii). The perpendicular component is
a - (-1, 0, 2) = (1 - (-1), 2 - 0, 3 - 2) = (2, 2, 1).

Check it is perpendicular to b by taking the dot product:
(2, 2, 1) . (2, 0, -4) = (2)(2) + (2)(0) + (1)(-4) = 4 + 0 - 4 = 0.

Since the dot product is 0, a - (a . b / (b . b)) b is perpendicular to b.

Mark notes: part (i) 1 mark for the projection (-1, 0, 2). Part (ii): 1 mark for the perpendicular component (2, 2, 1), 1 mark for showing its dot product with b is 0.

2021 HSC-style1 mark
Consider the two non-zero complex numbers z and w as vectors. Which of the following expressions is the projection of z onto w? A. (Re(z times conjugate of w)/|w|^2) w. B. (z/|w|) w. C. Re(z/w) w. D. (Re(z)/|w|^2) w.
Show worked answer →

The vector projection of one vector onto another is (dot product divided by the squared length of the target) times the target: proj = ((z . w)/(w . w)) w.

When complex numbers are treated as vectors, the dot product z . w equals Re(z times conjugate of w), and w . w = |w|^2.

Substituting gives proj = (Re(z times conjugate of w)/|w|^2) w, which is option A.

Options B, C and D do not give a real scalar multiple equal to the projection coefficient (Re(z times conjugate of w))/|w|^2, so they are incorrect.

The answer is A.

Practise this

Sources & how we know this

ExamExplained