QR Decomposition Calculator
Enter a matrix with independent columns to factor it as QR.
A matrix whose columns are independent, rows separated by semicolons.
Result
You entered
Show the work
Start with the first vector
The first column needs no change: . Every later one is made at right angles to it.
Remove the directions already used
Subtract from its projection onto each earlier . What is left, , is at right angles to all of them.
Using
Normalise to length 1
Divide each by its own length to get a vector of length 1 pointing the same way. The results are orthonormal: unit length and at right angles to each other.
Using
The matrix R
Each column is a combination of the orthonormal vectors, and the coefficients are dot products: above the diagonal and on it. Below the diagonal the entries are 0, so is upper triangular.
QR decomposition
The orthonormal vectors are the columns of , so has , and multiplying by rebuilds .
Using
Result
So with .