libt3d
2.6
|
A 3D vector. More...
#include <v3d.h>
Public Member Functions | |
V3D (void) | |
Vector constructor. | |
V3D (double x, double y, double z) | |
Vector constructor. | |
double & | operator[] (unsigned int i) |
Vector element accessor. | |
double & | operator() (unsigned int i) |
Vector element accessor. | |
double & | operator[] (V3DVectorIndex i) |
V3D | operator+ (const V3D &inV) const |
Sum of two vectors or of a vector and a point. | |
V3D | operator+= (const V3D &inV) |
Sum of two vectors or of a vector and a point. | |
V3D | operator- () const |
the opposite vector. | |
V3D | operator- (const V3D &inV) const |
Substraction of two vectors or of a vector and a point. | |
V3D | operator-= (const V3D &inV) |
Substraction of two vectors or of a vector and a point. | |
V3D | operator/ (const double d) const |
Divide the vector by an double. | |
V3D | operator/= (const double d) |
Divide the vector by an double. | |
V3D | operator* (const double d) const |
Multiply the vector by a double. | |
V3D | operator*= (const double d) |
Multiply the vector by a double. | |
double | operator* (const V3D &inV) const |
dot product | |
V3D | operator^ (const V3D &inV) const |
Vector product. | |
bool | operator== (const V3D &inV) const |
Vector comparison. | |
double | norm () const |
Compute euclidian norm of a V3D. | |
V3D & | normalize () |
Normalize a V3D. | |
Public Attributes | |
double | v [4] |
Homogeneous coordinates. | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const V3D &v3d) |
Output a ASCII V3D description to a stream. |
A 3D vector.
This structure manipulates vectors represented by homogeneous coordinates.
V3D | ( | void | ) | [inline] |
Vector constructor.
Initialize a vector to all 0.
V3D | ( | double | x, |
double | y, | ||
double | z | ||
) | [inline] |
Vector constructor.
Initialize a vector to x,y and z.
[in] | x | X coordinate. |
[in] | y | Y coordinate. |
[in] | z | Z coordinate. |
double norm | ( | ) | const [inline] |
Compute euclidian norm of a V3D.
[in] | v3d | Input vector |
V3D & normalize | ( | ) | [inline] |
double & operator() | ( | unsigned int | i | ) | [inline] |
Vector element accessor.
in) | i Element number. |
V3D operator* | ( | const double | d | ) | const [inline] |
Multiply the vector by a double.
[in] | d | double to multiply |
double operator* | ( | const V3D & | inV | ) | const [inline] |
dot product
[in] | inV | Vector to multiply |
V3D operator*= | ( | const double | d | ) | [inline] |
Multiply the vector by a double.
[in] | d | double to multiply |
Sum of two vectors or of a vector and a point.
[in] | inV | Vector to sum. |
Sum of two vectors or of a vector and a point.
[in] | inV | Vector to sum. |
V3D operator- | ( | ) | const [inline] |
the opposite vector.
Substraction of two vectors or of a vector and a point.
[in] | inV | Vector to substract. |
Substraction of two vectors or of a vector and a point.
[in] | inV | Vector to substract. |
V3D operator/ | ( | const double | d | ) | const [inline] |
Divide the vector by an double.
[in] | d | double to divide |
V3D operator/= | ( | const double | d | ) | [inline] |
Divide the vector by an double.
[in] | d | double to divide |
bool operator== | ( | const V3D & | inV | ) | const [inline] |
Vector comparison.
[in] | inV | Vector to compare |
double & operator[] | ( | unsigned int | i | ) | [inline] |
Vector element accessor.
[in] | i | Element number. |
double & operator[] | ( | V3DVectorIndex | i | ) | [inline] |
Vector product.
[in] | inV | Vector to multiply |