Rotation.from_quaternion
- classmethod Rotation.from_quaternion(quaternion)[source]
Construct a rotation transformation` from quaternion coefficients.
- Parameters:
- quaternion[float, float, float, float] |
compas.geometry.Quaternion
Four numbers that represents the four coefficient values of a quaternion.
- quaternion[float, float, float, float] |
- Returns:
Examples
>>> from compas.geometry import allclose >>> q1 = [0.945, -0.021, -0.125, 0.303] >>> R = Rotation.from_quaternion(q1) >>> q2 = R.quaternion >>> allclose(q1, q2) True