# solving a system of equation by rotation

Somebody hinted that one can solve a system of equations with some method of rotation. This is only needed for numeric solutions, otherwise Gauss-Jordan (RREF) is just fine.

What is this rotation about?

-
That would be either QR decomposition (which is doable with rotation matrices), or the eigendecomposition of a matrix with Jacobi's algorithm. Both are more expensive than Gaussian elimination, which remains applicable for numerical solutions as long as you pivot. – J. M. Sep 19 '11 at 16:21

## 1 Answer

It's called a Givens rotation. Similarly to Gaussian elimination, you can use a Givens rotation to eliminate a variable from a system of linear equations.

The basic idea is to find a 2D rotation matrix that will rotate a coefficient in the linear system to lie on the x-axis, thus eliminating it.

Note that this method is not trivially immune to numerical problems. If you directly compute the rotation angle, then you may have continuity issues. If you instead compute cos(alpha) and sin(alpha), you may risk division by zero if the radius is too small. Here is a numerically stable way to compute the rotation.

Givens rotations are also used for computing a QR decomposition: the triangular R is created by a series of eliminations by Givens rotations. Q is simply the product of all the rotation matrices, which are orthogonal.

-
Explicitly determining the rotation angle is never the right way. See this, for instance. – J. M. Dec 27 '11 at 10:29
Also, you have the convention backwards. $\mathbf Q$ is the orthogonal factor (it's supposed to be $\mathbf O$, but seeing that "O" often gets confused with "0"...) and $\mathbf R$ is the upper triangular (or "right triangular") factor. – J. M. Dec 27 '11 at 10:31