Decomposing Orthogonal(Perpendicular) and Parallel vector components with regards to a reference vector

w is a vector and v is its reference vector:

Decomposing w into two vectors w||v and w⊥v:

w =  w⊥v + w||v

w is perpendicular to v = w⊥v

w is parallel to v =w||v

w⊥v = w-w||v

so to find the parallel vector length, w||v we can use the projection formula:

proj(v)w = Trans(w).v/(Trans(w).w)*w