3 Component Double precision Vector. More...
#include <decDVector.h>
Public Member Functions | |
Constructors and Destructors | |
| decDVector () | |
| Creates a new vector initialized to ( 0,0,0 ). | |
| decDVector (double nx, double ny, double nz) | |
| Creates a new vector with the given values. | |
| decDVector (const decDVector &v) | |
| Creatses a new vector with the values of another vector. | |
| decDVector (const decVector &v) | |
| Creatses a new vector with the values of another vector. | |
Management | |
| double | Length () const |
| Retrieves the length of the vector. | |
| void | Normalize () |
| Normalizes the vector. | |
| void | Snap (double grid) |
| Snaps the components of the vector to a grid with the given size. | |
| bool | IsEqualTo (const decDVector &v, double threshold=1e-6) const |
| Determines if the components of this vector are equal to another one with respect to a threshold. | |
| void | SetZero () |
| Sets all components to 0. | |
| void | Set (double nx, double ny, double nz) |
| Sets the components to the given values. | |
| void | Set (const decDVector &v) |
| Sets the components to the given vector. | |
| void | Set (const decVector &v) |
| Sets the components to the given vector. | |
| void | Negate () |
| Negates the vector. | |
| decVector | ToVector () const |
| Concerts to a normal precision vector with possible precision loss. | |
Operators | |
| decDVector | operator- () const |
| Retrieves the negation of this vector. | |
| decDVector & | operator= (const decDVector &v) |
| Sets the components of this vector to the values of another one. | |
| decDVector & | operator+= (const decDVector &v) |
| Adds the components of another vector to this one. | |
| decDVector & | operator-= (const decDVector &v) |
| Subtracts the components of another vector from this vector. | |
| decDVector & | operator*= (double k) |
| Multiplies the components of this vector with a value k. | |
| decDVector & | operator/= (double k) |
| Divides the components of this vector by a value k. | |
| decDVector | operator+ (const decDVector &v) const |
| Retrieves a new vector with the sum of this vector with another one. | |
| decDVector | operator- (const decDVector &v) const |
| Retrieves a new vector with the difference of this vector to another one. | |
| decDVector | operator* (double k) const |
| Retrieves a new vector with this vector scaled by k. | |
| double | operator* (const decDVector &v) const |
| Calculates the dor product of this vector with another one. | |
| decDVector | operator/ (double k) const |
| Retrieves a new vector with this vector divided by k. | |
| decDVector | operator% (const decDVector &v) const |
| Retrieves a new vector with the cross producr of this vector with another one. | |
| bool | operator< (const decDVector &v) const |
| Determines if all the components of this vector are less then the components of another one. | |
| bool | operator> (const decDVector &v) const |
| Determines if all the components of this vector are greater then the components of another one. | |
| bool | operator<= (const decDVector &v) const |
| Determines if all the components of this vector are less then or equal to the components of another one. | |
| bool | operator>= (const decDVector &v) const |
| Determines if all the components of this vector are greater then or equal to the components of another one. | |
Public Attributes | |
| double | x |
| X Component of vector. | |
| double | y |
| Y Component of vector. | |
| double | z |
| Z Component of vector. | |
3 Component Double precision Vector.
The difference to the other vector class is just that this class uses double instead of float.
| decDVector::decDVector | ( | ) | [inline] |
Creates a new vector initialized to ( 0,0,0 ).
Referenced by operator%(), operator*(), operator+(), operator-(), and operator/().
| decDVector::decDVector | ( | double | nx, |
| double | ny, | ||
| double | nz | ||
| ) | [inline] |
| decDVector::decDVector | ( | const decDVector & | v ) | [inline] |
| decDVector::decDVector | ( | const decVector & | v ) | [inline] |
Creatses a new vector with the values of another vector.
References decVector::x, x, decVector::y, y, decVector::z, and z.
| bool decDVector::IsEqualTo | ( | const decDVector & | v, |
| double | threshold = 1e-6 |
||
| ) | const |
Determines if the components of this vector are equal to another one with respect to a threshold.
| double decDVector::Length | ( | ) | const |
Retrieves the length of the vector.
| void decDVector::Normalize | ( | ) |
Normalizes the vector.
If the length of the vector is 0 an exception is thrown.
| decDVector decDVector::operator% | ( | const decDVector & | v ) | const [inline] |
Retrieves a new vector with the cross producr of this vector with another one.
References decDVector(), x, y, and z.
| decDVector decDVector::operator* | ( | double | k ) | const [inline] |
Retrieves a new vector with this vector scaled by k.
References decDVector(), x, y, and z.
| double decDVector::operator* | ( | const decDVector & | v ) | const [inline] |
| decDVector& decDVector::operator*= | ( | double | k ) | [inline] |
| decDVector decDVector::operator+ | ( | const decDVector & | v ) | const [inline] |
Retrieves a new vector with the sum of this vector with another one.
References decDVector(), x, y, and z.
| decDVector& decDVector::operator+= | ( | const decDVector & | v ) | [inline] |
| decDVector decDVector::operator- | ( | const decDVector & | v ) | const [inline] |
Retrieves a new vector with the difference of this vector to another one.
References decDVector(), x, y, and z.
| decDVector decDVector::operator- | ( | ) | const [inline] |
Retrieves the negation of this vector.
References decDVector(), x, y, and z.
| decDVector& decDVector::operator-= | ( | const decDVector & | v ) | [inline] |
| decDVector decDVector::operator/ | ( | double | k ) | const [inline] |
Retrieves a new vector with this vector divided by k.
If k is 0 an exception is thrown.
References decDVector(), THROW, x, y, and z.
| decDVector& decDVector::operator/= | ( | double | k ) | [inline] |
| bool decDVector::operator< | ( | const decDVector & | v ) | const [inline] |
| bool decDVector::operator<= | ( | const decDVector & | v ) | const [inline] |
| decDVector& decDVector::operator= | ( | const decDVector & | v ) | [inline] |
| bool decDVector::operator> | ( | const decDVector & | v ) | const [inline] |
| bool decDVector::operator>= | ( | const decDVector & | v ) | const [inline] |
| void decDVector::Set | ( | const decDVector & | v ) | [inline] |
| void decDVector::Set | ( | double | nx, |
| double | ny, | ||
| double | nz | ||
| ) | [inline] |
| void decDVector::Set | ( | const decVector & | v ) | [inline] |
Sets the components to the given vector.
References decVector::x, x, decVector::y, y, decVector::z, and z.
| void decDVector::Snap | ( | double | grid ) |
Snaps the components of the vector to a grid with the given size.
| decVector decDVector::ToVector | ( | ) | const |
Concerts to a normal precision vector with possible precision loss.
| double decDVector::x |
X Component of vector.
Referenced by decDVector(), Negate(), operator%(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator<(), operator<=(), operator=(), operator>(), operator>=(), Set(), and SetZero().
| double decDVector::y |
Y Component of vector.
Referenced by decDVector(), Negate(), operator%(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator<(), operator<=(), operator=(), operator>(), operator>=(), Set(), and SetZero().
| double decDVector::z |
Z Component of vector.
Referenced by decDVector(), Negate(), operator%(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator<(), operator<=(), operator=(), operator>(), operator>=(), Set(), and SetZero().
1.7.2