How to find scalar and vector projections

When we project one vector onto another, we’re finding how much of the first vector points along the second. We can express that amount as a signed number or as a vector in the direction we’re projecting onto.

Find the signed scalar projection

To project b onto a nonzero vector a, first find a⋅b and divide by the length of a. This is the dot product with a unit vector in the direction of a.

compa(b)=a⋅b|a|

The number is positive when the projection points along a and negative when it points in the opposite direction. It’s zero when the two vectors are perpendicular.

Turn the scalar projection into a vector

Projection of b onto the direction of aVectors a and b start together. A dashed perpendicular from the tip of b meets the direction of a at the tip of the shorter blue projection vector.abproj onto a
The blue vector is the part of b that lies along the direction of a.

Multiply the scalar projection by the unit vector a/|a|. This puts the signed amount in the direction of the line we’re projecting onto.

proja(b)=a⋅b|a|2a

Find both projections in a worked example

Let a=⟨1,2,-3⟩ and b=⟨6,1,0⟩. Find their dot product and the magnitude of a.

a⋅b=6+2+0=8|a|=1+4+9=14

Divide by 14 to get the scalar projection. For the vector projection, divide by |a|2=14 and multiply that factor by a.

compa(b)=814
proja(b)=47⟨1,2,-3⟩=⟨47,87,-127⟩

The scalar projection tells us the signed amount along a. The vector projection gives that part of b in coordinate form.

For a different use of perpendicular directions, see how to find a normal vector to a plane.