Frame.from_quaternion

classmethod Frame.from_quaternion(quaternion, point=[0, 0, 0])[source]

Construct a frame from a rotation represented by quaternion coefficients.

Parameters:
quaternion[float, float, float, float] | compas.geometry.Quaternion

Four numbers that represent the four coefficient values of a quaternion.

point[float, float, float] | compas.geometry.Point, optional

The point of the frame.

Returns:
compas.geometry.Frame

The constructed frame.

Examples

>>> q1 = [0.945, -0.021, -0.125, 0.303]
>>> f = Frame.from_quaternion(q1, point=[1.0, 1.0, 1.0])
>>> q2 = f.quaternion
>>> allclose(q1, q2)
True