make_euler_xyz_quaternion
Specification
Location | Author | Maintained by |
---|---|---|
isl/math/euler.py | Kenny Erleben | DIKU |
Find the angle from a euler
This function assumes that the order of the rotation is R(x)R(y)R(z).
Definition
Given a unit quaternion , the corresponding rotation matrix is
More information can be found in page 602 in physics-based animation by Erleben, Sporring, Heniksen and Dohlmann. The angles can be found from the above rotation matrix
Example
radians_x = 0.4
radians_y = 1.1
radians_z = -1.3
matrix = np.dot(mat3.Rz(radians_z), np.dot(mat3.Ry(radians_y), mat3.Rx(radians_x)))
q = quat.from_matrix(matrix)
Euler = eu.make_euler_xyz_from_quaternion(q)
Euler.alpha, Euler.beta, Euler.gamma
Output
(0.4000000000000001, 1.1, -1.3)