pytransform3d.rotations.quaternion_from_angle#

pytransform3d.rotations.quaternion_from_angle(basis, angle)[source]#

Compute quaternion from rotation about basis vector.

Parameters:
basisint from [0, 1, 2]

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

anglefloat

Rotation angle

Returns:
qarray, shape (4,)

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

Raises:
ValueError

If basis is invalid