Gram-Schmidt process
Given a set $\set{\v w_1, \v w_2, \ldots, \v w_r}$ of linearly independent vectors, we can use this process to form a orthonormal set $\set{\v v_1, \v v_2, \ldots, \v w_r}$ that has the same span.
Define the projection of $\v w$ onto $\v v$ by $$ \mathcal P_{\v v}(\v w) = \frac{\langle\v v|\v w\rangle}{\langle\v v|\v v\rangle}\v v.$$
-
Step 1: let $\v v_1 = \v w_1 / \sqrt{\langle\v w_1|\v w_1\rangle}$.
-
Step $k$: let $$\v u_k = \v w_k - \sum_{i=1}^{k-1} \mathcal P_{\v v_i}(\v w_k), $$ which gives an orthogonal vector. Then normalise it by $$ \v v_k = \frac{\v u_k}{\sqrt{\langle\v u_k|\v u_k\rangle}}. $$ (Explanation)