Algebra3D
Algebra for 3D transformations
|
A namespace for the whole library. More...
Classes | |
class | Vector3 |
A class to store vectors of 3 elements. More... | |
class | Quaternion |
A class to store quaternions. More... | |
class | Matrix3 |
A class to store 3x3 rotation matrices. More... | |
Typedefs | |
typedef Matrix3< double > | Matrix3D |
typedef Matrix3< float > | Matrix3F |
typedef Quaternion< double > | QuaternionD |
typedef Quaternion< float > | QuaternionF |
typedef Vector3< double > | Vector3D |
typedef Vector3< float > | Vector3F |
Functions | |
template<class fpType > | |
int | sign (const fpType &val) |
template<class fpType > | |
int | signStar (const fpType &val) |
template<class fpType > | |
bool | isInf (const fpType &number) |
template<class fpType > | |
bool | isNaN (const fpType &number) |
template<class fpType > | |
int | compare (const fpType &d1, const fpType &d2, const fpType &precision=PRECISION) |
template<class fpType > | |
fpType | normalizeAngle (const fpType &angle) |
template<class fpType > | |
fpType | getAngleFromSinCose (fpType sinAlpha, fpType cosAlpha) |
template<class fpType > | |
Matrix3< fpType > | operator* (const double &scale, const Matrix3< fpType > &mat) |
template<class fpType > | |
Matrix3< fpType > | operator* (const float &scale, const Matrix3< fpType > &mat) |
template<class fpType > | |
std::ostream & | operator<< (std::ostream &stream, const Matrix3< fpType > &mat) |
template<class fpType > | |
std::istream & | operator>> (std::istream &stream, Matrix3< fpType > &mat) |
template<class fpType > | |
std::ostream & | operator<< (std::ostream &stream, const Quaternion< fpType > &quat) |
template<class fpType > | |
std::istream & | operator>> (std::istream &stream, Quaternion< fpType > &quat) |
template<class fpType > | |
Vector3< fpType > | operator* (const double &scale, const Vector3< fpType > &vec) |
template<class fpType > | |
Vector3< fpType > | operator* (const float &scale, const Vector3< fpType > &vec) |
template<class fpType > | |
std::ostream & | operator<< (std::ostream &stream, const Vector3< fpType > &vec) |
template<class fpType > | |
std::istream & | operator>> (std::istream &stream, Vector3< fpType > &vec) |
A namespace for the whole library.
algebra3d Matrix3< double\> algebra3d algebra3d::Matrix3D |
An abbreviated name for algebra3d::Matrix3 <double>
algebra3d Matrix3< float\> algebra3d algebra3d::Matrix3F |
An abbreviated name for algebra3d::Matrix3 <float>
algebra3d Quaternion double algebra3d algebra3d::QuaternionD |
An abbreviated name for algebra3d::Quaternion <double>
algebra3d Quaternion< double\> algebra3d algebra3d::QuaternionF |
An abbreviated name for algebra3d::Quaternion <float>
algebra3d Vector3< double\> algebra3d algebra3d::Vector3D |
An abbreviated name for algebra3d::Vector3 <double>
algebra3d Vector3< double\> algebra3d algebra3d::Vector3F |
An abbreviated name for algebra3d::Vector3 <float>
|
inline |
Compares the two fpType numbers up to the precision. Returns 0 if the numbers are equal up to precision, 1 if the first number is greater, -1 if the second number is greater, 2 if one of the numbers is NaN
.
Two function pointers have been added to make it easier to use.
[in] | d1 | A number to compare. |
[in] | d2 | The other number to compare. |
[in] | precision | The precision to use; by default the global PRECISION is used. |
0
if the numbers are equal up to PRECISION, 1
if the first one is greater, -1
if the second number is greater, 2
if one of the numbers is NaN
.
|
inline |
Computes a normalized angle for the given values of sine and cosine.
sinAlpha | sine of the angle to calculate |
cosAlpha | cosine of the angle to calculate. |
|
inline |
Checks if the provided number is Inf.
Two function pointers have been added to make it easier to use.
[in] | number | The number to check. |
true
if the numbers is Inf, false
otherwise.
|
inline |
Checks if the provided number is NaN.
Two function pointers have been added to make it easier to use.
[in] | number | The number to check. |
true
if the numbers is NaN, false
otherwise. fpType algebra3d::normalizeAngle | ( | const fpType & | angle | ) |
"Normalizes" the angle i.e. transforms it to (-PI, PI].
Two function pointers have been added to make it easier to use.
[in] | angle | The angle to "normalize". |
Vector3<fpType> algebra3d::operator* | ( | const double & | scale, |
const Vector3< fpType > & | vec | ||
) |
Scales the provided vector by the provided double number.
[in] | scale | The scaling factor. |
[in] | vec | Vector to scale. |
Vector3<fpType> algebra3d::operator* | ( | const float & | scale, |
const Vector3< fpType > & | vec | ||
) |
Scales the provided vector by the provided float number.
[in] | scale | The scaling factor. |
[in] | vec | Vector to scale. |
Matrix3<fpType> algebra3d::operator* | ( | const double & | scale, |
const Matrix3< fpType > & | mat | ||
) |
Scales the provided matrix by the provided double number.
[in] | scale | The scaling factor. |
[in] | mat | Matrix to scale. |
Matrix3<fpType> algebra3d::operator* | ( | const float & | scale, |
const Matrix3< fpType > & | mat | ||
) |
Scales the provided matrix by the provided float number.
[in] | scale | The scaling factor. |
[in] | mat | Matrix to scale. |
std::ostream& algebra3d::operator<< | ( | std::ostream & | stream, |
const Quaternion< fpType > & | quat | ||
) |
Outputs the provided quaternion to the provided stream.
[in] | stream | The stream to use. |
[in] | quat | The quaternion to output. |
std::ostream& algebra3d::operator<< | ( | std::ostream & | stream, |
const Vector3< fpType > & | vec | ||
) |
Outputs the provided vector to the provided stream.
[in] | stream | The stream to use. |
[in] | vec | The vector to output. |
std::ostream& algebra3d::operator<< | ( | std::ostream & | stream, |
const Matrix3< fpType > & | mat | ||
) |
Outputs the provided matrix to the provided stream..
[in] | stream | The stream to use. |
[in] | mat | The matrix to output. |
std::istream& algebra3d::operator>> | ( | std::istream & | stream, |
Quaternion< fpType > & | quat | ||
) |
Reads data for the provided quaternion from the provided stream.
[in] | stream | The stream to use. |
[in] | quat | The quaternion to fill in. |
std::istream& algebra3d::operator>> | ( | std::istream & | stream, |
Vector3< fpType > & | vec | ||
) |
Reads data for the provided vector from the provided stream.
[in] | stream | The stream to use. |
[in] | vec | The vector to fill in. |
std::istream& algebra3d::operator>> | ( | std::istream & | stream, |
Matrix3< fpType > & | mat | ||
) |
Reads data for the provided matrix from the provided stream.
[in] | stream | The stream to use. |
[in] | mat | The matrix to fill in. |
|
inline |
Returns the sign of the given number.
[in] | val | The number to return the sign for. |
|
inline |
Returns the sign for non-negative numbers and 1 for 0.
[in] | val | The number to return the sgn* for. |