If we look at it in 2D, you'll get the idea:
_ _
The green line from the tip of u perpendicular to v cuts off the
_ _ _
projection p of u onto v.
_ _
We want the vector perpendicular to v that has its tip at the tip of u.
That has to be the vector coinciding with the green line! Like this:
All I did was simply to put an arrowhead on that green line!
I made that green line that cut off the projection vector p into a vector!
I put an arrowhead on the tip of it at the tip of u!
_ _
Now what is that green vector? it's simply u - p. See now?
So here's what we do:
_ _ _ _
We first find the projection p of u onto v. Then we subtract that from u
_ _
1. Find u•v: <0,5,3>•<0,-2,-5> = 0-10-15 = -25
_
2. Find ∥v∥² = 0²+(-2)²+(-5)² = 29
_ _ _
3. Divide u•v by ∥v∥² =
_
4. Multiply that by by v:
<-- that's p, the projection of u onto v.
_ _
5. Subtract u - p:
_
That's the green vector perpendicular to v.
Better check my fraction math.
Edwin