to_matrix#
- Quaternion.to_matrix() ndarray [source]#
Return the unit quaternions as orientation matrices [Rowenhorst et al., 2015].
- Returns:
om
Array of orientation matrices after normalizing the quaternions.
Examples
>>> from orix.quaternion import Quaternion >>> Q1 = Quaternion([[1, 0, 0, 0], [2, 0, 0, 0]]) >>> np.allclose(Q1.to_matrix(), np.eye(3)) True >>> Q2 = Quaternion([[0, 1, 0, 0], [0, 2, 0, 0]]) >>> np.allclose(Q2.to_matrix(), np.diag([1, -1, -1])) True
Examples using Quaternion.to_matrix
#
Combining rotations