Public Types |
typedef vec< D, T > | vec_type |
| This class type.
|
Public Member Functions |
| vec () |
| Default Constructor.
|
| vec (const vec_type &_v) |
| vec (const T &_s) |
| ~vec () |
| Destructor.
|
void | clear (void) |
| Clear values.
|
T | x (void) const |
| Get first coordinate value of this vec.
|
T | y (void) const |
| Get second coordinate value of this vec.
|
T | z (void) const |
| Get third coordinate value of this vec.
|
T | w (void) const |
| Get fourth coordinate value of this vec.
|
T | sqrl (void) const |
| Squared-length of this vector ||v||^2.
|
T | length (void) const |
| Length of this vector ||v||.
|
T | angle (const vec_type &_v) const |
| Angle between vectors.
|
vec_type | normal (void) const |
| Get this vector normalized.
|
vec_type | normalize (void) |
| Normalize and return this vector.
|
vec_type | normalize (const T &_l) |
vec_type & | operator= (const vec_type &_v) |
| Assign operator from vec.
|
vec_type & | operator= (const T &_s) |
| Assign operator.
|
vec_type | operator- (void) const |
| Negation operator.
|
vec_type | operator+ (const T &_s) const |
| Sum operator.
|
vec_type | operator+ (const vec_type &_v) const |
| Sum operator.
|
vec_type & | operator+= (const vec_type &_v) |
| Sum operator.
|
vec_type | operator- (const T &_s) const |
| Subtract operator.
|
vec_type | operator- (const vec_type &_v) const |
| Subtract operator.
|
vec_type & | operator-= (const vec_type &_v) |
| Subtract operator.
|
vec_type | operator* (const T &_s) const |
| Multiply operator.
|
vec_type | operator* (const vec_type &_v) const |
| Multiply operator.
|
vec_type & | operator*= (const T &_s) |
| Multiply operator.
|
vec_type & | operator*= (const vec_type &_v) |
| Multiply operator.
|
vec_type | operator/ (const T &_s) const |
| Division operator.
|
vec_type | operator/ (const vec_type &_v) const |
| Division operator.
|
vec_type & | operator/= (const T &_s) |
| Division operator.
|
vec_type & | operator/= (const vec_type &_v) |
| Division operator.
|
T | operator^ (const vec_type &_v) const |
| Dot-product operator.
|
vec_type | operator% (const vec_type &_v) const |
| Cross-product operator.
|
T & | operator[] (const unsigned &_i) |
| Read/write operator.
|
const T & | operator[] (const unsigned &_i) const |
| Read operator.
|
const T * | operator& (void) const |
| Address operator.
|
Protected Attributes |
T | coord [D] |
| D (dimension) coordinate values of type T.
|
Friends |
vec_type | operator* (const T &_s, const vec_type &_v) |
| Multiply operator.
|
bool | operator== (const vec_type &_v1, const vec_type &_v2) |
| Equality-test operator.
|
bool | operator== (const vec_type &_v1, T &_s2) |
| Equality-test operator.
|
bool | operator!= (const vec_type &_v1, const vec_type &_v2) |
| Inequality-test operator.
|
bool | operator!= (const vec_type &_v1, T &_s2) |
| Inequality-test operator.
|
std::ostream & | operator<< (std::ostream &out, const vec_type &_v) |
| Output stream operator.
|
std::istream & | operator>> (std::istream &in, vec_type &_v) |
| Intput stream operator.
|
Related Functions |
(Note that these are not member functions.)
|
template<unsigned D, class T > |
void | project_vertex (vec< D, T > &_v, const vec< D, T > &_n, const vec< D, T > &_p) |
| Project vertex on a plane.
|
template<unsigned D, class T>
class zsig::vec< D, T >
Generic vector type.
Template class for an array of values, such as vector or points, where the dimension is also defined as a template, e.g. vec< 3, double > p; defines a point p in R^3 with double precision coordinates. Note that it was supposed to be used as a vector or point in D dimension, if an array-like vector is intended use valarray class in STL instead.
- Template Parameters:
-
D | Vector dimension |
T | Vector value type |
Definition at line 36 of file vec.hh.