# Equation for Projection of vector b onto vector a

• April 6th 2013, 04:20 PM
MSUMathStdnt
Equation for Projection of vector b onto vector a
Edited
Let $\theta$ be the angle between vectors $\vec{a}$ and $\vec{b}$.

We find the projection of $\vec{b}$ onto $\vec{a}$ by first drawing an altitude (perpendicular to $\vec{a}$) from the head of $\vec{b}$ to $\vec{a}$. We have a right triangle, and by good old SOH CAH TOA, $proj_{\vec{a}}\vec{b} = \left| \vec{b} \right|\cos(\theta)$, because $\vec{b}$ is the hypotenuse.

We also have that $\cos(\theta) = \frac{\vec{a} \cdot \vec{b}}{\left|\vec{a}\right| \left|\vec{b}\right|}$.

When I substitute that into the equation for the projection of $proj_{\vec{a}}\vec{b}$, I get
$proj_{\vec{a}}\vec{b} = \left| \vec{b} \right| \cos(\theta) =\frac{\vec{a} \cdot \vec{b}}{\left|\vec{a}\right|}$

right?

But that yields a number, not a vector.
What am I (still) doing wrong?