nanome.util.quaternion module¶
-
class
Quaternion
(x=0, y=0, z=0, w=1)[source]¶ Bases:
object
A vector that holds 4 values. Used for rotation.-
EPS
= 1e-06¶
-
dot
(other)[source]¶ - Returns the dot between this and another Quaternion
Parameters: other ( Quaternion
) – Quaternion to dot product withReturns: A float value representing the dot product. Return type: float
-
classmethod
from_matrix
(matrix)[source]¶ Creates a Quaternion from a 4x4 affine transformation matrix.
Parameters: matrix ( list
<list
<float
>>) – A 4x4 affine transformation matrixReturns: A Quaternion representing a rotation. Return type: Quaternion
-
get_conjugate
()[source]¶ - Returns the conjugate of this Quaternion.
Returns: A new Quaternion that is the conjugate of this Quaternion. Return type: Quaternion
-