Jacobi conjugation.
p | One of the real diagonals corresponding to the prescribed offdiagonal. |
q | The offdiagonal in question. |
r | The other real diagonal corresponding to the prescribed offdiagonal. |
return value | Rotation matrix zeroing out q. |
For a matrix M with real diagonal, there is a rotation S such that the symmetic SMS' has a prescribed zero offdiagonal.
M = [1,2,3;4,5,6;7,8,9]
M = M+M';
col = 2
row = 1
J = eye(numRows(M));
J[col,row;col,row] = jacobi(M[row;row], M[row;col],M[col;col]);
J*M*J'