Reference: GramSchmidt
Let A be a m×n real matrix, and consider the n columns as vectors in ℝ^m. Then GramSchmidt(A) returns the m×n matrix whose columns are the vectors that are produced by the Gram-Schmidt orthonormalisation algorithm. In particular, if A is a square n×n matrix of full rank, then GramSchmidt(A) will be orthogonal, i.e. the columns of A will constitute an orthonormal basis of ℝ^n.