proj(a, b)

Orthogonal projection.

Avector that determines the line of the projection. Not necessarily the unit vector.
bProject this vector to a.
return valueThe orthogonally projected vector.

Calculates the orthogonal projection of vector b to a line determined by vector a.

proj([1,1,0], [3,2,4])