quaternion_canonize

compas.geometry.quaternion_canonize(q)[source]

Converts a quaternion into a canonic form if needed.

Parameters

q ([float, float, float, float] | compas.geometry.Quaternion) – Quaternion or sequence of four floats [w, x, y, z].

Returns

[float, float, float, float] – 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.