rotangle {cwhmath}R Documentation

Compute rotation angles from orthogonal matrix.

Description

Decompose the orthogonal matrix Q into the product R3 * R2 * R1 where the Ri are the elementary rotations around the i-th axis.

Usage

  rotangle(Q)

Arguments

Q Orthogonal matrix.

Value

The vector containing the rotation angles [radian]

Author(s)

Walter Gander, gander@inf.ethz.ch,
http://www.inf.ethz.ch/personal/gander/

References

"Least squares fit of point clouds" in: W. Gander and J. Hrebicek, ed., Solving Problems in Scientific Computing using Maple and Matlab, Springer Berlin Heidelberg New York, 1993, third edition 1997.

See Also

pointfit, rotm for synthesizing such a matrix.

Examples

  rot <- matrix(c(0.847101, -0.480873, -0.226234, 0.489074,  0.538865,
0.685880, -0.207912, -0.691655,  0.691655),3,3,byrow=TRUE)
  rotangle(rot) #> 0.785398  0.209440 -0.523599
  rotangle(rot)/pi*180 #> degrees:  45  12 -30

[Package cwhmath version 2.0 Index]