A class of quaternions and a number of linear algebra methods and operators. More...
#include <ZLinAlg.h>
Public Member Functions | |
| bool | ComputeFromRotationMatrix (Column3Vector C0, Column3Vector C1, Column3Vector C2) |
| bool | conjugate () |
| float | getW () |
| float | getX () |
| float | getY () |
| float | getZ () |
| float | norm () |
| bool | normalize () |
| Quaternion | operator* (Quaternion Qright) |
| Quaternion | operator/ (Quaternion Qright) |
| Quaternion & | operator= (Quaternion Qnew) |
| void | PrintSelf () |
| Quaternion () | |
| Column3Vector | RotateVector (Column3Vector P1) |
| void | setvalues (float X, float Y, float Z, float W) |
| void | setW (float W) |
| void | setX (float X) |
| void | setY (float Y) |
| void | setZ (float Z) |
| ~Quaternion () | |
Private Attributes | |
| float | QuaternionArray [4] |
A class of quaternions and a number of linear algebra methods and operators.
| Quaternion::Quaternion | ( | ) |
| Quaternion::~Quaternion | ( | ) |
Destructor Class
| bool Quaternion::ComputeFromRotationMatrix | ( | Column3Vector | C0, | |
| Column3Vector | C1, | |||
| Column3Vector | C2 | |||
| ) |
Compute quaternion elements from a rotation matrix. NOTE: The matrix columns should be orthonormal. This is not verified prior to computing the quaternion.
| C0 | First column vector of the rotation matrix. | |
| C1 | Second column vector of the rotation matrix. | |
| C2 | Third column vector of the rotation matrix. |
References getX(), Column3Vector::getX(), getY(), Column3Vector::getY(), getZ(), Column3Vector::getZ(), setW(), setX(), setY(), and setZ().
Referenced by zf::ZFrameCalibration::LocalizeFrame().
| bool Quaternion::conjugate | ( | ) |
References getW(), getX(), getY(), getZ(), setW(), setX(), setY(), and setZ().
Referenced by operator/(), and RotateVector().
| float Quaternion::getW | ( | ) |
Get fourth element of the quaternion.
References QuaternionArray.
Referenced by conjugate(), zf::ZFrameCalibration::LocalizeFrame(), operator*(), operator=(), PrintSelf(), and zf::ZFrameCalibration::RegisterQuaternion().
| float Quaternion::getX | ( | ) |
Get first element of the quaternion.
References QuaternionArray.
Referenced by ComputeFromRotationMatrix(), conjugate(), zf::ZFrameCalibration::LocalizeFrame(), operator*(), operator=(), PrintSelf(), zf::ZFrameCalibration::RegisterQuaternion(), and RotateVector().
| float Quaternion::getY | ( | ) |
Get second element of the quaternion.
References QuaternionArray.
Referenced by ComputeFromRotationMatrix(), conjugate(), zf::ZFrameCalibration::LocalizeFrame(), operator*(), operator=(), PrintSelf(), zf::ZFrameCalibration::RegisterQuaternion(), and RotateVector().
| float Quaternion::getZ | ( | ) |
Get third element of the quaternion.
References QuaternionArray.
Referenced by ComputeFromRotationMatrix(), conjugate(), zf::ZFrameCalibration::LocalizeFrame(), operator*(), operator=(), PrintSelf(), zf::ZFrameCalibration::RegisterQuaternion(), and RotateVector().
| float Quaternion::norm | ( | ) |
Compute the norm of the 3-vector.
References QuaternionArray.
Referenced by normalize().
| bool Quaternion::normalize | ( | ) |
Normalize the quaternion.
References norm(), QuaternionArray, and VEPSILON.
| Quaternion Quaternion::operator* | ( | Quaternion | Qright | ) |
| Quaternion Quaternion::operator/ | ( | Quaternion | Qright | ) |
Find relative rotation between two frames represented by two quaternions. Rotation multiplied by rotation inverse.
| Qright |
References conjugate().
| Quaternion & Quaternion::operator= | ( | Quaternion | Qnew | ) |
| void Quaternion::PrintSelf | ( | ) |
| Column3Vector Quaternion::RotateVector | ( | Column3Vector | P1 | ) |
Rotate a vector using a quaternion representation of that rotation.
| P1 | The vector to be rotated. |
References conjugate(), getX(), Column3Vector::getX(), getY(), Column3Vector::getY(), getZ(), Column3Vector::getZ(), setW(), Column3Vector::setX(), setX(), Column3Vector::setY(), setY(), Column3Vector::setZ(), and setZ().
Referenced by zf::ZFrameCalibration::LocalizeFrame(), and zf::ZFrameCalibration::RegisterQuaternion().
| void Quaternion::setvalues | ( | float | X, | |
| float | Y, | |||
| float | Z, | |||
| float | W | |||
| ) |
| void Quaternion::setW | ( | float | W | ) |
Set the W element (real).
| W | Desired value of W element (real). |
References QuaternionArray.
Referenced by ComputeFromRotationMatrix(), conjugate(), operator*(), operator=(), zf::ZFrameCalibration::RegisterQuaternion(), RotateVector(), and setvalues().
| void Quaternion::setX | ( | float | X | ) |
Set the X element.
| X | Desired value of X element. |
References QuaternionArray.
Referenced by ComputeFromRotationMatrix(), conjugate(), operator*(), operator=(), zf::ZFrameCalibration::RegisterQuaternion(), RotateVector(), and setvalues().
| void Quaternion::setY | ( | float | Y | ) |
Set the Y element.
| Y | Desired value of Y element. |
References QuaternionArray.
Referenced by ComputeFromRotationMatrix(), conjugate(), operator*(), operator=(), zf::ZFrameCalibration::RegisterQuaternion(), RotateVector(), and setvalues().
| void Quaternion::setZ | ( | float | Z | ) |
Set the Z element.
| Z | Desired value of Z element. |
References QuaternionArray.
Referenced by ComputeFromRotationMatrix(), conjugate(), operator*(), operator=(), zf::ZFrameCalibration::RegisterQuaternion(), RotateVector(), and setvalues().
float Quaternion::QuaternionArray[4] [private] |
1.6.1