Have trouble understanding vector projections

linear algebravector-spacesvectors

I'm currently reading about vector projections and have trouble understanding them. For example, the formula for finding the distance between a dot and a line is $d=\frac{
​∣a(x_0​)+b(y_0​)+c∣}{\sqrt{a^2+b^2}}​$
, while the formula for finding the projection of a vector onto another one is $\frac{b ⋅ a}{b ⋅ b} ⋅ a$. I read a vector proof of the 1st formula, which seemed logical to me as we were projecting one vector onto another one, but somewhy it differed from the latter.

Could anybody tell me why is it so and from where the 2nd formula comes from? Thank you in advance.

Best Answer

Remember that the direction of a vector $b$ is given by $\hat{b}=\frac{b}{||b||}$. You can decompose $\hat{b}$ into a component that is parallel to $a$ and one that is orthogonal to it. Since the cosine of 90º is zero, this operation will "select" the component that is parallel to $a$. This gives you a number, which represents (plus or minus) the length of the orthogonal projection of $\hat{b}$ onto $a$. This is called the scalar projection. The vector projection is obtained by multiplying the vector$\hat{b}=\frac{b}{||b||}$ by the scalar projection. This results in $$(\hat{b}\cdot a)\hat{b}= \frac{b\cdot a}{\sqrt{b\cdot b}}\hat{b}= \frac{b\cdot a}{b\cdot b}b.$$

Note that this is a vector, so it shouldn't equal any distance at all. If you take a vector that is perpendicular to a line, represent it in a way that it starts at a point $a$ in that line and ends at a point $b$ above it, then you can use the absolute value of the scalar projection to prove this distance formula you mentioned.

Related Question