#include <CV4D.h>
Public Methods | |
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 | |
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 &) |
|
Default constructor. The default value of the instantiated vector will be (0.0,0.0,0.0,0.0). |
|
Construct new vector. The value of the vector will be (rdX, rdY, rdZ, 1). |
|
Construct new vector. The value of the vector will be (rdX, rdY, rdZ, rdW). |
|
Copy constructor. Initializes the new vector with the vector passed in 'v'. |
|
Returns the euclidian norm of the vector. |
|
Returns the normalized vector. |
|
Returns the w-coordinate of the vector. |
|
Returns the x-coordinate of the vector. |
|
Returns the y-coordinate of the vector. |
|
Returns the z-coordinate of the vector. |
|
Normalizes the vector. |
|
Multiplication of a vector with a scalar. |
|
Scalar multiplication of two vectors. The result will be returned. |
|
Cast operator to convert CV4D vectors to CV3D vectors. Each component is devided by the fourth component. |
|
Compares to vectors. Same as above. Only the result is negated.
|
|
Adds two vectors. The sum will be returned. |
|
Adds another vector to this vector. |
|
Negates the vector. |
|
Subtracts two vectors. The difference will be returned. |
|
Subtracts another vector from this vector. |
|
Division of a vector with a scalar. |
|
Assign one vector to another. |
|
Compares to vectors. The result will be 'true' if the two vector are indentically in each component. Otherwise 'false' will be returned. |
|
Same as above but for constant vectors. |
|
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. |
|
Prints a vector to the standard output. |
|
Set the values of the vector. The value of the vector will be (rdX, rdY, rdZ, rdW). |
|
Sets the w-coordinate of the vector to 'rdW'. |
|
Sets the x-coordinate of the vector to 'rdX'. |
|
Sets the y-coordinate of the vector to 'rdY'. |
|
Sets the z-coordinate of the vector to 'rdZ'. |
|
Multiplication of a scalar with a vector. |
|
Same as above. But more useful for streams. |
|
Reads a vector from the given stream. |
|
|
|
|