skrobot.coordinates.math.xyzw2wxyz

skrobot.coordinates.math.xyzw2wxyz(quat)[source]

Convert quaternion [x, y, z, w] to [w, x, y, z] order.

Parameters:

quat (list or numpy.ndarray) – quaternion [x, y, z, w]

Returns:

quaternion – quaternion [w, x, y, z]

Return type:

numpy.ndarray

Examples

>>> from skrobot.coordinates.math import xyzw2wxyz
>>> xyzw2wxyz([1, 2, 3, 4])
array([4, 1, 2, 3])