For a given angle theta, returns a p by p Givens rotation matrix.
givens.rotation(theta, p=2, which=c(1, 2))
theta |
an angle in radians |
p |
the dimension of the matrix to be produced |
which |
two numbers between 1 and p giving the columns/rows for the nonzero elements of the result. |
Returns a p by p matrix z of all zeroes, except z[which,which] has elements cos(theta), -sin(theta), sin(theta) and cos(theta), in column order.
sandy@stat.umn.edu
Gene H. Golub and Charles F. Van Loan (1989). Matrix Computations, Second Edition. Baltimore: Johns Hopkins Press, p. 202.
givens.rotation(1,4,c(1,3))