A 3D point/vector class. More...
#include <point.h>
Public Member Functions | |
const T * | c_data () const |
Return the data as a C-style array. | |
Point< T > | cross (const Point< T > &p) const |
T | distance (const Point< T > &p) const |
T | distance_sq (const Point< T > &p) const |
T | length () const |
T | length_sq () const |
void | normalise (T l) |
void | normalise () |
Point & | operator*= (const T &p) |
In-place multiplication by a scalar. | |
Point | operator+ (const Point &p) const |
Point & | operator+= (const Point &p) |
Point | operator- () const |
Vector negation. | |
Point | operator- (const Point &p) const |
Point & | operator-= (const Point &p) |
Point | operator/ (const T &p) const |
Division by a scalar. | |
Point & | operator/= (const T &p) |
In-place division by a scalar. | |
Point (const T &x=T(), const T &y=T(), const T &z=T()) | |
Point (const Vector< 3, T > &v) | |
Constructor. | |
Point< T > | proj (const Point< T > &p) const |
Vector projection. | |
T | proj_length (const Point< T > &p) const |
Vector projection length. | |
virtual | ~Point () |
Destructor. |
A 3D point/vector class.
The Point class is a utility class tp handle operations on three-dimensional xyz-points and vectors. For some functions, T must be reducible to a floating point type to satisfy the functions used in the math library.
Definition at line 25 of file point.h.
util::Point< T >::Point | ( | const Vector< 3, T > & | v | ) | [inline] |
virtual util::Point< T >::~Point | ( | ) | [inline, virtual] |
const T* util::Point< T >::c_data | ( | ) | const [inline] |
Return the data as a C-style array.
Reimplemented from util::Vector< 3, T >.
Point& util::Point< T >::operator*= | ( | const T & | scalar | ) | [inline] |
In-place multiplication by a scalar.
Reimplemented from util::Vector< 3, T >.
Definition at line 46 of file point.h.
00046 { this->Vector<3,T>::operator*=( p ); return *this; }
Point util::Point< T >::operator- | ( | void | ) | const [inline] |
Vector negation.
Reimplemented from util::Vector< 3, T >.
Definition at line 51 of file point.h.
00051 { return this->Vector<3,T>::operator-(); }
Point util::Point< T >::operator/ | ( | const T & | scalar | ) | const [inline] |
Division by a scalar.
Reimplemented from util::Vector< 3, T >.
Definition at line 50 of file point.h.
00050 { return this->Vector<3,T>::operator/( p ); }
Point& util::Point< T >::operator/= | ( | const T & | scalar | ) | [inline] |
In-place division by a scalar.
Reimplemented from util::Vector< 3, T >.
Definition at line 47 of file point.h.
00047 { this->Vector<3,T>::operator/=( p ); return *this; }
Point< T > util::Point< T >::proj | ( | const Point< T > & | p | ) | const [inline] |
T util::Point< T >::proj_length | ( | const Point< T > & | p | ) | const [inline] |