# get_distance_matrix#

Misorientation.get_distance_matrix(chunk_size: int = 20, progressbar: bool = True, degrees: bool = False) [source]#

Return the symmetry reduced smallest angle of rotation transforming every misorientation in this instance to every other misorientation .

Parameters:
chunk_size

Number of misorientations per axis to include in each iteration of the computation. Default is 20. Increasing this might reduce the computation time at the cost of increased memory use.

progressbar

Whether to show a progressbar during computation. Default is True.

degrees

If True, the angles are returned in degrees. Default is False.

Returns:
angles

Misorientation angles in radians (degrees=False) or degrees (degrees=True).

Notes

Given two misorientations $$M_i$$ and $$M_j$$ with the same two symmetry groups, the smallest angle is considered as the geodesic distance

$d(M_i, M_j) = \arccos(2(M_i \cdot M_j)^2 - 1),$

where $$(M_i \cdot M_j)$$ is the highest dot product between symmetrically equivalent misorientations to $$M_{i,j}$$, given by

$\max_{s_k \in S_k} s_k M_i s_l s_k M_j^{-1} s_l,$

where $$s_k \in S_k$$ and $$s_l \in S_l$$, with $$S_k$$ and $$S_l$$ being the two symmetry groups.

Examples

>>> from orix.quaternion import Misorientation, symmetry
>>> M = Misorientation.from_axes_angles([1, 0, 0], [0, 90], degrees=True)
>>> M.symmetry = (symmetry.D6, symmetry.D6)
>>> M.get_distance_matrix(progressbar=False, degrees=True)
array([[ 0., 90.],
[90.,  0.]])