Define square matrix A as follows.
Consider AAT=I. Here, I is identity matrix.
If the above is satisfied then the below also is satisfied, and if the below is satisfied then the above is also satisfied.
Because AAT=I is satisfied, A is an orthogonal matrix, so ATA=I is also satisfied.
If A is an orthogonal matrix, then the rows of A forms orthonormal bases, and the matrix A whose rows are orthonormal bases becomes an orthogonal matrix.
Because both AAT=I and ATA=I are satisfied, the columns of A are also orthonormal bases (with different space and axes).
Use Gram-Schmidt orthonormalization method
One concern is that the result will be different depending on which basis you start calculated
Calculate the following
This method has to calculate the inverse of the squared-root matrix of the symmetrical matrix (the squared-root matrix of the inverse matrix), using QR decomposition or SVD. So, it is better to use the following two methods instead.
Calculate the following using QR decomposition
Useful for regular matrix A
Calculate the following using SVD (singular value decomposition)
Useful when the matrix A is singular or nearly singular. It is safe when the matrix A is consisted of measurement data.