
Arman B. answered 05/26/19
USC PhD tutoring Physics, Calculus, and Chemistry
Once you have a set of orthogonal basis representing a subspace, then you can project any vector with the same dimension as your subspace to you subspace. Projecting a vector into a subspace is the act adding up all the vectors that align with your basis subspace. Than means, you can write the projection of a vector v onto a subspace spanned by the orthogonal set of vectors {an} as:
{an}
proj{a_n}(v) = (a1·v/||a1||2) a1 + (a2·v/||a2||2) a2+ ... + (an·v/||an||2) an
As an example, think about a plane spanned by two orthogonal 3 dimensional vectors in real euclidean space of 3 dimensions (ℜ3 ), then an arbitrary vector in ℜ3 can be projected onto this plane (subspace) by the process described above.
For further utilities, you can compose a matrix A, whose column vectors are the orthonormal basis of the subspace {an} (that means if the basis were not normalized, you have to normalize before constructing the matrix), then the projector to the subspace P = AAT. To convince yourself of this, you can first check that P has the property of a projector (idemptotence), i.e. P2=P. You can work out the details of how the projection described in the equation above is captured in the matrix vector multiplication Pv.