Skip to content
Family Table Math
Auto

Vector Projections

A projection answers the question “how much of a⃗\vec{a} points in the direction of b⃗\vec{b}?” Think of the shadow a⃗\vec{a} casts on the line of b⃗\vec{b} when a light shines straight down onto that line. Projections are how you find the part of a force that pulls along a ramp, the part of the wind that pushes a boat forward, or the part of a pull that does work, and they come straight from the dot product.

Place a⃗\vec{a} and b⃗\vec{b} tail to tail. Drop a perpendicular from the tip of a⃗\vec{a} to the line containing b⃗\vec{b}. The arrow from the common tail to the foot of that perpendicular is the projection of a⃗\vec{a} onto b⃗\vec{b}.

Vector projection of a onto b. A dotted perpendicular drops from the tip of a to the line of b. With an acute angle the projection points the same way as b; with an obtuse angle it points the opposite way. θ a b proj of a onto b acute θ: same direction as b θ a b proj of a onto b obtuse θ: opposite to b
The projection of a⃗\vec{a} onto b⃗\vec{b} (green). It points along b⃗\vec{b} when θ\theta is acute, and the opposite way when θ\theta is obtuse.

The scalar projection of a⃗\vec{a} onto b⃗\vec{b} is the signed length of that shadow. From the right triangle, it’s ∣a⃗∣cos⁡θ|\vec{a}|\cos\theta. Multiply and divide by ∣b⃗∣|\vec{b}| to write it with the dot product:

scalar projection of a⃗ onto b⃗=∣a⃗∣cos⁡θ=a⃗⋅b⃗∣b⃗∣\text{scalar projection of } \vec{a} \text{ onto } \vec{b} = |\vec{a}|\cos\theta = \frac{\vec{a} \cdot \vec{b}}{|\vec{b}|}

It’s positive when θ\theta is acute (the shadow points along b⃗\vec{b}), negative when θ\theta is obtuse (it points the opposite way), and 00 when the vectors are perpendicular.

The vector projection is the shadow as an actual vector. It has length equal to the scalar projection, in the direction of the unit vector b⃗∣b⃗∣\dfrac{\vec{b}}{|\vec{b}|}:

proj⁡b⃗a⃗=(a⃗⋅b⃗∣b⃗∣)b⃗∣b⃗∣=(a⃗⋅b⃗b⃗⋅b⃗)b⃗\operatorname{proj}_{\vec{b}}\vec{a} = \left(\frac{\vec{a} \cdot \vec{b}}{|\vec{b}|}\right)\frac{\vec{b}}{|\vec{b}|} = \left(\frac{\vec{a} \cdot \vec{b}}{\vec{b} \cdot \vec{b}}\right)\vec{b}

The second form is the easiest to use: the bracket is just a number, so the answer is a scalar multiple of b⃗\vec{b}. (Recall b⃗⋅b⃗=∣b⃗∣2\vec{b} \cdot \vec{b} = |\vec{b}|^2.)

Order matters: ”a⃗\vec{a} onto b⃗\vec{b}” divides by b⃗\vec{b}‘s length. The projection of b⃗\vec{b} onto a⃗\vec{a} is a different vector, along a⃗\vec{a}.

Any vector a⃗\vec{a} can be split into a part parallel to b⃗\vec{b} and a part perpendicular to b⃗\vec{b}:

a⃗=proj⁡b⃗a⃗⏟parallel to b⃗+(a⃗−proj⁡b⃗a⃗)⏟perpendicular to b⃗\vec{a} = \underbrace{\operatorname{proj}_{\vec{b}}\vec{a}}_{\text{parallel to } \vec{b}} + \underbrace{\left(\vec{a} - \operatorname{proj}_{\vec{b}}\vec{a}\right)}_{\text{perpendicular to } \vec{b}}

You can check your work: the perpendicular part should have a dot product of 00 with b⃗\vec{b}. This split is exactly what you do with a force on a ramp: one part along the slope, one part pressing into it.

The direction angles of a vector v⃗=[a,b,c]\vec{v} = [a, b, c] are the angles α\alpha, β\beta, γ\gamma it makes with the positive xx-, yy-, and zz-axes. Dot v⃗\vec{v} with i⃗=[1,0,0]\vec{i} = [1, 0, 0] and you get a=∣v⃗∣cos⁡αa = |\vec{v}|\cos\alpha, and likewise for the others, so the direction cosines are

cos⁡α=a∣v⃗∣,cos⁡β=b∣v⃗∣,cos⁡γ=c∣v⃗∣\cos\alpha = \frac{a}{|\vec{v}|}, \qquad \cos\beta = \frac{b}{|\vec{v}|}, \qquad \cos\gamma = \frac{c}{|\vec{v}|}

They’re the components of the unit vector in the direction of v⃗\vec{v}, so cos⁡2α+cos⁡2β+cos⁡2γ=1\cos^2\alpha + \cos^2\beta + \cos^2\gamma = 1. Each component aa, bb, cc is just the scalar projection of v⃗\vec{v} onto an axis.

  • Work. W=F⃗⋅d⃗W = \vec{F} \cdot \vec{d} is the scalar projection of F⃗\vec{F} onto d⃗\vec{d} (the useful part of the force) times the distance ∣d⃗∣|\vec{d}|.
  • Forces on a slope. On a ramp inclined at angle θ\theta, gravity F⃗g\vec{F}_g (pointing straight down) splits into a part along the ramp, of size ∣F⃗g∣sin⁡θ|\vec{F}_g|\sin\theta, and a part into the ramp, of size ∣F⃗g∣cos⁡θ|\vec{F}_g|\cos\theta. Example 4 does this with projections.

Let a⃗=[5,1]\vec{a} = [5, 1] and b⃗=[3,4]\vec{b} = [3, 4]. Find the scalar and vector projections of a⃗\vec{a} onto b⃗\vec{b}, and split a⃗\vec{a} into parts parallel and perpendicular to b⃗\vec{b}.

Solution. a⃗⋅b⃗=15+4=19\vec{a} \cdot \vec{b} = 15 + 4 = 19 and ∣b⃗∣=9+16=5|\vec{b}| = \sqrt{9 + 16} = 5.

scalar projection=195=3.8\text{scalar projection} = \frac{19}{5} = 3.8 proj⁡b⃗a⃗=1925[3,4]=[5725,7625]=[2.28,3.04]\operatorname{proj}_{\vec{b}}\vec{a} = \frac{19}{25}[3, 4] = \left[\frac{57}{25}, \frac{76}{25}\right] = [2.28, 3.04]

The perpendicular part is what’s left over:

a⃗−proj⁡b⃗a⃗=[5−2.28, 1−3.04]=[2.72,−2.04]\vec{a} - \operatorname{proj}_{\vec{b}}\vec{a} = [5 - 2.28,\ 1 - 3.04] = [2.72, -2.04]

Check: [2.72,−2.04]⋅[3,4]=8.16−8.16=0[2.72, -2.04] \cdot [3, 4] = 8.16 - 8.16 = 0, so it really is perpendicular to b⃗\vec{b}. ✓ And the two parts add back to [5,1][5, 1]. ✓

Let a⃗=[2,−1,4]\vec{a} = [2, -1, 4] and b⃗=[1,2,−2]\vec{b} = [1, 2, -2]. Find the scalar and vector projections of a⃗\vec{a} onto b⃗\vec{b}, and explain the sign.

Solution. a⃗⋅b⃗=2−2−8=−8\vec{a} \cdot \vec{b} = 2 - 2 - 8 = -8 and ∣b⃗∣=1+4+4=3|\vec{b}| = \sqrt{1 + 4 + 4} = 3.

scalar projection=−83≈−2.67\text{scalar projection} = \frac{-8}{3} \approx -2.67 proj⁡b⃗a⃗=−89[1,2,−2]=[−89,−169,169]\operatorname{proj}_{\vec{b}}\vec{a} = \frac{-8}{9}[1, 2, -2] = \left[-\frac{8}{9}, -\frac{16}{9}, \frac{16}{9}\right]

The dot product is negative, so the angle between a⃗\vec{a} and b⃗\vec{b} is obtuse. The shadow of a⃗\vec{a} falls behind the tail, and the projection points in the direction opposite to b⃗\vec{b} (it’s a negative multiple of b⃗\vec{b}), like the right-hand diagram above.

Find the direction cosines and direction angles of v⃗=[2,−3,6]\vec{v} = [2, -3, 6], to one decimal place.

Solution. ∣v⃗∣=4+9+36=49=7|\vec{v}| = \sqrt{4 + 9 + 36} = \sqrt{49} = 7.

cos⁡α=27⇒α≈73.4∘cos⁡β=−37⇒β≈115.4∘cos⁡γ=67⇒γ≈31.0∘\begin{aligned} \cos\alpha &= \frac{2}{7} &&\Rightarrow\quad \alpha \approx 73.4^\circ \\ \cos\beta &= -\frac{3}{7} &&\Rightarrow\quad \beta \approx 115.4^\circ \\ \cos\gamma &= \frac{6}{7} &&\Rightarrow\quad \gamma \approx 31.0^\circ \end{aligned}

Check: (27)2+(−37)2+(67)2=4+9+3649=1\left(\dfrac{2}{7}\right)^2 + \left(-\dfrac{3}{7}\right)^2 + \left(\dfrac{6}{7}\right)^2 = \dfrac{4 + 9 + 36}{49} = 1. ✓ The angle with the yy-axis is obtuse because the yy-component is negative.

A 4040 kg box rests on a ramp inclined at 20∘20^\circ. Gravity pulls down on it with a force of 40×9.8=39240 \times 9.8 = 392 N. Find the component of gravity along the ramp and the component pressing into the ramp, to the nearest newton.

A box on a ramp inclined at 20 degrees. The downward force of gravity splits into a component along the ramp, pointing down the slope, and a component perpendicular to the ramp. The angle between gravity and the perpendicular component is also 20 degrees. 20° 20° F (gravity) along the ramp into the ramp
Gravity (blue) splits into a part along the ramp (green) and a part into the ramp (orange).

Solution. Use axes with xx horizontal and yy vertical. Gravity is F⃗=[0,−392]\vec{F} = [0, -392]. A unit vector pointing up the ramp is u⃗=[cos⁡20∘,sin⁡20∘]\vec{u} = [\cos 20^\circ, \sin 20^\circ], and a unit vector pointing out of the ramp (perpendicular to it) is n⃗=[−sin⁡20∘,cos⁡20∘]\vec{n} = [-\sin 20^\circ, \cos 20^\circ]. Since both are unit vectors, the scalar projections are just dot products:

F⃗⋅u⃗=0−392sin⁡20∘≈−134 NF⃗⋅n⃗=0−392cos⁡20∘≈−368 N\begin{aligned} \vec{F} \cdot \vec{u} &= 0 - 392\sin 20^\circ \approx -134 \text{ N} \\ \vec{F} \cdot \vec{n} &= 0 - 392\cos 20^\circ \approx -368 \text{ N} \end{aligned}

So about 134134 N of gravity acts down the ramp (negative means opposite to “up the ramp”), and about 368368 N presses into the ramp. The ramp pushes back with 368368 N, and friction or a person has to supply 134134 N up the slope to stop the box sliding.

Check: 134.072+368.362≈392\sqrt{134.07^2 + 368.36^2} \approx 392 ✓. These match 392sin⁡20∘392\sin 20^\circ and 392cos⁡20∘392\cos 20^\circ from the diagram.

Dividing by the wrong magnitude. The projection of a⃗\vec{a} onto b⃗\vec{b} divides by ∣b⃗∣|\vec{b}| (or b⃗⋅b⃗\vec{b} \cdot \vec{b}), the vector you’re projecting onto. Dividing by ∣a⃗∣|\vec{a}| gives the projection of b⃗\vec{b} onto a⃗\vec{a}, which is a different answer.

Forgetting to square in the vector projection. proj⁡b⃗a⃗=a⃗⋅b⃗∣b⃗∣2b⃗\operatorname{proj}_{\vec{b}}\vec{a} = \dfrac{\vec{a} \cdot \vec{b}}{|\vec{b}|^2}\vec{b}, with ∣b⃗∣|\vec{b}| squared. One factor of ∣b⃗∣|\vec{b}| gives the scalar projection; the second one turns b⃗\vec{b} into a unit vector.

Mixing up the scalar and the vector projection. The scalar projection is a number (possibly negative). The vector projection is a vector along the line of b⃗\vec{b}. If a question asks for “the projection” as a vector, give components.

Dropping the negative sign. A negative scalar projection isn’t an error. It tells you the angle is obtuse and the projection points opposite to b⃗\vec{b}. Don’t take the absolute value unless you’re asked for a length.

Swapping sine and cosine on a ramp. The part of gravity along a slope of angle θ\theta is ∣F⃗g∣sin⁡θ|\vec{F}_g|\sin\theta, not cos⁡θ\cos\theta. Sense check: on a nearly flat ramp (θ\theta close to 0∘0^\circ), almost nothing pulls the box along it, and sin⁡θ\sin\theta is close to 00.

1. (Warm-up) Find the scalar and vector projections of a⃗=[4,−2]\vec{a} = [4, -2] onto b⃗=[3,4]\vec{b} = [3, 4].

Solution

a⃗⋅b⃗=12−8=4\vec{a} \cdot \vec{b} = 12 - 8 = 4 and ∣b⃗∣=5|\vec{b}| = 5.

Scalar projection: 45=0.8\dfrac{4}{5} = 0.8.

Vector projection: 425[3,4]=[1225,1625]=[0.48,0.64]\dfrac{4}{25}[3, 4] = \left[\dfrac{12}{25}, \dfrac{16}{25}\right] = [0.48, 0.64].

2. (Warm-up) ∣a⃗∣=10|\vec{a}| = 10, ∣b⃗∣=4|\vec{b}| = 4, and the angle between them is 150∘150^\circ. Find the scalar projection of a⃗\vec{a} onto b⃗\vec{b}. Does the vector projection point the same way as b⃗\vec{b} or the opposite way?

Solution∣a⃗∣cos⁡θ=10cos⁡150∘=10(−32)=−53≈−8.66|\vec{a}|\cos\theta = 10\cos 150^\circ = 10\left(-\frac{\sqrt{3}}{2}\right) = -5\sqrt{3} \approx -8.66

It’s negative (the angle is obtuse), so the vector projection points opposite to b⃗\vec{b}.

3. (Core) Let a⃗=[1,3,−2]\vec{a} = [1, 3, -2] and b⃗=[2,−1,2]\vec{b} = [2, -1, 2].

  • (a) Find the scalar and vector projections of a⃗\vec{a} onto b⃗\vec{b}.
  • (b) Find the scalar and vector projections of b⃗\vec{b} onto a⃗\vec{a}.
Solution

a⃗⋅b⃗=2−3−4=−5\vec{a} \cdot \vec{b} = 2 - 3 - 4 = -5, ∣a⃗∣=1+9+4=14|\vec{a}| = \sqrt{1 + 9 + 4} = \sqrt{14}, ∣b⃗∣=4+1+4=3|\vec{b}| = \sqrt{4 + 1 + 4} = 3.

(a) Scalar: −53≈−1.67\dfrac{-5}{3} \approx -1.67. Vector: −59[2,−1,2]=[−109,59,−109]\dfrac{-5}{9}[2, -1, 2] = \left[-\dfrac{10}{9}, \dfrac{5}{9}, -\dfrac{10}{9}\right].

(b) Scalar: −514≈−1.34\dfrac{-5}{\sqrt{14}} \approx -1.34. Vector: −514[1,3,−2]=[−514,−1514,57]\dfrac{-5}{14}[1, 3, -2] = \left[-\dfrac{5}{14}, -\dfrac{15}{14}, \dfrac{5}{7}\right].

The two answers are different: projection is not symmetric.

4. (Core) Write F⃗=[10,6]\vec{F} = [10, 6] as the sum of a vector parallel to d⃗=[4,−3]\vec{d} = [4, -3] and a vector perpendicular to d⃗\vec{d}.

Solution

F⃗⋅d⃗=40−18=22\vec{F} \cdot \vec{d} = 40 - 18 = 22 and d⃗⋅d⃗=16+9=25\vec{d} \cdot \vec{d} = 16 + 9 = 25.

parallel part=2225[4,−3]=[3.52,−2.64]\text{parallel part} = \frac{22}{25}[4, -3] = [3.52, -2.64]perpendicular part=[10,6]−[3.52,−2.64]=[6.48,8.64]\text{perpendicular part} = [10, 6] - [3.52, -2.64] = [6.48, 8.64]

Check: [6.48,8.64]⋅[4,−3]=25.92−25.92=0[6.48, 8.64] \cdot [4, -3] = 25.92 - 25.92 = 0. ✓ So F⃗=[3.52,−2.64]+[6.48,8.64]\vec{F} = [3.52, -2.64] + [6.48, 8.64].

5. (Core)

  • (a) Find the direction angles of [1,−1,1][1, -1, 1], to one decimal place.
  • (b) A vector makes an angle of 60∘60^\circ with the xx-axis and 45∘45^\circ with the yy-axis, and an acute angle with the zz-axis. Find that angle.
Solution

(a) The magnitude is 3\sqrt{3}, so cos⁡α=13\cos\alpha = \dfrac{1}{\sqrt{3}}, cos⁡β=−13\cos\beta = -\dfrac{1}{\sqrt{3}}, cos⁡γ=13\cos\gamma = \dfrac{1}{\sqrt{3}}. That gives α≈54.7∘\alpha \approx 54.7^\circ, β≈125.3∘\beta \approx 125.3^\circ, γ≈54.7∘\gamma \approx 54.7^\circ.

(b) Use cos⁡2α+cos⁡2β+cos⁡2γ=1\cos^2\alpha + \cos^2\beta + \cos^2\gamma = 1:

cos⁡2γ=1−(12)2−(22)2=1−14−12=14\cos^2\gamma = 1 - \left(\frac{1}{2}\right)^2 - \left(\frac{\sqrt{2}}{2}\right)^2 = 1 - \frac{1}{4} - \frac{1}{2} = \frac{1}{4}

γ\gamma is acute, so cos⁡γ=12\cos\gamma = \dfrac{1}{2} and γ=60∘\gamma = 60^\circ.

6. (Core) A sailboat is heading northeast. The wind pushes on its sail with a force of F⃗=[300,400]\vec{F} = [300, 400] N, where the components are east and north. Taking the boat’s heading as the direction d⃗=[1,1]\vec{d} = [1, 1], find the component of the wind’s force along the heading, to the nearest newton.

Solution

This is the scalar projection of F⃗\vec{F} onto d⃗\vec{d}:

F⃗⋅d⃗∣d⃗∣=300+4002=7002≈495 N\frac{\vec{F} \cdot \vec{d}}{|\vec{d}|} = \frac{300 + 400}{\sqrt{2}} = \frac{700}{\sqrt{2}} \approx 495 \text{ N}

7. (Core) A 5050 N force pulls a cart 1212 m along a straight track. The force acts at 40∘40^\circ to the track. Find the scalar projection of the force onto the direction of motion, and use it to find the work done, each to one decimal place.

Solution

Scalar projection: 50cos⁡40∘≈38.350\cos 40^\circ \approx 38.3 N. That’s the part of the force pulling along the track.

Work: W=50cos⁡40∘×12≈459.6W = 50\cos 40^\circ \times 12 \approx 459.6 J. (The same as ∣F⃗∣∣d⃗∣cos⁡θ|\vec{F}||\vec{d}|\cos\theta.)

8. (Challenge) Let A(1,0,2)A(1, 0, 2), B(4,4,2)B(4, 4, 2), and C(1,6,10)C(1, 6, 10).

  • (a) Find the scalar projection of AB→\overrightarrow{AB} onto AC→\overrightarrow{AC}.
  • (b) Find the point DD on the line ACAC that is closest to BB (the foot of the perpendicular from BB).
  • (c) Find the distance from BB to the line ACAC, to two decimal places.
Solution

AB→=[3,4,0]\overrightarrow{AB} = [3, 4, 0] and AC→=[0,6,8]\overrightarrow{AC} = [0, 6, 8], so AB→⋅AC→=0+24+0=24\overrightarrow{AB} \cdot \overrightarrow{AC} = 0 + 24 + 0 = 24 and ∣AC→∣=10|\overrightarrow{AC}| = 10.

(a) Scalar projection: 2410=2.4\dfrac{24}{10} = 2.4.

(b) The vector projection is 24100[0,6,8]=[0,1.44,1.92]\dfrac{24}{100}[0, 6, 8] = [0, 1.44, 1.92]. Starting at AA:

D=(1+0, 0+1.44, 2+1.92)=(1,1.44,3.92)D = (1 + 0,\ 0 + 1.44,\ 2 + 1.92) = (1, 1.44, 3.92)

(c) The distance is the length of the perpendicular part, DB→=AB→−[0,1.44,1.92]=[3,2.56,−1.92]\overrightarrow{DB} = \overrightarrow{AB} - [0, 1.44, 1.92] = [3, 2.56, -1.92]:

∣DB→∣=9+6.5536+3.6864=19.24≈4.39|\overrightarrow{DB}| = \sqrt{9 + 6.5536 + 3.6864} = \sqrt{19.24} \approx 4.39

Check: [3,2.56,−1.92]⋅[0,6,8]=0+15.36−15.36=0[3, 2.56, -1.92] \cdot [0, 6, 8] = 0 + 15.36 - 15.36 = 0. ✓

9. (Challenge) Show that for any non-zero scalar kk, the vector projection of a⃗\vec{a} onto kb⃗k\vec{b} is the same as the vector projection of a⃗\vec{a} onto b⃗\vec{b}. What happens to the scalar projection when kk is negative? Explain why this makes sense.

Solutionproj⁡kb⃗a⃗=a⃗⋅(kb⃗)(kb⃗)⋅(kb⃗) (kb⃗)=k(a⃗⋅b⃗)k2(b⃗⋅b⃗) kb⃗=a⃗⋅b⃗b⃗⋅b⃗ b⃗=proj⁡b⃗a⃗\operatorname{proj}_{k\vec{b}}\vec{a} = \frac{\vec{a} \cdot (k\vec{b})}{(k\vec{b}) \cdot (k\vec{b})}\,(k\vec{b}) = \frac{k(\vec{a} \cdot \vec{b})}{k^2(\vec{b} \cdot \vec{b})}\,k\vec{b} = \frac{\vec{a} \cdot \vec{b}}{\vec{b} \cdot \vec{b}}\,\vec{b} = \operatorname{proj}_{\vec{b}}\vec{a}

The scalar projection onto kb⃗k\vec{b} is

a⃗⋅(kb⃗)∣kb⃗∣=k∣k∣⋅a⃗⋅b⃗∣b⃗∣\frac{\vec{a} \cdot (k\vec{b})}{|k\vec{b}|} = \frac{k}{|k|} \cdot \frac{\vec{a} \cdot \vec{b}}{|\vec{b}|}

For k<0k \lt 0, k∣k∣=−1\dfrac{k}{|k|} = -1, so the scalar projection changes sign. That makes sense: kb⃗k\vec{b} lies on the same line as b⃗\vec{b}, so the shadow of a⃗\vec{a} on that line is the same and the vector projection doesn’t change. But the scalar projection measures the shadow as positive or negative relative to the direction of the vector you project onto, and a negative kk flips that direction.