rotate3d_to_AA | R Documentation |
rotate3d_to_AA()
converts from (post-multiplied) rotation matrix
to an axis-angle representation of 3D rotations.
rotate3d_to_AA(
mat = diag(4),
unit = getOption("affiner_angular_unit", "degrees")
)
mat |
3D rotation matrix (post-multiplied).
If you have a pre-multiplied rotation matrix
simply transpose it with |
unit |
A string of the desired angular unit. Supports the following strings
(note we ignore any punctuation and space characters as well as any trailing
|
https://en.wikipedia.org/wiki/Axis-angle_representation for more details
about the Axis-angle representation of 3D rotations.
rotate3d()
can be used to convert from an axis-angle representation to a rotation matrix.
# axis-angle representation of 90 degree rotation about the x-axis
rotate3d_to_AA(rotate3d("x-axis", 90, unit = "degrees"))
# find Axis-Angle representation of first rotating about x-axis 180 degrees
# and then rotating about z-axis 45 degrees
R <- rotate3d("x-axis", 180, unit = "degrees") %*%
rotate3d("z-axis", 45, unit = "degrees")
AA <- rotate3d_to_AA(R)
# Can use `rotate3d()` to convert back to rotation matrix representation
all.equal(R, do.call(rotate3d, AA))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.