Defines a quaternion and its basic operations. More...
#include <vpQuaternionVector.h>
Public Member Functions | |
void | buildFrom (const vpRotationMatrix &R) |
vpQuaternionVector | operator* (const double l) |
Multiplication by scalar. Returns a quaternion defined by (lx,ly,lz,lw). More... | |
vpQuaternionVector | operator* (vpQuaternionVector &rq) |
Multiply two quaternions. More... | |
vpQuaternionVector | operator+ (vpQuaternionVector &q) |
vpQuaternionVector | operator- (vpQuaternionVector &q) |
vpQuaternionVector | operator- () |
Negate operator. Returns a quaternion defined by (-x,-y,-z-,-w). More... | |
vpQuaternionVector & | operator= (vpQuaternionVector &q) |
Copy operator. Allow operation such as Q = q. More... | |
void | set (const double x, const double y, const double z, const double w) |
unsigned int | size () |
vpQuaternionVector () | |
vpQuaternionVector (const double x, const double y, const double z, const double w) | |
Constructor from doubles. More... | |
vpQuaternionVector (const vpQuaternionVector &q) | |
vpQuaternionVector (const vpRotationMatrix &R) | |
double | w () const |
returns w-component of the quaternion More... | |
double | x () const |
returns x-component of the quaternion More... | |
double | y () const |
returns y-component of the quaternion More... | |
double | z () const |
returns z-component of the quaternion More... | |
Private Attributes | |
double | r [4] |
Static Private Attributes | |
static const double | minimum = 0.0001 |
Defines a quaternion and its basic operations.
This class allows to compute a quaternion from a rotation matrix using either vpQuaternionVector(const vpRotationMatrix &) contructor or buildFrom() method.
It also defines common operations on a quaternion such as:
Definition at line 80 of file vpQuaternionVector.h.
vpQuaternionVector::vpQuaternionVector | ( | ) |
Definition at line 61 of file vpQuaternionVector.cpp.
vpQuaternionVector::vpQuaternionVector | ( | const double | x, |
const double | y, | ||
const double | z, | ||
const double | w | ||
) |
Constructor from doubles.
Definition at line 64 of file vpQuaternionVector.cpp.
vpQuaternionVector::vpQuaternionVector | ( | const vpQuaternionVector & | q | ) |
Copy constructor.
q | quaternion to construct from. |
Definition at line 85 of file vpQuaternionVector.cpp.
vpQuaternionVector::vpQuaternionVector | ( | const vpRotationMatrix & | R | ) |
Constructs a quaternion from a rotation matrix.
R | Matrix containing a rotation. |
Definition at line 76 of file vpQuaternionVector.cpp.
void vpQuaternionVector::buildFrom | ( | const vpRotationMatrix & | R | ) |
Constructs a quaternion from a rotation matrix.
R | Rotation matrix. |
Definition at line 163 of file vpQuaternionVector.cpp.
vpQuaternionVector vpQuaternionVector::operator* | ( | const double | l | ) |
Multiplication by scalar. Returns a quaternion defined by (lx,ly,lz,lw).
Definition at line 138 of file vpQuaternionVector.cpp.
vpQuaternionVector vpQuaternionVector::operator* | ( | vpQuaternionVector & | rq | ) |
Multiply two quaternions.
Definition at line 144 of file vpQuaternionVector.cpp.
vpQuaternionVector vpQuaternionVector::operator+ | ( | vpQuaternionVector & | q | ) |
Quaternion addition.
Adds two quaternions. Addition is component-wise.
q | quaternion to add. |
Definition at line 115 of file vpQuaternionVector.cpp.
vpQuaternionVector vpQuaternionVector::operator- | ( | vpQuaternionVector & | q | ) |
Quaternion substraction.
Substracts a quaternion from another. Substraction is component-wise.
q | quaternion to substract. |
Definition at line 126 of file vpQuaternionVector.cpp.
vpQuaternionVector vpQuaternionVector::operator- | ( | ) |
Negate operator. Returns a quaternion defined by (-x,-y,-z-,-w).
Definition at line 132 of file vpQuaternionVector.cpp.
vpQuaternionVector & vpQuaternionVector::operator= | ( | vpQuaternionVector & | q | ) |
Copy operator. Allow operation such as Q = q.
Definition at line 152 of file vpQuaternionVector.cpp.
void vpQuaternionVector::set | ( | const double | x, |
const double | y, | ||
const double | z, | ||
const double | w | ||
) |
Manually change values of a quaternion.
x | x quaternion parameter. |
y | y quaternion parameter. |
z | z quaternion parameter. |
w | w quaternion parameter. |
Definition at line 98 of file vpQuaternionVector.cpp.
|
inline |
Definition at line 95 of file vpQuaternionVector.h.
|
inline |
returns w-component of the quaternion
Definition at line 103 of file vpQuaternionVector.h.
|
inline |
returns x-component of the quaternion
Definition at line 97 of file vpQuaternionVector.h.
|
inline |
returns y-component of the quaternion
Definition at line 99 of file vpQuaternionVector.h.
|
inline |
returns z-component of the quaternion
Definition at line 101 of file vpQuaternionVector.h.
|
staticprivate |
Definition at line 83 of file vpQuaternionVector.h.
|
private |
Definition at line 84 of file vpQuaternionVector.h.