Computing the orthogonal projection of <2,3,-1> in the direction <1,1,1>:
>> u=[2 3 -1]; >> a=[1 1 1]; >> ( dot(u,a)/norm(a)^2 ) * a ans = 1.3333 1.3333 1.3333
And the vector component of <2,3,-1> orthogonal to <1,1,1>:
>> u - ans ans = 0.6667 1.6667 -2.3333
Compare the results above to the Mathematica plot below.