#include <vector4.h>
Accessors | |
T | getLength () const throw () |
Return the length of the vector. | |
T | getSquareLength () const throw () |
Return the squared length of the vector. | |
TVector4 & | normalize () throw (Exception::DivisionByZero) |
Normalize the vector. | |
void | set (const T &value=(T) 1) throw () |
Assign one value to all vector components. | |
T & | operator[] (Position position) throw (Exception::IndexOverflow) |
Mutable array-like access to the components. | |
const T & | operator[] (Position position) const throw (Exception::IndexOverflow) |
Constant array-like access to the components. | |
const TVector4 & | getZero () throw () |
Return a vector with all components 0. | |
const TVector4 & | getUnit () throw () |
Return a vector with all components 1. | |
Public Member Functions | |
Constructors and Destructors | |
TVector4 () throw () | |
Default constructor. | |
TVector4 (const T *ptr) throw (Exception::NullPointer) | |
Array constructor. | |
TVector4 (const T &value) throw () | |
Scalar constructor. | |
TVector4 (const T &x, const T &y, const T &z, const T &h=(T) 1) throw () | |
Detailed constructor. | |
TVector4 (const TVector4 &vector) throw () | |
Copy constructor. | |
virtual | ~TVector4 () throw () |
Destructor. | |
virtual void | clear () throw () |
Clear method The values are set to 0. | |
Assignment | |
void | set (const T *ptr) throw (Exception::NullPointer) |
Assign from an array. | |
void | set (const T &rx, const T &ry, const T &rz, const T &rh=(T) 1) throw () |
Assign the vector components. | |
void | set (const TVector4 &vector) throw () |
Assign from another TVector4. | |
TVector4 & | operator= (const T *ptr) throw (Exception::NullPointer) |
Array assignment operator. | |
TVector4 & | operator= (const TVector4 &vector) throw () |
Assignment operator. | |
TVector4 & | operator= (T value) throw () |
Assignment operator. | |
void | get (T *ptr) const throw (Exception::NullPointer) |
Assign to an array. | |
void | get (T &rx, T &ry, T &rz, T &rh) const throw () |
Assign to four variables of type T . | |
void | get (TVector4 &vector) const throw () |
Assign to another Vector4. | |
void | swap (TVector4 &vector) throw () |
Swap the contents of two vectors. | |
Arithmetic operators | |
TVector4 | operator+ () const throw () |
Positive sign. | |
TVector4 | operator- () const throw () |
Negative sign. | |
TVector4 & | operator+= (const TVector4 &vector) throw () |
Add a vector to this vector. | |
TVector4 & | operator-= (const TVector4 &vector) throw () |
Subtract a vector from this vector. | |
TVector4 | operator * (const T &scalar) throw () |
Scalar product. | |
TVector4 & | operator *= (const T &scalar) throw () |
Multiply by a scalar. | |
TVector4 | operator/ (const T &scalar) throw (Exception::DivisionByZero) |
Fraction of a vector. | |
TVector4 & | operator/= (const T &scalar) throw (Exception::DivisionByZero) |
Divide a vector by a scalar. | |
T | operator * (const TVector4 &vector) const throw () |
Dot product. | |
T | getDistance (const TVector4 &vector) const throw () |
Return the distance to another vector. | |
T | getSquareDistance (const TVector4 &vector) const throw () |
Return the squared distance to another vector. | |
Predicates | |
bool | operator== (const TVector4 &vector) const throw () |
Equality operator. | |
bool | operator!= (const TVector4 &vector) const throw () |
Inequality operator. | |
bool | isOrthogonalTo (const TVector4 &vector) const throw () |
Orthogonality predicate. | |
Debugging and Diagnostics | |
bool | isValid () const throw () |
Test whether instance is valid. | |
void | dump (std::ostream &s=std::cout, Size depth=0) const throw () |
Internal state dump. | |
Public Attributes | |
Attributes | |
All vector components are public members for convenience. | |
T | x |
x component of the vector | |
T | y |
y component of the vector | |
T | z |
z component of the vector | |
T | h |
height component of the vector |
Representation of points and vectors in four-dimensional space.