Home | Trees | Indices | Help |
|
---|
|
Quaternion (hypercomplex number)
This implementation of quaternions is not complete; only the features needed for representing rotation matrices by quaternions are implemented.
Quaternions support addition, subtraction, and multiplication, as well as multiplication and division by scalars. Division by quaternions is not provided, because quaternion multiplication is not associative. Use multiplication by the inverse instead.
The four components can be extracted by indexing.
|
|||
__add__(self, other) | |||
__div__(self, other) | |||
__getitem__(self, item) | |||
__init__(self,
*data) There are two calling patterns: |
|||
__mul__(self, other) | |||
__rdiv__(self, other) | |||
__repr__(self) | |||
__rmul__(self, other) | |||
__sub__(self, other) | |||
Numeric.array
|
asMatrix(self) Returns a 4x4 matrix representation |
||
Scientific.Geometry.Transformation.Rotation |
asRotation(self) Returns the corresponding rotation matrix |
||
dot(self, other) | |||
Quaternion |
inverse(self) Returns the inverse |
||
float
|
norm(self) Returns the norm |
||
Quaternion |
normalized(self) Returns the quaternion scaled such that its norm is 1 |
|
|||
_matrix = array([[[ 1, 0, 0, 0], [ 0, -1, 0, 0], [ 0, 0, -1, 0...
|
|||
_rot = array([[[[ 1, 0, 0, 0], [ 0, 1, 0, 0], [ 0, 0, -1, 0...
|
|||
is_quaternion = 1
|
|
|
|
|
There are two calling patterns:
|
|
|
|
|
|
|
|
|
|
|
|
|
_matrix
|
_rot
|
is_quaternion
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0alpha3 on Fri Oct 6 14:45:43 2006 | http://epydoc.sourceforge.net |