#include <vector3.h>
Assignment | |
void | set (const T *ptr) throw (Exception::NullPointer) |
Assign from an array. | |
void | set (const T &value) throw () |
Assign from a scalar. | |
void | set (const T &vx, const T &vy, const T &vz) throw () |
Assign the vector components. | |
void | set (const TVector3 &vector) throw () |
Assign from another TVector3. | |
void | set (const T &r, const TAngle< T > &phi, const TAngle< T > &theta) throw () |
Assign from spherical polar coordinates. | |
TVector3 & | operator= (const TVector3 &v) throw () |
Assignment operator. | |
TVector3 & | operator= (T value) throw () |
Assignment operator. | |
TVector3 & | operator= (const T *ptr) throw (Exception::NullPointer) |
Array assignment operator. | |
void | get (T *ptr) const throw (Exception::NullPointer) |
Assign to an array. | |
void | get (T &x, T &y, T &z) const throw () |
Assign to three variables of type T . | |
void | get (TVector3 &vector) const throw () |
Assign to another Vector3. | |
void | get (T &r, TAngle< T > &phi, TAngle< T > &theta) const throw () |
Assign to polar coordinates. | |
void | swap (TVector3 &vector) throw () |
Swap the contents of two vectors. | |
T | getLength () const throw () |
Return the length of the vector. | |
T | getSquareLength () const throw () |
Return the squared length of the vector. | |
TVector3 & | normalize () throw (Exception::DivisionByZero) |
Normalize the vector. | |
TVector3 & | negate () throw () |
Negate the vector. | |
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 TVector3 & | getZero () throw () |
Return a vector with all components 0. | |
const TVector3 & | getUnit () throw () |
Return a vector with all components 1. | |
Geometric properties | |
T | getDistance (const TVector3 &vector) const throw () |
Return the distance to another vector. | |
T | getSquareDistance (const TVector3 &vector) const throw () |
Return the squared distance to another vector. | |
TAngle< T > | getAngle (const TVector3 &vector) const throw (Exception::DivisionByZero) |
Return the enclosed angle of two vectors. | |
TVector3 | getOrthogonalProjection (const TVector3 &direction) const throw () |
Return the orthogonal projection of this vector onto another. | |
TVector3 | getPerpendicularNormalization (const TVector3 &a, const TVector3 &b, const TVector3 &c) throw () |
Return the perpendicular normalization of the vector. | |
T | getTripleProduct (const TVector3< T > &a, const TVector3< T > &b, const TVector3< T > &c) throw () |
Triple product of three vectors. | |
Public Member Functions | |
Constructors and Destructors | |
TVector3 () throw () | |
Default constructor. | |
TVector3 (const T *ptr) throw (Exception::NullPointer) | |
Array constructor. | |
TVector3 (const T &value) throw () | |
Scalar constructor. | |
TVector3 (const T &vx, const T &vy, const T &vz) throw () | |
Detailed constructor. | |
TVector3 (const TVector3 &vector) throw () | |
Copy constructor. | |
TVector3 (const T &r, const TAngle< T > &phi, const TAngle< T > &theta) throw () | |
Spherical polar coordinate constructor. | |
~TVector3 () throw () | |
Destructor. | |
void | clear () throw () |
Clear method The values are set to 0. | |
Arithmetic operators | |
const TVector3 & | operator+ () const throw () |
Positive sign. | |
TVector3 | operator- () const throw () |
Negative sign. | |
TVector3 | operator+ (const TVector3 &b) const throw () |
Addition. | |
TVector3 | operator- (const TVector3 &b) const throw () |
Subtraction. | |
TVector3 & | operator+= (const TVector3 &vector) throw () |
Add a vector to this vector. | |
TVector3 & | operator-= (const TVector3 &vector) throw () |
Subtract a vector from this vector. | |
TVector3 | operator * (const T &scalar) const throw () |
Scalar product. | |
TVector3 & | operator *= (const T &scalar) throw () |
Multiply by a scalar. | |
TVector3 | operator/ (const T &lambda) const throw (Exception::DivisionByZero) |
Fraction of a vector. | |
TVector3 & | operator/= (const T &lambda) throw (Exception::DivisionByZero) |
Divide a vector by a scalar. | |
T | operator * (const TVector3 &vector) const throw () |
Dot product. | |
TVector3 | operator% (const TVector3 &vector) const throw () |
Cross product. | |
TVector3 & | operator%= (const TVector3 &vector) throw () |
Assign to the cross product. | |
Predicates | |
bool | operator== (const TVector3 &vector) const throw () |
Equality operator. | |
bool | operator!= (const TVector3 &vector) const throw () |
Inequality operator. | |
bool | operator< (const TVector3 &vector) const throw () |
Needed for MSVC. | |
bool | isZero () const throw () |
Zero predicate. | |
bool | isOrthogonalTo (const TVector3 &vector) const throw () |
Orthogonality predicate. | |
Storable Interface | |
void | write (PersistenceManager &pm) const throw () |
Persistent stream writing. | |
bool | read (PersistenceManager &pm) throw () |
Persistent stream reading. | |
Debugging and Diagnostics | |
void | dump (std::ostream &s=std::cout, Size depth=0) const throw () |
Internal state dump. | |
bool | isValid () const throw () |
Test if instance is valid. | |
Public Attributes | |
Vector components | |
For easier access, the three components of the vector are public members. | |
T | x |
x component of the vector | |
T | y |
y component of the vector | |
T | z |
z component of the vector |
|
Default constructor.
This method creates a new TVector3 object. The three components are initialized to |
|
Array constructor.
This constructor creates a TVector3 object from the first three elements pointed to by
|
|
Scalar constructor.
Create a new vector with all components set to the same
|
|
Detailed constructor.
Create a new TVector3 object from three variables of type
|
|
Copy constructor. Create a new TVector3 object from another.
|
|
Spherical polar coordinate constructor.
Create a TVector3 object and set its coordinates to the point described by the three spherical polar coordinates
|
|
Destructor. Destructs the TVector3 object. As there are no dynamic data structures, nothing happens. |
|
Clear method The values are set to 0.
|
|
Internal state dump. Dump the current internal state of {*this} to the output ostream s with dumping depth depth .
|
|
Assign to polar coordinates.
Sets
|
|
Assign to another Vector3. Assigns the vector components to another vector.
|
|
Assign to three variables of type
|
|
Assign to an array.
Sets the first three array elements pointed to by
|
|
Return the enclosed angle of two vectors.
|
|
Return the distance to another vector.
|
|
Return the length of the vector. The length of the vector is calculated as .
|
|
Return the orthogonal projection of this vector onto another.
|
|
Return the perpendicular normalization of the vector.
|
|
Return the squared distance to another vector.
|
|
Return the squared length of the vector. This method avoids the square root needed in getLength, so this method is preferred if possible.
|
|
Triple product of three vectors. Calculate the parallelepipedal product of three vectors.
|
|
Return a vector with all components 1.
|
|
Return a vector with all components 0.
|
|
Orthogonality predicate.
|
|
Test if instance is valid. Always returns true.
|
|
Zero predicate. The function Maths::isZero is used to compare the values with zero. Maths::isZero |
|
Negate the vector. Negate the three components of the vector
|
|
Normalize the vector. The vector is scaled with its length: .
|
|
Dot product.
Return the dot product of this vector and |
|
Scalar product.
Return
|
|
Multiply by a scalar.
Multiply all components of the vector by a
|
|
Inequality operator. The function Maths::isEqual is used to compare the values. Maths::isEqual
|
|
Cross product.
Return the cross product of this vector and |
|
Assign to the cross product. Assign the vector to its cross product with another vector. |
|
|
|
Positive sign.
|
|
Add a vector to this vector.
Add the components of
|
|
|
|
Negative sign.
|
|
Subtract a vector from this vector.
|
|
Fraction of a vector.
Return
|
|
Divide a vector by a scalar.
|
|
Array assignment operator. Assigns the first three elements of an array to the vector components.
|
|
Assignment operator. Assign a constant value to all three vector components.
|
|
Assignment operator. Assign the vector components from another vector.
|
|
Equality operator. The function Maths::isEqual is used to compare the values. Maths::isEqual
|
|
Constant array-like access to the components.
|
|
Mutable array-like access to the components.
|
|
Assign from spherical polar coordinates. The radius describes the distance of the point from the origin.
|
|
Assign from another TVector3.
|
|
Assign the vector components.
|
|
Assign from a scalar.
Assign
|
|
Assign from an array.
Assign the three components
|
|
Swap the contents of two vectors.
|