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 \(O_i\) and \(O_j\), the smallest angle is considered as the geodesic distance
\[d(O_i, O_j) = \arccos(2(O_i \cdot O_j)^2 - 1),\]where \((O_i \cdot O_j)\) is the highest dot product between symmetrically equivalent orientations to \(O_{i,j}\).
Examples
>>> from orix.quaternion import Orientation, symmetry >>> O1 = Orientation.random((5, 3)) >>> O2 = Orientation.random((6, 2)) >>> omega1 = O1.angle_with_outer(O2) >>> omega1.shape (5, 3, 6, 2) >>> O1.symmetry = symmetry.Oh >>> O2.symmetry = symmetry.Oh >>> omega_sym = O1.angle_with_outer(O2) >>> np.allclose(omega1.data, omega_sym.data) False