geolib2
|
#include <math_types.h>
Public Member Functions | |
T | cross (const Vec2T &v) const |
returns cross product More... | |
T | dot (const Vec2T &v) const |
returns dot product More... | |
T | length () const |
Returns the length of the vector. More... | |
T | length2 () const |
Returns the squared length of the vector. More... | |
void | normalize () |
Normalizes the vector. More... | |
Vec2T | normalized () const |
Returns the normalized version of the vector. More... | |
bool | operator!= (const Vec2T &v) const |
Vec2T | operator* (T s) const |
multiplies vector with a scalar More... | |
Vec2T & | operator*= (const Vec2T &v) |
Vec2T & | operator*= (T s) |
Vec2T | operator+ (const Vec2T &v) const |
returns addition of this and v More... | |
Vec2T & | operator+= (const Vec2T &v) |
Vec2T | operator- (const Vec2T &v) const |
returns this minus v More... | |
Vec2T & | operator-= (const Vec2T &v) |
Vec2T | operator/ (T s) const |
divides vector by scalar More... | |
Vec2T & | operator/= (const Vec2T &v) |
Vec2T & | operator/= (T s) |
Vec2T & | operator= (const Vec2T &v) |
bool | operator== (const Vec2T &v) const |
T & | operator[] (const uint i) |
const T & | operator[] (const uint i) const |
Vec3T< T > | projectTo3d () const |
Expand vector with a zero 3rd coordinate. More... | |
Vec2T () | |
Vec2T (const T *values) | |
Vec2T (const Vec2T &v)=default | |
Vec2T (T value) | |
Vec2T (T x_, T y_) | |
~Vec2T () | |
Public Attributes | |
union { | |
struct { | |
T x | |
T y | |
} | |
T m [2] | |
}; | |
Friends | |
Vec2T | operator* (T s, const Vec2T &v) |
multiplies vector with a scalar More... | |
Vec2T | operator- (const Vec2T &v) |
std::ostream & | operator<< (std::ostream &out, const Vec2T &v) |
Definition at line 24 of file math_types.h.
|
inline |
Definition at line 28 of file math_types.h.
|
default |
|
inline |
Definition at line 30 of file math_types.h.
|
inline |
Definition at line 31 of file math_types.h.
|
inline |
Definition at line 32 of file math_types.h.
|
inline |
Definition at line 42 of file math_types.h.
|
inline |
returns cross product
Definition at line 60 of file math_types.h.
|
inline |
returns dot product
Definition at line 57 of file math_types.h.
|
inline |
Returns the length of the vector.
Definition at line 78 of file math_types.h.
|
inline |
Returns the squared length of the vector.
Definition at line 81 of file math_types.h.
|
inline |
Normalizes the vector.
Definition at line 87 of file math_types.h.
|
inline |
Returns the normalized version of the vector.
Definition at line 84 of file math_types.h.
|
inline |
Definition at line 52 of file math_types.h.
|
inline |
multiplies vector with a scalar
Definition at line 69 of file math_types.h.
|
inline |
Definition at line 93 of file math_types.h.
|
inline |
Definition at line 96 of file math_types.h.
|
inline |
returns addition of this and v
Definition at line 63 of file math_types.h.
|
inline |
Definition at line 91 of file math_types.h.
|
inline |
returns this minus v
Definition at line 66 of file math_types.h.
|
inline |
Definition at line 92 of file math_types.h.
|
inline |
divides vector by scalar
Definition at line 72 of file math_types.h.
|
inline |
Definition at line 94 of file math_types.h.
|
inline |
Definition at line 97 of file math_types.h.
|
inline |
Definition at line 34 of file math_types.h.
|
inline |
Definition at line 48 of file math_types.h.
|
inline |
Definition at line 44 of file math_types.h.
|
inline |
Definition at line 46 of file math_types.h.
|
inline |
Expand vector with a zero 3rd coordinate.
Definition at line 103 of file math_types.h.
multiplies vector with a scalar
Definition at line 75 of file math_types.h.
Definition at line 89 of file math_types.h.
|
friend |
Definition at line 108 of file math_types.h.
union { ... } |
T geo::Vec2T< T >::m[2] |
Definition at line 115 of file math_types.h.
T geo::Vec2T< T >::x |
Definition at line 114 of file math_types.h.
T geo::Vec2T< T >::y |
Definition at line 114 of file math_types.h.