Linear Algebra – Orthogonal Projection from One Vector onto Another

linear algebraprojection

I am trying to understand the projection $\operatorname{proj}_{b} (a)$ vector $a$ onto vector $b$.

$\operatorname{proj}_{b} (a) = \frac{a \cdot b}{||b||_{2}^{2}} \cdot b$

As I understand it, the dot product of $a$ and $b$ is equal to the magnitude of the projection of $a$ onto $b$, times the magnitude of $b$ (and vice versa), so

$a \cdot b = \operatorname{proj}_{b} (a) \cdot ||b||_{2}$

why can't we just divide by $||b||_{2}$ to get the projection?

$\operatorname{proj}_{b} (a) = \frac{a \cdot b}{||b||_{2}}$

Best Answer

Informally, I like to think of the dot product as being all about projection. So $a\cdot b$ tells us something about how $a$ projects onto $b$. However, we want the dot product to be symmetric, so we can't just define $a\cdot b$ to be the length of the projection of $a$ on $b$. We fix this by also multiplying by the length of the vector projected on.

Using simple trig, note that the projection of $a$ on $b$ is $|a|\cos\theta$, where $\theta$ is the angle between them. To make the dot product, we define $a\cdot b$ to be the projection of $a$ on $b$ times the length of $b$. That is $$a\cdot b=|a||b|\cos \theta$$ and this is clearly symmetric. Now since $|a|\cos\theta$ is the length of the projection of $a$ on $b$, if we want to find the actual vector, we multiply this length by a unit vector in the $b$ direction. Thus the projection is $$(|a|\cos\theta) \frac{b}{|b|}.$$

Now we can just rearrange this: \begin{align} (|a|\cos\theta) \frac{b}{|b|}&=(|a||b|\cos\theta)\frac{b}{|b|^2}\\ &=(a\cdot b)\frac{b}{|b|^2}. \end{align}


I really think of it like this:

$$\text{Projection of $a$ on $b$}=\color{blue}{\underbrace{{\frac{a\cdot b}{|b|}}}_{\text{scalar projection}}}\qquad\text{times}\color{red}{\qquad \underbrace{\frac{b}{|b|}}_{\text{unit vector}}}$$