#include <cvector.h>
Public Member Functions | |
CVector () | |
Default constructor. Initializes to a zero vector. | |
CVector (double xa, double ya, double za) | |
Construction from x-, y-, and z-coordinate. | |
CVector const & | operator*= (CMatrix const &val) |
Vector-matrix multiplication. | |
CVector const & | operator/= (CMatrix const &val) |
CVector const | operator* (double const &val) const |
Vector-scalar multiplication. | |
CVector const & | operator*= (double const &val) |
Vector-scalar multiplication. | |
CVector const | operator/ (double const &val) const |
Vector-scalar division. | |
CVector const & | operator/= (double const &val) |
Vector-scalar division. | |
CVector const | operator+ (CVector const &val) const |
Vector-vector addition. | |
CVector const | operator- (CVector const &val) const |
Vector-vector subtraction. | |
CVector const & | operator+= (CVector const &val) |
Vector-vector addition. | |
CVector const & | operator-= (CVector const &val) |
Vector-vector subtraction. | |
CVector const | operator- () const |
Vector negation. | |
double const | operator* (CVector const &val) const |
Vector-vector multiplication (equivalent to dotProduct). | |
double | dotProduct (CVector const &val) const |
Dot product between two vectors. | |
CVector | crossProduct (CVector const &val) const |
Cross product between two vectors. | |
bool | operator!= (CVector const &val) const |
Vector comparison. | |
double | abs () const |
Length of the vector. | |
double | abs2 () const |
Square of the length of the vector. Faster to calculate than abs(). | |
void | normalise () |
Normalize the vector. | |
CVector | normal () const |
Returns the normal of the vector. | |
CVector | component (CVector const &val) const |
Public Attributes | |
Vector coordinate values | |
double | x |
double | y |
double | z |
libProcTer::CVector::CVector | ( | ) |
Default constructor. Initializes to a zero vector.
libProcTer::CVector::CVector | ( | double | xa, | |
double | ya, | |||
double | za | |||
) |
Construction from x-, y-, and z-coordinate.
double libProcTer::CVector::abs | ( | ) | const |
Length of the vector.
double libProcTer::CVector::abs2 | ( | ) | const |
Square of the length of the vector. Faster to calculate than abs().
Returns the component of the vector in the direction pointed by val. Assumes that val is normalized.
Cross product between two vectors.
double libProcTer::CVector::dotProduct | ( | CVector const & | val | ) | const |
Dot product between two vectors.
CVector libProcTer::CVector::normal | ( | ) | const |
Returns the normal of the vector.
void libProcTer::CVector::normalise | ( | ) |
Normalize the vector.
bool libProcTer::CVector::operator!= | ( | CVector const & | val | ) | const |
Vector comparison.
double const libProcTer::CVector::operator* | ( | CVector const & | val | ) | const |
Vector-vector multiplication (equivalent to dotProduct).
CVector const libProcTer::CVector::operator* | ( | double const & | val | ) | const |
Vector-scalar multiplication.
CVector const& libProcTer::CVector::operator*= | ( | double const & | val | ) |
Vector-scalar multiplication.
Vector-matrix multiplication.
CVector const libProcTer::CVector::operator- | ( | ) | const |
Vector negation.
Vector-vector subtraction.
CVector const libProcTer::CVector::operator/ | ( | double const & | val | ) | const |
Vector-scalar division.
CVector const& libProcTer::CVector::operator/= | ( | double const & | val | ) |
Vector-scalar division.
Transpose vector-matrix multiplication. Equivalent to operator*=(val.transpose()).