eulang#

torchspin.eulang(R)[source]#

Extract z-y’-z’’ Euler angles from a rotation matrix.

Parameters:

R (array_like, shape (3, 3)) – Real orthogonal rotation matrix with det(R) = +1.

Returns:

angles (ndarray, shape (3,)) – [alpha, beta, gamma] in radians. beta >= 0; alpha and gamma are in [0, 2π) when possible.

Return type:

ndarray

Notes

If the matrix is not exactly orthogonal (orthogonality error < 1e-2) it is orthogonalised via SVD before extraction.

Degenerate cases (β = 0 or β = π): the full z-rotation is collected in alpha and gamma is set to 0.