Projection Vector — Formula, Derivation, and Examples

#Geometry
TL;DR
The projection vector of $\vec{a}$ onto $\vec{b}$ is the "shadow" $\vec{a}$ casts along the direction of $\vec{b}$, given by $\text{proj}_{\vec{b}},\vec{a} = \left(\dfrac{\vec{a}\cdot\vec{b}}{|\vec{b}|^2}\right)\vec{b}$. This article covers the projection formula and its derivation, the difference between scalar and vector projection, what a negative projection means, and worked examples.
BT
Bhanzu TeamLast updated on June 25, 20268 min read

What Is A Projection Vector?

The projection vector of $\vec{a}$ onto $\vec{b}$ is the component of $\vec{a}$ that lies in the direction of $\vec{b}$ — the vector you get by dropping a perpendicular from the tip of $\vec{a}$ onto the line of $\vec{b}$. It is itself a vector: it has a magnitude and a direction (the direction of $\vec{b}$).

Two related quantities share the name "projection," and keeping them apart is half the battle:

  • The scalar projection (also called the component) is a single signed number — how long the shadow is.

  • The vector projection is that length attached to $\vec{b}$'s direction — the shadow itself, as a vector.

You get the vector projection by multiplying the scalar projection by the unit vector $\hat{b}$.

What Is The Projection Vector Formula?

The scalar projection of $\vec{a}$ onto $\vec{b}$ is:

$$\text{comp}_{\vec{b}},\vec{a} = |\vec{a}|\cos\theta = \frac{\vec{a}\cdot\vec{b}}{|\vec{b}|}$$

The vector projection is the scalar projection pointed along $\hat{b}$:

$$\text{proj}_{\vec{b}},\vec{a} = \left(\frac{\vec{a}\cdot\vec{b}}{|\vec{b}|^2}\right)\vec{b}$$

Variable glossary. $\vec{a}$ is the vector being projected; $\vec{b}$ is the direction projected onto; $\theta$ is the angle between them; $\vec{a}\cdot\vec{b}$ is the dot product; $|\vec{b}|$ is the magnitude of $\vec{b}$; $\hat{b} = \frac{\vec{b}}{|\vec{b}|}$ is the unit vector along $\vec{b}$.

Notice the two formulas differ by one factor of $|\vec{b}|$ and the direction $\vec{b}$: the scalar version divides by $|\vec{b}|$ once and stops at a number; the vector version divides by $|\vec{b}|^2$ and multiplies back by $\vec{b}$ to point the result.

Where Does The Formula Come From?

Draw $\vec{a}$ and $\vec{b}$ from a common point $O$, with angle $\theta$ between them. Drop a perpendicular from the tip of $\vec{a}$ to the line carrying $\vec{b}$, meeting it at $L$. The segment $OL$ is the length of the projection.

In right triangle $OAL$, the side $OL$ is adjacent to $\theta$:

$$\cos\theta = \frac{OL}{|\vec{a}|} \quad\Rightarrow\quad OL = |\vec{a}|\cos\theta$$

The dot product gives a way to express $|\vec{a}|\cos\theta$ without measuring the angle. Since $\vec{a}\cdot\vec{b} = |\vec{a}|,|\vec{b}|\cos\theta$, dividing both sides by $|\vec{b}|$ isolates the scalar projection:

$$OL = |\vec{a}|\cos\theta = \frac{\vec{a}\cdot\vec{b}}{|\vec{b}|}$$

To turn that length into a vector, attach it to the unit vector $\hat{b} = \frac{\vec{b}}{|\vec{b}|}$:

$$\text{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}|^2}\right)\vec{b}$$

What Does A Negative Projection Mean?

The scalar projection is signed. When the angle $\theta$ between the vectors is less than $90°$, $\cos\theta$ is positive and the projection points the same way as $\vec{b}$. When $\theta$ is greater than $90°$, $\cos\theta$ is negative, the scalar projection comes out negative, and the vector projection points opposite to $\vec{b}$. When $\theta = 90°$ exactly, the projection is zero — the vectors are perpendicular and $\vec{a}$ casts no shadow along $\vec{b}$. (For the full angle story, see angle between vectors.)

Examples of Projection Vector

Example 1

Find the scalar projection of $\vec{a} = 3,\hat{i} + 4,\hat{j}$ onto $\vec{b} = \hat{i}$.

$$\vec{a}\cdot\vec{b} = (3)(1) + (4)(0) = 3, \qquad |\vec{b}| = 1$$ $$\text{comp}_{\vec{b}},\vec{a} = \frac{3}{1} = 3$$

Final answer: $3$. Projecting onto the $x$-axis just reads off the $x$-component, as expected.

Example 2

Find the vector projection of $\vec{a} = 4,\hat{i} + \hat{j}$ onto $\vec{b} = 2,\hat{i} + 2,\hat{j}$.

Wrong attempt. A student divides by $|\vec{b}|$ once and forgets the second factor, writing $\text{proj} = \frac{\vec{a}\cdot\vec{b}}{|\vec{b}|},\vec{b} = \frac{10}{\sqrt{8}}(2,\hat{i} + 2,\hat{j})$. That over-scales the result — it multiplies a length by a full vector instead of a unit vector, so the answer is $\sqrt{8}$ times too long.

Correct. Use $|\vec{b}|^2$ in the denominator, which pairs with the $\vec{b}$ on the outside.

$$\vec{a}\cdot\vec{b} = (4)(2) + (1)(2) = 10$$ $$|\vec{b}|^2 = 2^2 + 2^2 = 8$$ $$\text{proj}{\vec{b}},\vec{a} = \frac{10}{8}(2,\hat{i} + 2,\hat{j}) = \frac{5}{4}(2,\hat{i} + 2,\hat{j})$$ $$\text{proj}{\vec{b}},\vec{a} = \frac{5}{2},\hat{i} + \frac{5}{2},\hat{j}$$

Final answer: $\dfrac{5}{2},\hat{i} + \dfrac{5}{2},\hat{j}$.

Example 3

Find the scalar projection of $\vec{a} = 4,\hat{i} + 2,\hat{j} + \hat{k}$ onto $\vec{b} = 5,\hat{i} - 3,\hat{j} + 3,\hat{k}$.

$$\vec{a}\cdot\vec{b} = (4)(5) + (2)(-3) + (1)(3) = 20 - 6 + 3 = 17$$ $$|\vec{b}| = \sqrt{5^2 + (-3)^2 + 3^2} = \sqrt{43}$$ $$\text{comp}_{\vec{b}},\vec{a} = \frac{17}{\sqrt{43}}$$

Final answer: $\dfrac{17}{\sqrt{43}} \approx 2.59$.

Example 4

Find the scalar projection of $\vec{a} = \hat{i} + 2,\hat{j}$ onto $\vec{b} = -2,\hat{i} - \hat{j}$.

$$\vec{a}\cdot\vec{b} = (1)(-2) + (2)(-1) = -2 - 2 = -4$$ $$|\vec{b}| = \sqrt{(-2)^2 + (-1)^2} = \sqrt{5}$$ $$\text{comp}_{\vec{b}},\vec{a} = \frac{-4}{\sqrt{5}} \approx -1.79$$

The result is negative, so $\vec{a}$ has a component pointing against $\vec{b}$ — the angle between them is obtuse.

Final answer: $\dfrac{-4}{\sqrt{5}} \approx -1.79$.

Example 5

Project $\vec{a} = 3,\hat{i} + 4,\hat{j}$ onto $\vec{b} = -4,\hat{i} + 3,\hat{j}$.

$$\vec{a}\cdot\vec{b} = (3)(-4) + (4)(3) = -12 + 12 = 0$$ $$\text{proj}_{\vec{b}},\vec{a} = \frac{0}{|\vec{b}|^2},\vec{b} = \vec{0}$$

The dot product is zero, so the vectors are perpendicular and the projection is the zero vector.

Final answer: $\vec{0}$ — no shadow, because $\vec{a} \perp \vec{b}$.

Example 6

A $20\ \text{N}$ force pulls a sled along a rope at $60°$ above the ground. How much of the force acts horizontally (along the ground)?

The horizontal direction is the projection direction, and $\cos 60° = \frac{1}{2}$.

$$F_{\text{horizontal}} = |\vec{F}|\cos\theta = 20\cos 60°$$ $$F_{\text{horizontal}} = 20 \times \frac{1}{2} = 10\ \text{N}$$

Final answer: $10\ \text{N}$ pulls the sled forward; the rest lifts it.

Why Projection Vectors Matter: "Aplitting A Force Into The Part That Counts"

The projection vector exists to answer one recurring question — how much of this vector acts in that direction? — and the answer drives a surprising amount of applied math. Pulling a sled by an angled rope (Example 6), only the horizontal projection does useful work; the vertical part just lifts. A block on a ramp feels gravity split into a component down the slope (which slides it) and a component into the slope (which presses it). In machine learning, projecting data onto a chosen direction is the core move behind dimensionality reduction.

The deeper payoff is decomposition: every vector $\vec{a}$ splits cleanly into the part along $\vec{b}$ (the projection) and the part perpendicular to it. Subtract the projection from $\vec{a}$ and what remains is exactly the perpendicular component. That split is the reverse of vector addition — instead of combining two vectors into a resultant, you're pulling one vector apart into two useful directions.

What Are The most Common Mistakes With Projection Vectors?

Mistake 1: Using $|\vec{b}|$ instead of $|\vec{b}|^2$ for the vector projection

Where it slips in: computing the vector projection (not the scalar one).

Don't do this: writing $\text{proj}_{\vec{b}},\vec{a} = \frac{\vec{a}\cdot\vec{b}}{|\vec{b}|},\vec{b}$. The first instinct is to copy the scalar-projection denominator and tack on $\vec{b}$ — but that multiplies a length by a full-length vector and over-scales the result by a factor of $|\vec{b}|$.

The correct way: the vector projection divides by $|\vec{b}|^2$. Deriving it once as "scalar projection times the unit vector $\hat{b}$" — rather than memorising a denominator — means you never lose track of which power of $|\vec{b}|$ belongs where.

Mistake 2: Projecting onto the wrong vector

Where it slips in: the phrase "projection of $\vec{a}$ onto $\vec{b}$."

Don't do this: swapping the roles and computing the projection of $\vec{b}$ onto $\vec{a}$. The projection is not symmetric — $\text{proj}{\vec{b}},\vec{a} \neq \text{proj}{\vec{a}},\vec{b}$ in general — and the memorizer who knows the formula but not which vector is "the direction" lands on the wrong one.

The correct way: the vector after the word "onto" is the direction $\vec{b}$ — it goes in the denominator and supplies the final direction. The vector being projected, $\vec{a}$, is the one whose shadow you want.

Mistake 3: Dropping the sign of a negative projection

Where it slips in: obtuse-angle cases where $\vec{a}\cdot\vec{b}$ is negative.

Don't do this: taking an absolute value out of habit and reporting the projection as positive. A negative scalar projection is information — it says the component points opposite to $\vec{b}$.

The correct way: keep the sign. As Example 4 shows, a negative result means the angle is obtuse and the projection runs against $\vec{b}$.

The everyday version of Mistake 3 is the ramp problem in physics: ignore the sign or direction of the component and you'll predict a block sliding up a slope that's actually pulling it down. The math is the same as the inclined-plane force split — and getting the direction wrong there is how a calculation that looks tidy sends a load the wrong way.

Conclusion

  • The projection vector of $\vec{a}$ onto $\vec{b}$ is $\text{proj}_{\vec{b}},\vec{a} = \left(\dfrac{\vec{a}\cdot\vec{b}}{|\vec{b}|^2}\right)\vec{b}$.

  • The scalar projection $\dfrac{\vec{a}\cdot\vec{b}}{|\vec{b}|}$ is a signed number; the vector projection attaches that number to $\hat{b}$.

  • A negative projection means an obtuse angle — the component points opposite to $\vec{b}$; a zero projection means the vectors are perpendicular.

  • Projection is not symmetric: projecting $\vec{a}$ onto $\vec{b}$ differs from projecting $\vec{b}$ onto $\vec{a}$.

  • The most common mistake is using $|\vec{b}|$ instead of $|\vec{b}|^2$ in the vector-projection formula.

A Practical Next Step

Practice these problems to solidify your understanding: pick two vectors, compute both the scalar and the vector projection, and check the sign against the angle between them. If the vector-projection denominator trips you up, return to Example 2 and the derivation. From here, the angle between vectors and the vectors overview round out the toolkit.

Want a live Bhanzu trainer to walk through more projection-vector problems? Book a free demo class.

Was this article helpful?

Your feedback helps us write better content

Frequently Asked Questions

What's the difference between scalar projection and vector projection?
The scalar projection is a single signed number — the length of the shadow. The vector projection is that length pointed along $\vec{b}$, so it's an actual vector with a direction.
Can a projection vector point opposite to the direction it's projected onto?
A vector isn't "negative," but a vector projection can point opposite to $\vec{b}$ when the scalar projection is negative (the angle is obtuse). The scalar projection itself can absolutely be negative or zero.
Why is the vector projection formula divided by the magnitude squared?
Because it's the scalar projection (one division by $|\vec{b}|$) multiplied by the unit vector $\hat{b} = \frac{\vec{b}}{|\vec{b}|}$ (a second division by $|\vec{b}|$). Two divisions by $|\vec{b}|$ give $|\vec{b}|^2$.
What does a zero projection tell you?
That the two vectors are perpendicular. Their dot product is zero, so $\vec{a}$ has no component along $\vec{b}$.
✍️ Written By
BT
Bhanzu Team
Content Creator and Editor
Bhanzu’s editorial team, known as Team Bhanzu, is made up of experienced educators, curriculum experts, content strategists, and fact-checkers dedicated to making math simple and engaging for learners worldwide. Every article and resource is carefully researched, thoughtfully structured, and rigorously reviewed to ensure accuracy, clarity, and real-world relevance. We understand that building strong math foundations can raise questions for students and parents alike. That’s why Team Bhanzu focuses on delivering practical insights, concept-driven explanations, and trustworthy guidance-empowering learners to develop confidence, speed, and a lifelong love for mathematics.
Related Articles
Book a FREE Demo ClassBook Now →