Methods
__abs__(q)
abs(Quaternion) -> float
Returns the magnitue of the Quaternion = sqrt(x*x+y*y+z*z+w*w)
__imul__(q, o)
Quaternion *= Quaternion -> None
Quaternion *= float -> None
Multiplies a Quaternion in place by a constant or by another
Quaternion. Remember to do (b * a) for a Quaternion representation
of a rotation by a then by b. Not Commutative!
__init__(q, quat=None)
Quaternion(q, quat=None) -> Quaternion
Creates a new "pure" quaternion (of no rotation). If a quaternion
is passed in, it is copied. If a tuple of the format (degrees, (x,
y, z)) or (x, y, z, w) is passed in, it is turned into a
quaternion.
__mul__(q, o)
Quaternion *= Quaternion -> Quaternion
Quaternion *= float -> Quaternion
Multiplies a Quaternion by a constant or by another Quaternion.
Remember to do (b * a) for a Quaternion representation of a rotation
by a then by b. Not Commutative!
__repr__(q)
repr(Quaternion) -> string
Return a string of the format '<w [x y z]>' (direct Quaternion
values)
__str__(q)
str(Quaternion) -> string
Return a string of the format '<angle (x y z)>' (angle in degrees
and normalized axis of rotation)
angle(q)
angle(q) -> float
Return the angle of rotation (in degrees) represented by q
axis(q)
axis(q) -> [x,y,z]
Returns a (Numeric) array of the axis of rotation represented by q.
Normalizes the vector to have magnitude of 1.0
normalize(q)
normalize(q) -> q
Normalizes the Quaternion such that the magnitued is 1.0
rotate(self, angle, axis)
rotate(self, angle, axis) -> self
Rotate Quaternion self by angle (degrees) around axis (x, y, z) and
return self for each chaining