Learn R Programming

cwhmisc (version 1.0.0)

rotangle: 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]

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

Run this code
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

Run the code above in your browser using DataLab