from_matrix#

classmethod Quaternion.from_matrix(matrix: Union[ndarray, tuple, list]) Quaternion[source]#

Create unit quaternions from the orientation matrices [Rowenhorst et al., 2015].

Parameters:
matrix

Sequence of orientation matrices with the last two dimensions of shape (3, 3).

Returns:
q

Unit quaternions.

Examples

>>> from orix.quaternion import Quaternion
>>> q = Quaternion.from_matrix([np.eye(3), 2 * np.eye(3), np.diag([1, -1, -1])])
>>> q
Quaternion (3,)
[[1. 0. 0. 0.]
 [1. 0. 0. 0.]
 [0. 1. 0. 0.]]