Chemical Data Processing Library Python API - Version 1.4.0
Public Member Functions | Properties | List of all members
CDPL.Math.FQuaternion Class Reference

General 4-component quaternion with component values of type float. More...

+ Inheritance diagram for CDPL.Math.FQuaternion:

Public Member Functions

None __init__ ()
 Constructs an uninitialized quaternion.
 
None __init__ (FQuaternion q)
 Constructs a copy of the quaternion q. More...
 
None __init__ (float c1, float c2=0.0, float c3=0.0, float c4=0.0)
 Constructs the quaternion with the supplied component values. More...
 
None __init__ (ConstFQuaternionExpression e)
 Constructs the quaternion from the quaternion expression e. More...
 
None __init__ (ConstDQuaternionExpression e)
 Constructs the quaternion from the quaternion expression e. More...
 
None __init__ (ConstLQuaternionExpression e)
 Constructs the quaternion from the quaternion expression e. More...
 
None __init__ (ConstULQuaternionExpression e)
 Constructs the quaternion from the quaternion expression e. More...
 
None __init__ (object a)
 Constructs the quaternion from the numpy.ndarray object a. More...
 
int getObjectID ()
 Returns the numeric identifier (ID) of the wrapped C++ class instance. More...
 
FQuaternion assign (ConstFQuaternionExpression e)
 Assigns the quaternion expression e to this quaternion (via a temporary to handle aliasing). More...
 
FQuaternion assign (ConstDQuaternionExpression e)
 Assigns the quaternion expression e to this quaternion (via a temporary to handle aliasing). More...
 
FQuaternion assign (ConstLQuaternionExpression e)
 Assigns the quaternion expression e to this quaternion (via a temporary to handle aliasing). More...
 
FQuaternion assign (ConstULQuaternionExpression e)
 Assigns the quaternion expression e to this quaternion (via a temporary to handle aliasing). More...
 
FQuaternion assign (FQuaternion q)
 Copy-assigns the components of q to this quaternion. More...
 
None assign (object a)
 Assigns the contents of the numpy.ndarray object a to this quaternion. More...
 
float getC1 ()
 Returns the real component C1. More...
 
float getC2 ()
 Returns the imaginary component C2. More...
 
float getC3 ()
 Returns the imaginary component C3. More...
 
float getC4 ()
 Returns the imaginary component C4. More...
 
object toArray ()
 Converts the FQuaternion instance into a corresponding numpy.ndarray object. More...
 
None swap (FQuaternion q)
 Swaps the four components of this quaternion with those of q. More...
 
None setC1 (float v)
 Sets the value of the real component C1 to v. More...
 
None setC2 (float v)
 Sets the value of the imaginary component C2 to v. More...
 
None setC3 (float v)
 Sets the value of the imaginary component C3 to v. More...
 
None setC4 (float v)
 Sets the value of the imaginary component C4 to v. More...
 
None set (float c1=0.0, float c2=0.0, float c3=0.0, float c4=0.0)
 Sets the four quaternion components to the supplied values. More...
 
bool __eq__ (FQuaternion q)
 Returns the result of the comparison operation self == q. More...
 
bool __eq__ (ConstFQuaternionExpression q)
 Returns the result of the comparison operation self == q. More...
 
bool __ne__ (FQuaternion q)
 Returns the result of the comparison operation self != q. More...
 
bool __ne__ (ConstFQuaternionExpression q)
 Returns the result of the comparison operation self != q. More...
 
str __str__ ()
 Returns a string representation of the FQuaternion instance. More...
 
FQuaternion __pos__ ()
 Returns self. More...
 
ConstFQuaternionExpression __neg__ ()
 Returns the result of the operation self * -1. More...
 
ConstFQuaternionExpression __add__ (float t)
 Returns the result of the addition operation self + t. More...
 
ConstFQuaternionExpression __add__ (ConstFQuaternionExpression e)
 Returns the result of the addition operation self + e. More...
 
ConstFQuaternionExpression __radd__ (float t)
 Returns the result of the addition operation t + self. More...
 
ConstFQuaternionExpression __sub__ (float t)
 Returns the result of the subtraction operation self - t. More...
 
ConstFQuaternionExpression __sub__ (ConstFQuaternionExpression e)
 Returns the result of the subtraction operation self - e. More...
 
ConstFQuaternionExpression __rsub__ (float t)
 Returns the result of the subtraction operation t - self. More...
 
ConstFQuaternionExpression __mul__ (float t)
 Returns the result of the multiplication operation self * t. More...
 
ConstFQuaternionExpression __mul__ (ConstFQuaternionExpression e)
 Returns the result of the multiplication operation self * e. More...
 
ConstFQuaternionExpression __rmul__ (float t)
 Returns the result of the multiplication operation t * self. More...
 
ConstFQuaternionExpression __div__ (float t)
 Returns the result of the division operation self // t. More...
 
ConstFQuaternionExpression __div__ (ConstFQuaternionExpression e)
 Returns the result of the division operation self // e. More...
 
ConstFQuaternionExpression __truediv__ (float t)
 Returns the result of the true division operation self / t. More...
 
ConstFQuaternionExpression __rdiv__ (float t)
 Returns the result of the division operation t // self. More...
 
FQuaternion __iadd__ (float t)
 Adds the scalar t to the real component. More...
 
FQuaternion __iadd__ (FQuaternion q)
 Adds the quaternion q to this quaternion (via a temporary to handle aliasing). More...
 
FQuaternion __iadd__ (ConstFQuaternionExpression e)
 Adds the quaternion expression e to this quaternion (via a temporary to handle aliasing). More...
 
FQuaternion __isub__ (float t)
 Subtracts the scalar t from the real component. More...
 
FQuaternion __isub__ (FQuaternion q)
 Subtracts the quaternion q from this quaternion (via a temporary to handle aliasing). More...
 
FQuaternion __isub__ (ConstFQuaternionExpression e)
 Subtracts the quaternion expression e from this quaternion (via a temporary to handle aliasing). More...
 
FQuaternion __imul__ (float t)
 Multiplies every component by the scalar t. More...
 
FQuaternion __imul__ (FQuaternion q)
 Right-multiplies this quaternion by the quaternion q (Hamilton product, via a temporary). More...
 
FQuaternion __imul__ (ConstFQuaternionExpression e)
 Right-multiplies this quaternion by the quaternion expression e (Hamilton product, via a temporary). More...
 
FQuaternion __idiv__ (float t)
 Divides every component by the scalar t. More...
 
FQuaternion __idiv__ (FQuaternion q)
 Right-divides this quaternion by the quaternion q (Hamilton-product inverse, via a temporary). More...
 
FQuaternion __idiv__ (ConstFQuaternionExpression e)
 Right-divides this quaternion by the quaternion expression e (Hamilton-product inverse, via a temporary). More...
 
FQuaternion __itruediv__ (float t)
 Divides every component by the scalar t. More...
 
FQuaternion __itruediv__ (FQuaternion q)
 Right-divides this quaternion by the quaternion q (Hamilton-product inverse, via a temporary). More...
 
FQuaternion __itruediv__ (ConstFQuaternionExpression e)
 Right-divides this quaternion by the quaternion expression e (Hamilton-product inverse, via a temporary). More...
 

Properties

 objectID = property(getObjectID)
 

Detailed Description

General 4-component quaternion with component values of type float.

Constructor & Destructor Documentation

◆ __init__() [1/7]

None CDPL.Math.FQuaternion.__init__ ( FQuaternion  q)

Constructs a copy of the quaternion q.

Parameters
qThe quaternion to copy.

◆ __init__() [2/7]

None CDPL.Math.FQuaternion.__init__ ( float  c1,
float   c2 = 0.0,
float   c3 = 0.0,
float   c4 = 0.0 
)

Constructs the quaternion with the supplied component values.

Parameters
c1The real component.
c2The first imaginary component.
c3The second imaginary component.
c4The third imaginary component.

◆ __init__() [3/7]

None CDPL.Math.FQuaternion.__init__ ( ConstFQuaternionExpression  e)

Constructs the quaternion from the quaternion expression e.

Parameters
eThe quaternion expression to materialize.

◆ __init__() [4/7]

None CDPL.Math.FQuaternion.__init__ ( ConstDQuaternionExpression  e)

Constructs the quaternion from the quaternion expression e.

Parameters
eThe quaternion expression to materialize.

◆ __init__() [5/7]

None CDPL.Math.FQuaternion.__init__ ( ConstLQuaternionExpression  e)

Constructs the quaternion from the quaternion expression e.

Parameters
eThe quaternion expression to materialize.

◆ __init__() [6/7]

None CDPL.Math.FQuaternion.__init__ ( ConstULQuaternionExpression  e)

Constructs the quaternion from the quaternion expression e.

Parameters
eThe quaternion expression to materialize.

◆ __init__() [7/7]

None CDPL.Math.FQuaternion.__init__ ( object  a)

Constructs the quaternion from the numpy.ndarray object a.

Parameters
aThe numpy.ndarray object.
See also
[NUMPY]

Member Function Documentation

◆ getObjectID()

int CDPL.Math.FQuaternion.getObjectID ( )

Returns the numeric identifier (ID) of the wrapped C++ class instance.

Different Python FQuaternion instances may reference the same underlying C++ class instance. The commonly used Python expression a is not b thus cannot tell reliably whether the two FQuaternion instances a and b reference different C++ objects. The numeric identifier returned by this method allows to correctly implement such an identity test via the simple expression a.getObjectID() != b.getObjectID().

Returns
The numeric ID of the internally referenced C++ class instance.

◆ assign() [1/6]

FQuaternion CDPL.Math.FQuaternion.assign ( ConstFQuaternionExpression  e)

Assigns the quaternion expression e to this quaternion (via a temporary to handle aliasing).

Parameters
eThe source quaternion expression.
Returns
self.

◆ assign() [2/6]

FQuaternion CDPL.Math.FQuaternion.assign ( ConstDQuaternionExpression  e)

Assigns the quaternion expression e to this quaternion (via a temporary to handle aliasing).

Parameters
eThe source quaternion expression.
Returns
self.

◆ assign() [3/6]

FQuaternion CDPL.Math.FQuaternion.assign ( ConstLQuaternionExpression  e)

Assigns the quaternion expression e to this quaternion (via a temporary to handle aliasing).

Parameters
eThe source quaternion expression.
Returns
self.

◆ assign() [4/6]

FQuaternion CDPL.Math.FQuaternion.assign ( ConstULQuaternionExpression  e)

Assigns the quaternion expression e to this quaternion (via a temporary to handle aliasing).

Parameters
eThe source quaternion expression.
Returns
self.

◆ assign() [5/6]

FQuaternion CDPL.Math.FQuaternion.assign ( FQuaternion  q)

Copy-assigns the components of q to this quaternion.

Parameters
qThe source quaternion.
Returns
self.

◆ assign() [6/6]

None CDPL.Math.FQuaternion.assign ( object  a)

Assigns the contents of the numpy.ndarray object a to this quaternion.

Parameters
aThe numpy.ndarray object.
See also
[NUMPY]

◆ getC1()

float CDPL.Math.FQuaternion.getC1 ( )

Returns the real component C1.

Returns
The value of C1.

◆ getC2()

float CDPL.Math.FQuaternion.getC2 ( )

Returns the imaginary component C2.

Returns
The value of C2.

◆ getC3()

float CDPL.Math.FQuaternion.getC3 ( )

Returns the imaginary component C3.

Returns
The value of C3.

◆ getC4()

float CDPL.Math.FQuaternion.getC4 ( )

Returns the imaginary component C4.

Returns
The value of C4.

◆ toArray()

object CDPL.Math.FQuaternion.toArray ( )

Converts the FQuaternion instance into a corresponding numpy.ndarray object.

Returns
The generated numpy.ndarray object.
See also
[NUMPY]

◆ swap()

None CDPL.Math.FQuaternion.swap ( FQuaternion  q)

Swaps the four components of this quaternion with those of q.

Parameters
qThe quaternion to swap with.

◆ setC1()

None CDPL.Math.FQuaternion.setC1 ( float  v)

Sets the value of the real component C1 to v.

Parameters
vThe new value of the real component C1.

◆ setC2()

None CDPL.Math.FQuaternion.setC2 ( float  v)

Sets the value of the imaginary component C2 to v.

Parameters
vThe new value of the imaginary component C2.

◆ setC3()

None CDPL.Math.FQuaternion.setC3 ( float  v)

Sets the value of the imaginary component C3 to v.

Parameters
vThe new value of the imaginary component C3.

◆ setC4()

None CDPL.Math.FQuaternion.setC4 ( float  v)

Sets the value of the imaginary component C4 to v.

Parameters
vThe new value of the imaginary component C4.

◆ set()

None CDPL.Math.FQuaternion.set ( float   c1 = 0.0,
float   c2 = 0.0,
float   c3 = 0.0,
float   c4 = 0.0 
)

Sets the four quaternion components to the supplied values.

Parameters
c1The new real component.
c2The new first imaginary component.
c3The new second imaginary component.
c4The new third imaginary component.

◆ __eq__() [1/2]

bool CDPL.Math.FQuaternion.__eq__ ( FQuaternion  q)

Returns the result of the comparison operation self == q.

Parameters
qThe FQuaternion instance to be compared with.
Returns
The result of the comparison operation.

◆ __eq__() [2/2]

bool CDPL.Math.FQuaternion.__eq__ ( ConstFQuaternionExpression  q)

Returns the result of the comparison operation self == q.

Parameters
qThe ConstFQuaternionExpression instance to be compared with.
Returns
The result of the comparison operation.

◆ __ne__() [1/2]

bool CDPL.Math.FQuaternion.__ne__ ( FQuaternion  q)

Returns the result of the comparison operation self != q.

Parameters
qThe FQuaternion instance to be compared with.
Returns
The result of the comparison operation.

◆ __ne__() [2/2]

bool CDPL.Math.FQuaternion.__ne__ ( ConstFQuaternionExpression  q)

Returns the result of the comparison operation self != q.

Parameters
qThe ConstFQuaternionExpression instance to be compared with.
Returns
The result of the comparison operation.

◆ __str__()

str CDPL.Math.FQuaternion.__str__ ( )

Returns a string representation of the FQuaternion instance.

Returns
The generated string representation.

◆ __pos__()

FQuaternion CDPL.Math.FQuaternion.__pos__ ( )

Returns self.

Returns
self.

◆ __neg__()

ConstFQuaternionExpression CDPL.Math.FQuaternion.__neg__ ( )

Returns the result of the operation self * -1.

Returns
A ConstFQuaternionExpression instance holding the result of the element negation.

◆ __add__() [1/2]

ConstFQuaternionExpression CDPL.Math.FQuaternion.__add__ ( float  t)

Returns the result of the addition operation self + t.

Parameters
tSpecifies the second addend.
Returns
A ConstFQuaternionExpression instance holding the result of the addition.

◆ __add__() [2/2]

ConstFQuaternionExpression CDPL.Math.FQuaternion.__add__ ( ConstFQuaternionExpression  e)

Returns the result of the addition operation self + e.

Parameters
eSpecifies the second addend.
Returns
A ConstFQuaternionExpression instance holding the result of the addition.

◆ __radd__()

ConstFQuaternionExpression CDPL.Math.FQuaternion.__radd__ ( float  t)

Returns the result of the addition operation t + self.

Parameters
tSpecifies the first addend.
Returns
A ConstFQuaternionExpression instance holding the result of the addition.

◆ __sub__() [1/2]

ConstFQuaternionExpression CDPL.Math.FQuaternion.__sub__ ( float  t)

Returns the result of the subtraction operation self - t.

Parameters
tSpecifies the subtrahend.
Returns
A FQuaternion instance holding the result of the subtraction.

◆ __sub__() [2/2]

ConstFQuaternionExpression CDPL.Math.FQuaternion.__sub__ ( ConstFQuaternionExpression  e)

Returns the result of the subtraction operation self - e.

Parameters
eSpecifies the subtrahend.
Returns
A FQuaternion instance holding the result of the subtraction.

◆ __rsub__()

ConstFQuaternionExpression CDPL.Math.FQuaternion.__rsub__ ( float  t)

Returns the result of the subtraction operation t - self.

Parameters
tSpecifies the minuend.
Returns
A FQuaternion instance holding the result of the subtraction.

◆ __mul__() [1/2]

ConstFQuaternionExpression CDPL.Math.FQuaternion.__mul__ ( float  t)

Returns the result of the multiplication operation self * t.

Parameters
tSpecifies the multiplier.
Returns
A ConstFQuaternionExpression instance holding the result of the multiplication.

◆ __mul__() [2/2]

ConstFQuaternionExpression CDPL.Math.FQuaternion.__mul__ ( ConstFQuaternionExpression  e)

Returns the result of the multiplication operation self * e.

Parameters
eSpecifies the multiplier.
Returns
A ConstFQuaternionExpression instance holding the result of the multiplication.

◆ __rmul__()

ConstFQuaternionExpression CDPL.Math.FQuaternion.__rmul__ ( float  t)

Returns the result of the multiplication operation t * self.

Parameters
tSpecifies the multiplicand.
Returns
A ConstFQuaternionExpression instance holding the result of the multiplication.

◆ __div__() [1/2]

ConstFQuaternionExpression CDPL.Math.FQuaternion.__div__ ( float  t)

Returns the result of the division operation self // t.

Parameters
tSpecifies the divisor.
Returns
A ConstFQuaternionExpression instance holding the result of the division.

◆ __div__() [2/2]

ConstFQuaternionExpression CDPL.Math.FQuaternion.__div__ ( ConstFQuaternionExpression  e)

Returns the result of the division operation self // e.

Parameters
eSpecifies the divisor.
Returns
A ConstFQuaternionExpression instance holding the result of the division.

◆ __truediv__()

ConstFQuaternionExpression CDPL.Math.FQuaternion.__truediv__ ( float  t)

Returns the result of the true division operation self / t.

Parameters
tSpecifies the divisor.
Returns
A ConstFQuaternionExpression instance holding the result of the division.

◆ __rdiv__()

ConstFQuaternionExpression CDPL.Math.FQuaternion.__rdiv__ ( float  t)

Returns the result of the division operation t // self.

Parameters
tSpecifies the dividend.
Returns
A ConstFQuaternionExpression instance holding the result of the division.

◆ __iadd__() [1/3]

FQuaternion CDPL.Math.FQuaternion.__iadd__ ( float  t)

Adds the scalar t to the real component.

Parameters
tThe scalar addend.
Returns
self.

◆ __iadd__() [2/3]

FQuaternion CDPL.Math.FQuaternion.__iadd__ ( FQuaternion  q)

Adds the quaternion q to this quaternion (via a temporary to handle aliasing).

Parameters
qThe source quaternion.
Returns
self.

◆ __iadd__() [3/3]

FQuaternion CDPL.Math.FQuaternion.__iadd__ ( ConstFQuaternionExpression  e)

Adds the quaternion expression e to this quaternion (via a temporary to handle aliasing).

Parameters
eThe source quaternion expression.
Returns
self.

◆ __isub__() [1/3]

FQuaternion CDPL.Math.FQuaternion.__isub__ ( float  t)

Subtracts the scalar t from the real component.

Parameters
tThe scalar subtrahend.
Returns
self.

◆ __isub__() [2/3]

FQuaternion CDPL.Math.FQuaternion.__isub__ ( FQuaternion  q)

Subtracts the quaternion q from this quaternion (via a temporary to handle aliasing).

Parameters
qThe source quaternion.
Returns
self.

◆ __isub__() [3/3]

FQuaternion CDPL.Math.FQuaternion.__isub__ ( ConstFQuaternionExpression  e)

Subtracts the quaternion expression e from this quaternion (via a temporary to handle aliasing).

Parameters
eThe source quaternion expression.
Returns
self.

◆ __imul__() [1/3]

FQuaternion CDPL.Math.FQuaternion.__imul__ ( float  t)

Multiplies every component by the scalar t.

Parameters
tThe scalar multiplier.
Returns
self.

◆ __imul__() [2/3]

FQuaternion CDPL.Math.FQuaternion.__imul__ ( FQuaternion  q)

Right-multiplies this quaternion by the quaternion q (Hamilton product, via a temporary).

Parameters
qThe right-hand quaternion.
Returns
self.

◆ __imul__() [3/3]

FQuaternion CDPL.Math.FQuaternion.__imul__ ( ConstFQuaternionExpression  e)

Right-multiplies this quaternion by the quaternion expression e (Hamilton product, via a temporary).

Parameters
eThe right-hand quaternion expression.
Returns
self.

◆ __idiv__() [1/3]

FQuaternion CDPL.Math.FQuaternion.__idiv__ ( float  t)

Divides every component by the scalar t.

Parameters
tThe scalar divisor.
Returns
self.

◆ __idiv__() [2/3]

FQuaternion CDPL.Math.FQuaternion.__idiv__ ( FQuaternion  q)

Right-divides this quaternion by the quaternion q (Hamilton-product inverse, via a temporary).

Parameters
qThe right-hand quaternion.
Returns
self.

◆ __idiv__() [3/3]

FQuaternion CDPL.Math.FQuaternion.__idiv__ ( ConstFQuaternionExpression  e)

Right-divides this quaternion by the quaternion expression e (Hamilton-product inverse, via a temporary).

Parameters
eThe right-hand quaternion expression.
Returns
self.

◆ __itruediv__() [1/3]

FQuaternion CDPL.Math.FQuaternion.__itruediv__ ( float  t)

Divides every component by the scalar t.

Parameters
tThe scalar divisor.
Returns
self.

◆ __itruediv__() [2/3]

FQuaternion CDPL.Math.FQuaternion.__itruediv__ ( FQuaternion  q)

Right-divides this quaternion by the quaternion q (Hamilton-product inverse, via a temporary).

Parameters
qThe right-hand quaternion.
Returns
self.

◆ __itruediv__() [3/3]

FQuaternion CDPL.Math.FQuaternion.__itruediv__ ( ConstFQuaternionExpression  e)

Right-divides this quaternion by the quaternion expression e (Hamilton-product inverse, via a temporary).

Parameters
eThe right-hand quaternion expression.
Returns
self.