Frame.from_quaternion

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

Construct a frame from a rotation represented by quaternion coefficients.

Parameters
  • quaternion (list of float) – Four numbers that represent the four coefficient values of a quaternion.

  • point (list of float, optional) – The point of the frame. Defaults to [0, 0, 0].

Returns

compas.geometry.Frame – The constructed frame.

Examples

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