orthogonal projection from one vector onto another

18.3k Views Asked by At

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}}$

4

There are 4 best solutions below

0
On 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}}}$$

0
On

The scalar projection of $\vec a$ onto $\vec b$ is given by the dot product between $\vec a$ and the unitary vector $\hat b=\frac {\vec b} {\|\vec b\|}$

$$\vec a \cdot \frac {\vec b} {\|\vec b\|}$$

then to obtain the vector projection we need to multiply by the unitary vector $\hat b=\frac {\vec b} {|\vec b|}$ that is

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

0
On

In the general case, if $\{e_1,\ldots,e_p\}$ is an orthonormal set, then the orthogonal projection onto $F=\operatorname{span}\{e_1,\ldots,e_p\}$ is given by

$$p_F(a)=\sum_{i=1}^p(a\cdot e_i)e_i$$ Hence, in your particular case, the orthonormal set is $\left\{\frac{b}{\Vert b\Vert}\right\}$ and the orthogonal projection onto $F=\operatorname{span}\{b\}=\operatorname{span}\{\frac b{\Vert b\Vert}\}$ is given by

$$\left(a \cdot \frac b{\Vert b\Vert}\right)\frac b{\Vert b\Vert}=\left(\frac {a\cdot b}{\Vert b\Vert^2}\right)b$$

0
On

A problem with your reasoning is that your proposed formula produces a scalar, not a vector. You’ve come up with the length of the projection of $a$ onto $b$, with the sign indicating whether the projection points in the same or opposite direction as $b$. To get a vector from this, you still need to multiply it by the unit vector in the direction of $b$, i.e., by ${b\over\|b\|_2}$, which is how you eventually end up with $\|b\|_2^2$ in the denominator.