jacobi(p, q, r)

Jacobi conjugation.

pOne of the real diagonals corresponding to the prescribed offdiagonal.
qThe offdiagonal in question.
rThe other real diagonal corresponding to the prescribed offdiagonal.
return valueRotation 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'