mcot.maths.spherical¶
Defines functions to work with spherical coordinates.
Functions
|
Converts to spherical coordinates. |
|
Finds a set of angles matching the same orientation with. |
|
Computes a rotation matrix based on the Euler angles. |
|
Converts a rotation matrix to spherical coordinates. |
|
Rotate around the axis with theta radians. |
|
Converts from spherical coordinates. |
cart2spherical¶
clean_euler¶
-
mcot.maths.spherical.
clean_euler
(phi, theta, psi)[source]¶ Finds a set of angles matching the same orientation with.
phi between -pi and pi
theta between 0 and pi
psi between -pi and pi
- Parameters
phi – orientation of the z-axis projection on the x-y plane
theta – polar angle (0 for keeping the z-axis in the z-direction, pi/2 for projecting the z-axis onto the x-y plane)
psi – rotation of the major dispersion axis around the main fibre orientation
- Returns
tuple with new (phi, theta, psi)
euler2mat¶
-
mcot.maths.spherical.
euler2mat
(phi, theta, psi)[source]¶ Computes a rotation matrix based on the Euler angles.
The z-axis is mapped to: euler2mat(phi, theta, _).dot([0, 0, 1] = (cos(phi) * sin(theta), sin(phi) * sin(theta), cos(theta)) psi determines the x- and y-axes orientations in the plane perpendicular to this
Bingham matrix is assumed to initially point in the z-direction
- Parameters
phi – orientation of the z-axis projection on the x-y plane
theta – polar angle (0 for keeping the z-axis in the z-direction, pi/2 for projecting the z-axis onto the x-y plane)
psi – rotation of the major dispersion axis around the main fibre orientation
- Returns
(…, 3, 3) array with rotation matrix