MyGAL
|
Class representing a 2D vector. More...
#include <Vector2.h>
Public Member Functions | |
Vector2 (T x=0.0, T y=0.0) | |
Default constructor. More... | |
Vector2< T > | operator- () const |
Compute the opposite vector. More... | |
Vector2< T > & | operator+= (const Vector2< T > &other) |
Add a vector. More... | |
Vector2< T > & | operator-= (const Vector2< T > &other) |
Substract a vector. More... | |
Vector2< T > & | operator*= (T t) |
Multiply by a scalar. More... | |
Vector2< T > | getOrthogonal () const |
Get the orthogonal vector. More... | |
T | getNorm () const |
Compute the euclidean norm of the vector. More... | |
T | getDistance (const Vector2< T > &other) const |
Compute the euclidean distance of this point to another point. More... | |
T | getDet (const Vector2< T > &other) const |
Compute the determinant with another vector. More... | |
Public Attributes | |
T | x |
T | y |
Related Functions | |
(Note that these are not member functions.) | |
template<typename T > | |
Vector2< T > | operator+ (Vector2< T > lhs, const Vector2< T > &rhs) |
Compute the sum of two vectors. More... | |
template<typename T > | |
Vector2< T > | operator- (Vector2< T > lhs, const Vector2< T > &rhs) |
Compute the difference of two vectors. More... | |
template<typename T > | |
Vector2< T > | operator* (T t, Vector2< T > vec) |
Compute the product of a scalar by a vector. More... | |
template<typename T > | |
Vector2< T > | operator* (Vector2< T > vec, T t) |
Compute the product of a vector by a scalar. More... | |
template<typename T > | |
std::ostream & | operator<< (std::ostream &os, const Vector2< T > &vec) |
Insert a vector in a stream. More... | |
Class representing a 2D vector.
This class can be used to represent a 2D point too.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
related |
T mygal::Vector2< T >::x |
T mygal::Vector2< T >::y |