Quaternion.from_rotation

classmethod Quaternion.from_rotation(R)[source]

Create a Quaternion from a Rotatation.

Parameters:
Rcompas.geometry.Rotation
Returns:
compas.geometry.Quaternion

The new quaternion.

Examples

>>> from compas.geometry import Frame, Rotation
>>> R = Rotation.from_frame(Frame.worldYZ())
>>> Quaternion.from_rotation(R)
Quaternion(0.500, 0.500, 0.500, 0.500)