From Graham-Schmidt To SO(n)

Frank Lanke Fu Tarimo
2 min readFeb 11, 2021

Previously, I wanted to write about a rotation calculation technique but realised that I should first write about generating random rotation matrices, hence my post: Graham Schmidt Orthogonalisation

Actually, that post didn't quite cover generating rotation matrices since the Graham Schmidt Orthogonalisation can only generate orthonormal/orthogonal matrices but doesn't guarantee the +1 determinant. The matrix could end up having -1 determinant in which case the matrix performs mirroring on at least one of the axes. Let's settle this potential discrepancy by using one of the properties of square matrix determinants namely:

det(AB) = det(A) * det(B)

So if our candidate orthogonal matrix A has a determinant -1, all we have to do to make it a proper rotation matrix, is multiply it by an orthogonal matrix B which also has determinant -1. We could even choose B to be A itself since it would meet the requirements. Note that we need the second matrix B to also be orthogonal, so as to obtain a resultant matrix which is still in the orthogonal group.

Say our rotation matrix R = A A, where A is some orthogonal matrix generated by the Graham-Schmidt procedure. We have that

det(R) = det(A) * det(A)

Since det(A) = ±1, det(R) = +1.

This is a small change from the previous post and the results look as follows:

Transforming a random normal matrix(left) into an orthogonal matrix(right). The arrows show the columns of the matrix. Notice that the coordinate frame shown on the right image doesn't abide by the right-hand rule. (r,g,b) -> (x,y,z). This is an artefact of the determinant not being strictly +1. Some of the axes might be flipped.
Transforming a random normal matrix(left) into a rotation matrix(right). The arrows show the columns of the matrices. Note that the coordinate frame on the right now follows the right hand rule. However, also notice that none of the new coordinate frame axes resemble their counter parts on the left image. This is caused by applying the same transform twice.

For details about the changes, check this out:

--

--

Frank Lanke Fu Tarimo

PhD Candidate in Perception for Robotics. University of Oxford