Quaternion.from_rotation

classmethod Quaternion.from_rotation(R)

Create a Quaternion from a compas.geometry.Rotatation.

Parameters

R (compas.geometry.Rotation)

Returns

compas.geometry.Quaternion – The new quaternion.

Example

>>> 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)