|
| | Vector2 () |
| |
| | Vector2 (const T a, const T b) |
| |
| | Vector2 (const NumVector< T, 2 > rhs) |
| |
| | Vector2 (const NVector< T, 2 > rhs) |
| |
| const T | getx () const |
| |
| const T | gety () const |
| |
| double | getxd () const |
| |
| double | getyd () const |
| |
| void | setx (const T a) |
| |
| void | sety (const T b) |
| |
| void | setxd (const double a) |
| |
| void | setyd (const double b) |
| |
| void | set (const T a, const T b) |
| |
| Vector2 | operator- () const |
| |
| Vector2 | operator+ (const Vector2 &rhs) const |
| |
| Vector2 | operator- (const Vector2 &rhs) const |
| |
| T | operator* (const Vector2 &rhs) const |
| |
| template<class U > |
| Vector2 | operator* (const U rhs) const |
| |
| template<class U > |
| Vector2 | operator/ (const U rhs) const |
| |
| T | cross (const Vector2 &rhs) const |
| | The 2D cross product, returning a scalar. More...
|
| |
| Vector2 | cross (const T v) const |
| | The 2D cross product with the "missing" third dimension, returning a vector. More...
|
| |
| Vector2 | perp () const |
| | The vector perpendicular to this one, in the clockwise direction. More...
|
| |
| Vector2 | norm () const |
| | The normalized version of this vector. More...
|
| |
| Vector2 & | operator-= (const Vector2 &rhs) |
| |
| Vector2 & | operator+= (const Vector2 &rhs) |
| |
| template<class U > |
| Vector2 & | operator*= (const U rhs) |
| |
| template<class U > |
| Vector2 & | operator/= (const U rhs) |
| |
| Vector2 | rotate (uint i) |
| | Rotate by 90 degrees counter-clockwise. More...
|
| |
| Vector2 | flip () |
| |
| Vector2 | rotate_flip (uint i) |
| | Rotate and flip, for \(0 \le i < 8 \). More...
|
| |
| Vector2 | rotate_flip_inv (uint i) |
| | The inverse of rotate_flip(i). More...
|
| |
| | ~Vector2 () |
| |
| template<class U > |
| Vector2< T > & | operator*= (const U rhs) |
| |
| template<class U > |
| Vector2< T > & | operator/= (const U rhs) |
| |
| | NumVector () |
| |
| | NumVector (const NVector< T, N > &rhs) |
| |
| | NumVector (const T rhs[N]) |
| |
| T | dot (const NumVector &other) const |
| | Inner product. More...
|
| |
| T | sq () const |
| |
| T | mag () const |
| | The square of the vector, \(\vec r^2 \). More...
|
| |
| T | distance (const NumVector &rhs) const |
| | The magnitude of the vector, \( \left| \vec r \right| \). More...
|
| |
| NumVector | perpto (const NumVector &other) const |
| |
| void | normalize () |
| | Normalize in place. More...
|
| |
| NumVector | norm () const |
| | Return the normalized version. More...
|
| |
| | ~NumVector () |
| |
| | NVector () |
| |
| | NVector (const NVector &rhs) |
| |
| template<class U > |
| | NVector (const NVector< U, N > &rhs) |
| |
| | NVector (const T locs[N]) |
| |
| const T & | get (const unsigned int n) const |
| |
| void | set (const unsigned int n, const T a) |
| |
| unsigned int | len () const |
| |
| NVector & | operator+= (const NVector &rhs) |
| |
| NVector & | operator-= (const NVector &rhs) |
| |
| template<class U > |
| NVector & | operator*= (const U rhs) |
| |
| template<class U > |
| NVector & | operator/= (const U rhs) |
| |
| NVector | operator- () const |
| |
| NVector | operator+ (const NVector &rhs) const |
| |
| NVector | operator- (const NVector &rhs) const |
| |
| T & | operator[] (const unsigned int i) |
| |
| const T & | operator[] (const unsigned int i) const |
| |
| template<class U > |
| NVector | operator* (const U rhs) const |
| | Multiplication by a scalar. More...
|
| |
| template<class U > |
| NVector | operator/ (const U rhs) const |
| | Division by a scalar. More...
|
| |
| T * | begin () |
| |
| T * | end () |
| |
| | ~NVector () |
| |
| template<class U > |
| NVector< T, N > & | operator*= (const U rhs) |
| |
| template<class U > |
| NVector< T, N > & | operator/= (const U rhs) |
| |
template<class T>
class Vector2< T >
A 2D physics vector, with methods for adding, subtracting, dot product, etc.
This is aliased as Vec when compiled with NDIM=2.
- Template Parameters
-
| T | a numerical type, as as float or double. |