The projection of v onto u, where u and v are both vectors in the same dimension euclidean vector space is as follows:
proj
u(
v) =
(u • v)
------------ u
|u|2
or assuming
u is a
unit vector...
(u • v) u
The resulting vector will be a scalar multiple of
u.