MAGIKS  1.1
Manipulator General Inverse Kinematic Solver
 All Classes Namespaces Files Functions Variables Pages
Public Member Functions | List of all members
Quaternion Class Reference
Inheritance diagram for Quaternion:

Public Member Functions

def __init__
 
def __add__
 Operator function for addition of two quaternions. More...
 
def __sub__
 Operator function for subtraction of two quaternions. More...
 
def __mul__
 Operator function for multiplication of two quaternions. More...
 
def __div__
 Operator function for division of two quaternions. More...
 
def __abs__
 Operator function for the magnitude or norm of the quaternion. More...
 
def __neg__
 Operator function for the negative of a quaternion. More...
 
def __invert__
 Operator function for the conjugate of a quaternion. More...
 
def as_tuple
 
def as_vector
 
def __str__
 
def normalize
 

Detailed Description

Definition at line 28 of file quaternions.py.

Constructor & Destructor Documentation

def __init__ (   q,
  w = 0,
  x = 0,
  y = 0,
  z = 0 
)

Definition at line 29 of file quaternions.py.

Member Function Documentation

def __abs__ (   q)

Operator function for the magnitude or norm of the quaternion.

Returns
A scalar float containing the norm of the given quaternion

Definition at line 74 of file quaternions.py.

def __add__ (   q1,
  q2 
)

Operator function for addition of two quaternions.

Definition at line 36 of file quaternions.py.

def __div__ (   q1,
  q2 
)

Operator function for division of two quaternions.

Definition at line 63 of file quaternions.py.

def __invert__ (   q)

Operator function for the conjugate of a quaternion.

Returns
The conjugate of the given quaternion ( \( \bar q \))
Conjugate of Quaternion.

>>> q = Quaternion((2, 2, 2, 2))
>>> print(q)
(2 + 2i + 2j + 2k)
>>> print(~q)
(2 - 2i - 2j - 2k)
>>> print(~~q)
(2 + 2i + 2j + 2k)

Definition at line 83 of file quaternions.py.

def __mul__ (   q1,
  q2 
)

Operator function for multiplication of two quaternions.

Definition at line 54 of file quaternions.py.

def __neg__ (   q)

Operator function for the negative of a quaternion.

Definition at line 78 of file quaternions.py.

def __str__ (   q)

Definition at line 104 of file quaternions.py.

def __sub__ (   q1,
  q2 
)

Operator function for subtraction of two quaternions.

Definition at line 45 of file quaternions.py.

def as_tuple (   self)

Definition at line 97 of file quaternions.py.

def as_vector (   self)
Returns
The quaternion instance as a numpy vector

Definition at line 101 of file quaternions.py.

def normalize (   q)
Convert Quaternion to Unit Quaternion.

Unit Quaternion is Quaternion who's length is equal to 1.

>>> q = Quaternion((1, 3, 3, 3))
>>> q.normalize()
>>> print(q) # doctest: +ELLIPSIS
(0.1889822... + 0.5669467...i + 0.5669467...j + 0.5669467...k)

Definition at line 115 of file quaternions.py.


The documentation for this class was generated from the following file: