# What is the projection of (-i + j + k) onto  ( i - j + k)?

The projection of a vector a onto vector b is given by

$p r o {j}_{a} b = \frac{a \cdot b}{\left\mid a \right\mid} ^ 2 \cdot a$

Hence

The dot product of $a = \left(- 1 , 1 , 1\right)$ and $b = \left(1 , - 1 , 1\right)$ is

$a \cdot b = - 1 - 1 + 1 = - 1$

The magnitude of a is $\left\mid a \right\mid = \sqrt{- {1}^{2} + {1}^{2} + {1}^{2}} = \sqrt{3}$

Hence the projection is

$p r o {j}_{a} b = - \frac{1}{3} \cdot \left(- 1 , 1 , 1\right) = \left(- \frac{1}{3} , \frac{1}{3} , \frac{1}{3}\right) = \frac{1}{3} \cdot \left(- i + j + k\right)$