pytransform3d.rotations.quaternion_from_euler

pytransform3d.rotations.quaternion_from_euler(e, i, j, k, extrinsic)[source]

General conversion to quaternion from any Euler angles.

Parameters:
earray-like, shape (3,)

Rotation angles in radians about the axes i, j, k in this order. The first and last angle are normalized to [-pi, pi]. The middle angle is normalized to either [0, pi] (proper Euler angles) or [-pi/2, pi/2] (Cardan / Tait-Bryan angles).

iint from [0, 1, 2]

The first rotation axis (0: x, 1: y, 2: z)

jint from [0, 1, 2]

The second rotation axis (0: x, 1: y, 2: z)

kint from [0, 1, 2]

The third rotation axis (0: x, 1: y, 2: z)

extrinsicbool

Do we use extrinsic transformations? Intrinsic otherwise.

Returns:
qarray, shape (4,)

Unit quaternion to represent rotation: (w, x, y, z)

Raises:
ValueError

If basis is invalid