Proj_b a = ((a*b)/||b||^2) b
||Proj_b a|| = ||a||cosθ
Proof: We know that a - Proj_b a = c, a vector perpendicular to b, and Proj_b a = kb, where k is some scalar in the real numbers.
Therefore, b*c = 0; b*(a - Proj_b a) = b*(a - kb) = 0
b*a - kb*b = 0; b*a = kb*b; (b*a)/(b*b) = (b*a)/||b||^2 = k
∴ Proj_b a = kb = ((a*b)/||b||^2) b
||Proj_b a|| = ||(||a|| ||b|| cosθ)/||b||^2)b|| = ||a||cosθ