I have the following question and solution and I don't understand how to get from
$$ \frac{[1,1,−1]⋅[−1,−2,−1]}{[−1,−2,−1]⋅[−1,−2,−1]} $$
to
$$-\frac{2}{6}$$
Any ideas much appreciated. Thanks!
Let $ℓ$ be the line through the origin that contains $[−1,−2,−1]$.
What is the image of $[1,1,−1]$ under the orthogonal projection $P_ℓ$?
The image of $[1,1,−1]$ under $P_ℓ$ can be calculated as follows:
$$P_ℓ([1,1,−1]) = \frac{[1,1,−1]⋅[−1,−2,−1]}{[−1,−2,−1]⋅[−1,−2,−1]}⋅[−1,−2,−1]$$
$$ =-\frac{2}{6}⋅[−1,−2,−1]$$ $$ =[\frac{1}{3},\frac{2}{3}\frac{1}{3}] $$
Get from $ \dfrac{[1,1,−1]⋅[−1,−2,−1]}{[−1,−2,−1]⋅[−1,−2,−1]} $ to $-\dfrac{2}{6}$ using the dot product.
The dot product of two vectors $[a,b,c]$ and $[d,e,f]$, denoted $[a,b,c]\cdot[d,e,f]$,
is a scalar $ad+be+cf$.
Thus $[1,1,-1]\cdot[-1,-2,-1]=-1-2+1=-2$,
and $[-1,-2,-1]\cdot[-1,-2,-1]=1^2+2^2+1^2=6$.
Dot products are useful for computing lengths and angles.