#include <vector3.h>
Collaboration diagram for NUM::Vector3< T >:
Public Types | |
enum | { X = 0, Y = 1, Z = 2 } |
enum | _Mul { Mul } |
Dummy enums for constructor selection; mostly internal use. More... | |
enum | _TrafoDir { TrafoDir } |
enum | _TrafoNorm { TrafoNorm } |
Public Member Functions | |
Vector3 () | |
Default constructor does not initialize the variables. | |
Vector3 (T x, T y, T z) | |
Construct 3dim vector with specified entries. | |
Vector3 (const Vector3 &a) | |
Copy-constructor as usual. | |
Vector3 (const T *a) | |
Construct a vector using passed elements a[0..2] (from array). | |
Vector3 (_Mul, const OMatrix< T > &a, const Vector3< T > &b) | |
See vector3.h. | |
Vector3 (_TrafoDir, const OMatrix< T > &m, const Vector3< T > &b) | |
See vector3.h. | |
Vector3 (_TrafoNorm, const Vector3< T > &a, const OMatrix< T > &m) | |
See vector3.h. | |
~Vector3 () | |
Destructor (a no-op). | |
T & | operator[] (int i) |
const T & | operator[] (int i) const |
operator T * () | |
Get internally used array of elements. Use with care. | |
operator const T * () const | |
int | dim () const |
Get dimension of vector. This is always 3. | |
Vector3 & | operator= (const Vector3 &a) |
Assignment operator: Copy passed vector. | |
Vector3 & | promote (T a) |
"Promote" a value, i.e. set all elements of the vector to a. | |
T | len2 () const |
Get the squared length (Euclidic norm) of the vector. | |
T | len () const |
Get the length of the vector (Euclidic norm). | |
T | norm1 () const |
Get the 1-norm of the vector, i.e. |x|+|y|+|z|,. | |
T | max () const |
Get the largest element of the vector. | |
T | min () const |
Get the smallest element of the vector. | |
Vector3 & | operator+= (const Vector3 &a) |
Add a vector to this one:. | |
Vector3 & | operator-= (const Vector3 &a) |
Subtract a vector from this one:. | |
Vector3 & | AddScaled (const Vector3 &a, T f) |
Add a*f to *this. | |
Vector3 & | operator *= (T a) |
Multiply vector with sclar value:. | |
Vector3 & | operator/= (T a) |
Vector3 & | cross (const Vector3 &a, const Vector3 &b) |
Compute the vector (cross) product of two vectors; store result in *this. | |
T | normalize () |
Bring the vector to length 1; returns previous length. | |
T | normalize (T wl) |
Bring the vector to specified length l; returns previous length. | |
Vector3 & | neg () |
Change the sign of every element:. | |
bool | IsNull (T epsilon) const |
Static Public Attributes | |
const Vector3< T > | UX |
Unity vectors in x,y and z direction as well as the 0 vector:. | |
const Vector3< T > | UY |
Unity vectors in x,y and z direction as well as the 0 vector:. | |
const Vector3< T > | UZ |
Unity vectors in x,y and z direction as well as the 0 vector:. | |
const Vector3< T > | Null |
Unity vectors in x,y and z direction as well as the 0 vector:. | |
Private Attributes | |
T | v [3] |
Internally stores the vector. |
Definition at line 144 of file vector3.h.
|
These are just array indices which may come handy if one wants to make code more readable. |
|
Dummy enums for constructor selection; mostly internal use.
|
|
|
|
|
|
Default constructor does not initialize the variables.
|
|
Construct 3dim vector with specified entries.
Definition at line 169 of file vector3.h. References NUM::Vector3< T >::v, and NUM::y. |
|
Copy-constructor as usual.
Definition at line 172 of file vector3.h. References NUM::Vector3< T >::v. |
|
Construct a vector using passed elements a[0..2] (from array).
Definition at line 175 of file vector3.h. References NUM::Vector3< T >::v. |
|
See vector3.h.
Definition at line 307 of file omatrix.h. References NUM::Vector3< T >::v. |
|
See vector3.h.
Definition at line 315 of file omatrix.h. References NUM::Vector3< T >::v. |
|
See vector3.h.
Definition at line 323 of file omatrix.h. References NUM::Vector3< T >::v. |
|
Destructor (a no-op).
|
|
Add a*f to *this.
Definition at line 236 of file vector3.h. References NUM::Vector3< T >::v. |
|
Compute the vector (cross) product of two vectors; store result in *this.
Definition at line 248 of file vector3.h. References NUM::Vector3< T >::v. |
|
Get dimension of vector. This is always 3.
|
|
Compare vector against 0 with specified epsilon value:
Definition at line 266 of file vector3.h. References NUM::fabs(), and NUM::Vector3< T >::v. |
|
Get the length of the vector (Euclidic norm).
Definition at line 212 of file vector3.h. References NUM::Vector3< T >::len2(). Referenced by NUM::normalize(), and NUM::Vector3< T >::normalize(). |
|
Get the squared length (Euclidic norm) of the vector.
Definition at line 209 of file vector3.h. References NUM::Vector3< T >::v. Referenced by NUM::angle(), and NUM::Vector3< T >::len(). |
|
Get the largest element of the vector.
Definition at line 220 of file vector3.h. References NUM::Vector3< T >::v. |
|
Get the smallest element of the vector.
Definition at line 224 of file vector3.h. References NUM::Vector3< T >::v. |
|
Change the sign of every element:.
Definition at line 261 of file vector3.h. References NUM::Vector3< T >::v. |
|
Get the 1-norm of the vector, i.e. |x|+|y|+|z|,.
Definition at line 216 of file vector3.h. References NUM::fabs(), and NUM::Vector3< T >::v. |
|
Bring the vector to specified length l; returns previous length.
Definition at line 257 of file vector3.h. References NUM::Vector3< T >::len(), and NUM::Vector3< T >::v. |
|
Bring the vector to length 1; returns previous length.
Definition at line 254 of file vector3.h. References NUM::Vector3< T >::len(), and NUM::Vector3< T >::v. |
|
Multiply vector with sclar value:.
Definition at line 240 of file vector3.h. References NUM::Vector3< T >::v. |
|
Definition at line 194 of file vector3.h. References NUM::Vector3< T >::v. |
|
Get internally used array of elements. Use with care.
Definition at line 193 of file vector3.h. References NUM::Vector3< T >::v. |
|
Add a vector to this one:.
Definition at line 229 of file vector3.h. References NUM::Vector3< T >::v. |
|
Subtract a vector from this one:.
Definition at line 232 of file vector3.h. References NUM::Vector3< T >::v. |
|
Divide vector by scalar value. For speed reasons, you should better multiply with 1/a. Definition at line 244 of file vector3.h. References NUM::Vector3< T >::v. |
|
Assignment operator: Copy passed vector.
Definition at line 201 of file vector3.h. References NUM::Vector3< T >::v. |
|
Definition at line 190 of file vector3.h. References NUM::Vector3< T >::v. |
|
Access to the vector members. Indices 0,1,2 or X,Y,Z. No range check. Definition at line 189 of file vector3.h. References NUM::Vector3< T >::v. |
|
"Promote" a value, i.e. set all elements of the vector to a.
Definition at line 205 of file vector3.h. References NUM::Vector3< T >::v. |
|
Unity vectors in x,y and z direction as well as the 0 vector:.
|
|
Unity vectors in x,y and z direction as well as the 0 vector:.
|
|
Unity vectors in x,y and z direction as well as the 0 vector:.
|
|
Unity vectors in x,y and z direction as well as the 0 vector:.
|
|