Linear Algebra

Vector Projection

Project vector a onto vector b: proj_b(a) = (a·b / b·b)·b. Also computes the orthogonal component and verifies that projection + orthogonal = a.

Inputs
Vector a (to project)
Vector b (project onto)

Projection Visualization

a (original)
b (direction)
proj_b(a)
orthogonal

Step-by-Step Work