nucleus.quaternion#
Quaternion objects are used to represent rotation. |
- class nucleus.quaternion.Quaternion#
Quaternion objects are used to represent rotation.
We use the Hamilton/right-handed quaternion convention, where
i^2 = j^2 = k^2 = ijk = -1
The quaternion represented by the tuple
(x, y, z, w)is equal tow + x*i + y*j + z*k.- Parameters:
x (float) – The x value.
y (float) – The y value.
x – The z value.
w (float) – The w value.
- classmethod from_json(payload)#
Instantiates quaternion object from schematized JSON dict payload.
- Parameters:
payload (Dict[str, float]) –
- to_payload()#
Serializes quaternion object to schematized JSON dict.
- Return type:
dict