u = (6, 6, -5) and a = (1, -2, 0).
proj = u*cosA,
where A is the angle between vectors u and a.
u*a = |u|*|a|*cosA,
cosA = u*a/(|u|*|a|),
u*a = 6*1 - 6*2 - 5*0 = -6,
|u| = sqrt(6^2 + 6^2 + 5^2) = sqrt(97),
|a| = sqrt(5).
proj = (6, 6, -5)*(-6/sqrt(97*5)) = (-1.63, -1.63, 1.36).
Comments
Leave a comment