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=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=True
. Default isTrue
.- degrees
If
True
, the angles are returned in degrees. Default isFalse
.
- Returns:
angles
Smallest symmetry reduced angles in radians (
degrees=False
) or degrees (degrees=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
>>> from orix.quaternion import Orientation, symmetry >>> ori1 = Orientation.random((5, 3)) >>> ori2 = Orientation.random((6, 2)) >>> dist1 = ori1.angle_with_outer(ori2) >>> dist1.shape (5, 3, 6, 2) >>> ori1.symmetry = symmetry.Oh >>> ori2.symmetry = symmetry.Oh >>> dist_sym = ori1.angle_with_outer(ori2) >>> np.allclose(dist1.data, dist_sym.data) False