I am self studying some topics in Linear Algebra from Hoffman Kunze and I have a question in an Example of Lesson- Inner Product Spaces
It's image:
How does orthogonal projection of $R^{3}$ on W is linear transformation defined by $ (x_{1} , x_{2}, x_{3} ) $ = ...
I am unable to understand what is reasoning behind it.
Kindly help me.

The orthogonal projection $E(x_1,x_2,x_3)$ of $(x_1,x_2,x_3)$ onto $W$ is characterized by $$E(x_1,x_2,x_3) \in W, \quad (x_1,x_2,x_3) - E(x_1,x_2,x_3) \perp W$$ so we have $$E(x_1,x_2,x_3) \in W \implies E(x_1,x_2,x_3) = \lambda(3,12,-1)$$ for some scalar $\lambda$ and then $$(x_1,x_2,x_3) - \lambda(3,12,-1) \perp (3,12,-1)$$ so $$0=\langle (x_1,x_2,x_3) - \lambda(3,12,-1), (3,12,-1)\rangle = 3x_1+12x_3-x_3 - 154\lambda.$$ We get $$\lambda = \frac{3x_1+12x_3-x_3}{154} \implies E(x_1,x_2,x_3) = \frac{3x_1+12x_3-x_3}{154}(3,12,-1).$$