The rows of V are the input vectors v
1…v
3. Gram–Schmidt replaces them, in order, by vectors u
1…u
3 that are
mutually perpendicular and span the same space: keep the first, and from each later vector subtract its projections onto the ones already done. A final pass divides each u
k by its length to make the set
orthonormal.