[skip ci] changed "Bunge-Euler" to "Bunge Euler" and added note on axis sequence.

This commit is contained in:
Philip Eisenlohr 2021-09-09 14:05:09 +00:00
parent 4b163b9980
commit c93c4e462d
1 changed files with 29 additions and 21 deletions

View File

@ -489,7 +489,7 @@ class Rotation:
def as_Euler_angles(self, def as_Euler_angles(self,
degrees = False): degrees = False):
""" """
Represent as BungeEuler angles. Represent as Bunge Euler angles.
Parameters Parameters
---------- ----------
@ -499,12 +499,16 @@ class Rotation:
Returns Returns
------- -------
phi : numpy.ndarray of shape (...,3) phi : numpy.ndarray of shape (...,3)
BungeEuler angles (φ_1 [0,2π], ϕ [0,π], φ_2 [0,2π]) Bunge Euler angles (φ_1 [0,2π], ϕ [0,π], φ_2 [0,2π])
or (φ_1 [0,360], ϕ [0,180], φ_2 [0,360]) if degrees == True. or (φ_1 [0,360], ϕ [0,180], φ_2 [0,360]) if degrees == True.
Notes
-----
Bunge Euler angles correspond to a rotation axis sequence of zx'z''.
Examples Examples
-------- --------
Cube orientation as BungeEuler angles. Cube orientation as Bunge Euler angles.
>>> import damask >>> import damask
>>> import numpy as np >>> import numpy as np
@ -532,7 +536,7 @@ class Rotation:
Returns Returns
------- -------
axis_angle : numpy.ndarray of shape (...,4) or tuple ((...,3), (...)) if pair == True axis_angle : numpy.ndarray of shape (...,4) or tuple ((...,3), (...)) if pair == True
Axis and angle (n_1, n_2, n_3, ω) with ǀnǀ = 1 and ω [0,π] Axis and angle [n_1, n_2, n_3, ω] with ǀnǀ = 1 and ω [0,π]
or ω [0,180] if degrees == True. or ω [0,180] if degrees == True.
Examples Examples
@ -587,7 +591,7 @@ class Rotation:
------- -------
rho : numpy.ndarray of shape (...,4) or (...,3) if compact == True rho : numpy.ndarray of shape (...,4) or (...,3) if compact == True
RodriguesFrank vector [n_1, n_2, n_3, tan(ω/2)] with ǀnǀ = 1 and ω [0,π] RodriguesFrank vector [n_1, n_2, n_3, tan(ω/2)] with ǀnǀ = 1 and ω [0,π]
or tan(ω/2) [n_1, n_2, n_3] with ω [0,π] if compact == True. or [n_1, n_2, n_3] with |n| = tan(ω/2) and ω [0,π] if compact == True.
Examples Examples
-------- --------
@ -690,15 +694,19 @@ class Rotation:
def from_Euler_angles(phi, def from_Euler_angles(phi,
degrees = False): degrees = False):
""" """
Initialize from BungeEuler angles. Initialize from Bunge Euler angles.
Parameters Parameters
---------- ----------
phi : numpy.ndarray of shape (...,3) phi : numpy.ndarray of shape (...,3)
BungeEuler angles (φ_1 [0,2π], ϕ [0,π], φ_2 [0,2π]) Euler angles (φ_1 [0,2π], ϕ [0,π], φ_2 [0,2π])
or (φ_1 [0,360], ϕ [0,180], φ_2 [0,360]) if degrees == True. or (φ_1 [0,360], ϕ [0,180], φ_2 [0,360]) if degrees == True.
degrees : boolean, optional degrees : boolean, optional
BungeEuler angles are given in degrees. Defaults to False. Euler angles are given in degrees. Defaults to False.
Notes
-----
Bunge Euler angles correspond to a rotation axis sequence of zx'z''.
""" """
eu = np.array(phi,dtype=float) eu = np.array(phi,dtype=float)
@ -1137,7 +1145,7 @@ class Rotation:
@staticmethod @staticmethod
def _qu2eu(qu): def _qu2eu(qu):
"""Quaternion to Bunge-Euler angles.""" """Quaternion to Bunge Euler angles."""
q02 = qu[...,0:1]*qu[...,2:3] q02 = qu[...,0:1]*qu[...,2:3]
q13 = qu[...,1:2]*qu[...,3:4] q13 = qu[...,1:2]*qu[...,3:4]
q01 = qu[...,0:1]*qu[...,1:2] q01 = qu[...,0:1]*qu[...,1:2]
@ -1255,7 +1263,7 @@ class Rotation:
@staticmethod @staticmethod
def _om2eu(om): def _om2eu(om):
"""Rotation matrix to BungeEuler angles.""" """Rotation matrix to Bunge Euler angles."""
with np.errstate(invalid='ignore',divide='ignore'): with np.errstate(invalid='ignore',divide='ignore'):
zeta = 1.0/np.sqrt(1.0-om[...,2,2:3]**2) zeta = 1.0/np.sqrt(1.0-om[...,2,2:3]**2)
eu = np.where(np.isclose(np.abs(om[...,2,2:3]),1.0,0.0), eu = np.where(np.isclose(np.abs(om[...,2,2:3]),1.0,0.0),
@ -1309,10 +1317,10 @@ class Rotation:
return Rotation._ho2cu(Rotation._om2ho(om)) return Rotation._ho2cu(Rotation._om2ho(om))
#---------- Bunge-Euler angles ---------- #---------- Bunge Euler angles ----------
@staticmethod @staticmethod
def _eu2qu(eu): def _eu2qu(eu):
"""BungeEuler angles to quaternion.""" """Bunge Euler angles to quaternion."""
ee = 0.5*eu ee = 0.5*eu
cPhi = np.cos(ee[...,1:2]) cPhi = np.cos(ee[...,1:2])
sPhi = np.sin(ee[...,1:2]) sPhi = np.sin(ee[...,1:2])
@ -1325,7 +1333,7 @@ class Rotation:
@staticmethod @staticmethod
def _eu2om(eu): def _eu2om(eu):
"""BungeEuler angles to rotation matrix.""" """Bunge Euler angles to rotation matrix."""
c = np.cos(eu) c = np.cos(eu)
s = np.sin(eu) s = np.sin(eu)
om = np.block([+c[...,0:1]*c[...,2:3]-s[...,0:1]*s[...,2:3]*c[...,1:2], om = np.block([+c[...,0:1]*c[...,2:3]-s[...,0:1]*s[...,2:3]*c[...,1:2],
@ -1343,7 +1351,7 @@ class Rotation:
@staticmethod @staticmethod
def _eu2ax(eu): def _eu2ax(eu):
"""BungeEuler angles to axisangle pair.""" """Bunge Euler angles to axisangle pair."""
t = np.tan(eu[...,1:2]*0.5) t = np.tan(eu[...,1:2]*0.5)
sigma = 0.5*(eu[...,0:1]+eu[...,2:3]) sigma = 0.5*(eu[...,0:1]+eu[...,2:3])
delta = 0.5*(eu[...,0:1]-eu[...,2:3]) delta = 0.5*(eu[...,0:1]-eu[...,2:3])
@ -1362,7 +1370,7 @@ class Rotation:
@staticmethod @staticmethod
def _eu2ro(eu): def _eu2ro(eu):
"""BungeEuler angles to RodriguesFrank vector.""" """Bunge Euler angles to RodriguesFrank vector."""
ax = Rotation._eu2ax(eu) ax = Rotation._eu2ax(eu)
ro = np.block([ax[...,:3],np.tan(ax[...,3:4]*.5)]) ro = np.block([ax[...,:3],np.tan(ax[...,3:4]*.5)])
ro[ax[...,3]>=np.pi,3] = np.inf ro[ax[...,3]>=np.pi,3] = np.inf
@ -1371,12 +1379,12 @@ class Rotation:
@staticmethod @staticmethod
def _eu2ho(eu): def _eu2ho(eu):
"""BungeEuler angles to homochoric vector.""" """Bunge Euler angles to homochoric vector."""
return Rotation._ax2ho(Rotation._eu2ax(eu)) return Rotation._ax2ho(Rotation._eu2ax(eu))
@staticmethod @staticmethod
def _eu2cu(eu): def _eu2cu(eu):
"""BungeEuler angles to cubochoric vector.""" """Bunge Euler angles to cubochoric vector."""
return Rotation._ho2cu(Rotation._eu2ho(eu)) return Rotation._ho2cu(Rotation._eu2ho(eu))
@ -1408,7 +1416,7 @@ class Rotation:
@staticmethod @staticmethod
def _ax2eu(ax): def _ax2eu(ax):
"""Rotation matrix to BungeEuler angles.""" """Rotation matrix to Bunge Euler angles."""
return Rotation._om2eu(Rotation._ax2om(ax)) return Rotation._om2eu(Rotation._ax2om(ax))
@staticmethod @staticmethod
@ -1448,7 +1456,7 @@ class Rotation:
@staticmethod @staticmethod
def _ro2eu(ro): def _ro2eu(ro):
"""RodriguesFrank vector to BungeEuler angles.""" """RodriguesFrank vector to Bunge Euler angles."""
return Rotation._om2eu(Rotation._ro2om(ro)) return Rotation._om2eu(Rotation._ro2om(ro))
@staticmethod @staticmethod
@ -1488,7 +1496,7 @@ class Rotation:
@staticmethod @staticmethod
def _ho2eu(ho): def _ho2eu(ho):
"""Homochoric vector to BungeEuler angles.""" """Homochoric vector to Bunge Euler angles."""
return Rotation._ax2eu(Rotation._ho2ax(ho)) return Rotation._ax2eu(Rotation._ho2ax(ho))
@staticmethod @staticmethod
@ -1571,7 +1579,7 @@ class Rotation:
@staticmethod @staticmethod
def _cu2eu(cu): def _cu2eu(cu):
"""Cubochoric vector to BungeEuler angles.""" """Cubochoric vector to Bunge Euler angles."""
return Rotation._ho2eu(Rotation._cu2ho(cu)) return Rotation._ho2eu(Rotation._cu2ho(cu))
@staticmethod @staticmethod