angle_with_outer#
- Orientation.angle_with_outer(other: Orientation, lazy: bool = False, chunk_size: int = 20, progressbar: bool = True, degrees: bool = False) ndarray[source]#
Return the symmetry reduced smallest angle of rotation transforming every orientation in this instance to every orientation in another instance.
- Parameters:
- other
Another orientation.
- lazy
Whether to perform the computation lazily with Dask. Default is False.
- chunk_size
Number of orientations per axis to include in each iteration of the computation. Default is 20. Only applies when lazy is True. Increasing this might reduce the computation time at the cost of increased memory use.
- progressbar
Whether to show a progressbar during computation if lazy is True. Default is True.
- degrees
If True, the angles are returned in degrees. Default is False.
- Returns:
anglesSmallest symmetry reduced angles in radians (degrees is False) or degrees (degrees is True).
See also
Notes
Given two orientations \(g_i\) and \(g_j\), the smallest angle is considered as the geodesic distance
\[d(g_i, g_j) = \arccos(2(g_i \cdot g_j)^2 - 1),\]where \((g_i \cdot g_j)\) is the highest dot product between symmetrically equivalent orientations to \(g_{i,j}\).
Examples
>>> import numpy as np >>> from orix.quaternion import Orientation, symmetry >>> ori1 = Orientation.random((5, 3)) >>> ori2 = Orientation.random((6, 2)) >>> omega1 = ori1.angle_with_outer(ori2) >>> omega1.shape (5, 3, 6, 2) >>> ori1.symmetry = symmetry.Oh >>> ori2.symmetry = symmetry.Oh >>> omega_sym = ori1.angle_with_outer(ori2) >>> np.allclose(omega1.data, omega_sym.data) False