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