Find a vector which is along the direction of another given vector How do I find a vector which is along the direction of another vector? Can I just make it a scalar multiple of the given vector?
To be precise, the question gives two vectors, $a=[1,1,2]^T$ and $b=[1,2,5]^T$, and asks to express $b=\alpha+\beta$, where $\alpha$ is along the direction of $a$, while $\beta$ is orthogonal to $a$.
What I attempted was make $\alpha=ca$, where $c$ is a constant, since it is in the same direction? And then to obtain $\beta$, I calculated $a\cdot\beta=0$. But there are many possible vectors for $\beta$. Which vector should I use? I picked a couple random ones but couldn't find any which works. So now I'm stuck. How do I solve this? Thanks.
 A: You are on the right track. Let the vector $\beta$ be $[x,y,z]^T$ and the vector $\alpha$, as you correctly figured out is $[c,c,2c]^T$. So you have the vector equality
$$[1,2,5]^T = [c,c,2c]^T + [x,y,z]^T$$
Also, as you have mentioned $a \cdot \beta = 0 \implies x+y+2z=0 \ \ \ \ \ -----------(1)$.
And from the vector equality mentioned above, you have
$$1 = c+x \ \ \ \ \ -----------(2)$$
$$2 = c+ y \ \ \ \ \ -----------(3)$$
$$5 = 2c+z \ \ \ \ \ -----------(4)$$
There are $4$ unknowns $x,y,x,c$ and $4$ relations, can you solve the system to get the answer?  
A: This problem is asking you to decompose $b$ into components parallel to and perpendicular to $a$. As you’ve already determined, the parallel component $\alpha$ is a scalar multiple $ca$ of $a$. The perpendicular component $\beta$ is must be $a-\alpha$, so to solve this problem we just need to find the scalar $c$. Taking the dot product of $a$ and $b$, we have $$a\cdot b=a\cdot(\alpha+\beta)=a\cdot\alpha+a\cdot\beta=a\cdot\alpha=c(a\cdot a),$$ so $$\alpha = ca ={a\cdot b\over a\cdot a}a.$$ This last expression is known as the orthogonal projection of $b$ onto $a$.
