An orthogonal matrix is a type of square matrix whose columns and rows are orthogonal unit vectors (orthonormal vectors). The formula to transform a given square matrix to an orthogonal matrix is known as the Gram-Schmidt Process. Here is an implementation of Gram-Schmidt Process in Javascript:
index.tsx827 chars34 lines
This function takes a square matrix as input and returns an orthogonal matrix. If the input matrix has zero columns, an error is thrown. Otherwise, each column of the input matrix is orthogonalized using the Gram-Schmidt Process.
gistlibby LogSnag