Origin.from_quaternion
- classmethod Origin.from_quaternion(quaternion, point=[0, 0, 0])
Construct a frame from a rotation represented by quaternion coefficients.
- Parameters
quaternion ([float, float, float, float] |
Quaternion
) – Four numbers that represent the four coefficient values of a quaternion.point ([float, float, float] |
Point
, optional) – The point of the frame.
- Returns
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