rotation_matrix_to_axis#
- static Quaternion.rotation_matrix_to_axis(rotation_matrix: Sequence[Sequence[float]]) tuple#
Convert a rotation matrix to the corresponding axis of rotation.
- Parameters:
- rotation_matrix
Sequence[Sequence[float]] A 3x3 rotation matrix defined that can be defined as a tuple of tuples or a list of lists. The matrix should be orthogonal.
- rotation_matrix
- Returns:
tupleThe X, Y, and Z axes of the rotated frame.
Examples
>>> from ansys.aedt.core.generic.quaternion import Quaternion >>> rotation_matrix = ( ... (0.7071067811865476, 0.0, 0.7071067811865476), ... (0.0, 1.0, 0.0), ... (-0.7071067811865476, 0.0, 0.7071067811865476), ... ) >>> x, y, z = Quaternion.rotation_matrix_to_axis(rotation_matrix) >>> x (0.7071067811865476, 0.0, -0.7071067811865476) >>> y (0.0, 1.0, 0.0) >>> z (-0.7071067811865476, 0.0, 0.7071067811865476)