#include <CV4D.h>
Public Member Functions | |
CV4D () | |
CV4D (double rdX, double rdY, double rdZ) | |
CV4D (double rdX, double rdY, double rdZ, double rdW) | |
CV4D (const CV4D &Vector) | |
operator CV3D () const | |
const CV4D & | operator= (const CV4D &) |
bool | operator== (const CV4D &) const |
bool | operator!= (const CV4D &) const |
CV4D & | operator+= (const CV4D &) |
CV4D & | operator-= (const CV4D &) |
CV4D | operator+ (const CV4D &) const |
CV4D | operator- (const CV4D &) const |
CV4D | operator- () const |
double | operator * (const CV4D &) const |
CV4D | operator * (double) const |
CV4D | operator/ (double) |
CV4D | operator| (const CV4D &) const |
double & | operator[] (int i) |
double | operator[] (int i) const |
double | getX () const |
double | getY () const |
double | getZ () const |
double | getW () const |
void | setX (double rdX) |
void | setY (double rdY) |
void | setZ (double rdZ) |
void | setW (double rdW) |
void | setCoord (double rdX, double rdY, double rdZ, double rdW) |
double | getNorm () const |
void | normalize () |
CV4D | getNormalized () const |
void | print () const |
Static Public Attributes | |
static double | epsilon = DOUBLE_EPSILON |
Protected Attributes | |
double | m_ard [4] |
Friends | |
CV4D | operator * (double, const CV4D &) |
ostream & | operator<< (ostream &, const CV4D &) |
istream & | operator>> (istream &, CV4D &) |
CV4D::CV4D | ( | ) | [inline] |
Default constructor. The default value of the instantiated vector will be (0.0,0.0,0.0,0.0).
CV4D::CV4D | ( | double | rdX, | |
double | rdY, | |||
double | rdZ | |||
) | [inline] |
Construct new vector. The value of the vector will be (rdX, rdY, rdZ, 1).
CV4D::CV4D | ( | double | rdX, | |
double | rdY, | |||
double | rdZ, | |||
double | rdW | |||
) | [inline] |
Construct new vector. The value of the vector will be (rdX, rdY, rdZ, rdW).
CV4D::CV4D | ( | const CV4D & | Vector | ) | [inline] |
Copy constructor. Initializes the new vector with the vector passed in 'v'.
double CV4D::getNorm | ( | ) | const |
Returns the euclidian norm of the vector.
CV4D CV4D::getNormalized | ( | ) | const |
Returns the normalized vector.
double CV4D::getW | ( | ) | const [inline] |
Returns the w-coordinate of the vector.
double CV4D::getX | ( | void | ) | const [inline] |
Returns the x-coordinate of the vector.
double CV4D::getY | ( | void | ) | const [inline] |
Returns the y-coordinate of the vector.
double CV4D::getZ | ( | void | ) | const [inline] |
Returns the z-coordinate of the vector.
void CV4D::normalize | ( | ) |
Normalizes the vector.
CV4D CV4D::operator * | ( | double | ) | const |
Multiplication of a vector with a scalar.
double CV4D::operator * | ( | const CV4D & | ) | const |
Scalar multiplication of two vectors. The result will be returned.
CV4D::operator CV3D | ( | ) | const |
bool CV4D::operator!= | ( | const CV4D & | ) | const |
Compares to vectors. Same as above. Only the result is negated.
CV4D CV4D::operator- | ( | ) | const |
Negates the vector.
CV4D CV4D::operator/ | ( | double | ) |
Division of a vector with a scalar.
bool CV4D::operator== | ( | const CV4D & | ) | const |
Compares to vectors. The result will be 'true' if the two vector are indentically in each component. Otherwise 'false' will be returned.
double CV4D::operator[] | ( | int | i | ) | const [inline] |
Same as above but for constant vectors.
double& CV4D::operator[] | ( | int | i | ) | [inline] |
Returns the i-th component of the vector. The index goes from 0 to 3, so 0 stands for the x-coordinate, 1 for the y-coordinate and so on.
crossproduct. (I know that this is only defined in three dimensions). For the calculation only the coefficient for the x-, y- and z-direction will be used. The fourth coefficient (known as 'w') will be set to 1.
void CV4D::print | ( | ) | const |
Prints a vector to the standard output.
void CV4D::setCoord | ( | double | rdX, | |
double | rdY, | |||
double | rdZ, | |||
double | rdW | |||
) | [inline] |
Set the values of the vector. The value of the vector will be (rdX, rdY, rdZ, rdW).
void CV4D::setW | ( | double | rdW | ) | [inline] |
Sets the w-coordinate of the vector to 'rdW'.
void CV4D::setX | ( | double | rdX | ) | [inline] |
Sets the x-coordinate of the vector to 'rdX'.
void CV4D::setY | ( | double | rdY | ) | [inline] |
Sets the y-coordinate of the vector to 'rdY'.
void CV4D::setZ | ( | double | rdZ | ) | [inline] |
Sets the z-coordinate of the vector to 'rdZ'.
Multiplication of a scalar with a vector.
ostream& operator<< | ( | ostream & | s, | |
const CV4D & | v | |||
) | [friend] |
Same as above. But more useful for streams.
istream& operator>> | ( | istream & | s, | |
CV4D & | v | |||
) | [friend] |
Reads a vector from the given stream.
double CV4D::epsilon = DOUBLE_EPSILON [static] |
double CV4D::m_ard[4] [protected] |