quaternion_canonize

compas.geometry.quaternion_canonize(q)[source]

Converts a quaternion into a canonic form if needed.

Parameters

q (list) – Quaternion as a list of four real values [w, x, y, z].

Returns

list – Quaternion in a canonic form as a list of four real values [cw, cx, cy, cz].

Notes

Canonic form means the scalar component is a non-negative number.