# orthogonalize function

Orthonormal vectors spanning the same space as some vectors, by the Gram-Schmidt process.

## How to write it

### orthogonalize(vectors)

**vectors**

The vectors, as rows. Takes a matrix, written as a list of rows.

## Examples

- $\displaystyle \operatorname{orthogonalize}\left(\begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix}\right) = \begin{pmatrix} \frac{\sqrt{2}}{2} & \frac{\sqrt{2}}{2} \\ -\frac{\sqrt{2}}{2} & \frac{\sqrt{2}}{2} \end{pmatrix}$

  `orthogonalize([[1, 1], [0, 1]])`

  In the solver, `orthogonalize([[1, 1], [0, 1]])` gives `[[sqrt(2)/2, sqrt(2)/2], [-sqrt(2)/2, sqrt(2)/2]]`.

  [Open in the solver](https://hilberon.com/?q=orthogonalize%28%5B%5B1%2C%201%5D%2C%20%5B0%2C%201%5D%5D%29)

## Related functions

- [pseudo_inverse](https://hilberon.com/library/pseudo_inverse)

  Moore-Penrose pseudo-inverse of a matrix.
- [null_space](https://hilberon.com/library/null_space)

  A basis of the null space of a matrix: the vectors v with A v = 0.
- [qr_decomposition](https://hilberon.com/library/qr_decomposition)

  QR decomposition of a matrix: an orthogonal factor and an upper triangular one.
- [normalize](https://hilberon.com/library/normalize)

  A vector scaled to length 1.
- [rank](https://hilberon.com/library/rank)

  Rank of a matrix: the number of independent rows.
- [norm](https://hilberon.com/library/norm)

  Length of a vector.

---
Source: https://hilberon.com/library/orthogonalize
