paramagpy.metal.matrix_to_euler

paramagpy.metal.matrix_to_euler(M)[source]

Calculate Euler angles from a rotation matrix using ZYZ convention

Parameters

M (3x3 numpy ndarray) – a rotation matrix

Returns

eulers – the euler angles [alpha,beta,gamma] in radians by ZYZ convention

Return type

array of floats

Examples

>>> matrix = array([[-0.1223669 , -0.5621374 ,  0.81794125],
                    [ 0.75057357,  0.486796  ,  0.44684334],
                    [-0.64935788,  0.66860392,  0.36235775]])
>>> matrix_to_euler(matrix)
np.array([0.5,1.2,0.8])