Vector2.hh
Go to the documentation of this file.
544 &operator<<(std::ostream &_out, const Vector2<T> &_pt)
void Max(const Vector2< T > &_v)
Set this vector's components to the maximum of itself and the passed in vector.
Definition: Vector2.hh:199
friend Vector2< T > operator-(const T _s, const Vector2< T > &_v)
Subtraction operators.
Definition: Vector2.hh:338
const Vector2 & operator*=(const Vector2 &_v)
Multiplication assignment operator.
Definition: Vector2.hh:407
const Vector2< T > & operator-=(T _s)
Subtraction assignment operator.
Definition: Vector2.hh:347
T setf(T... args)
const Vector2 & operator=(T _v)
Assignment operator.
Definition: Vector2.hh:242
T & operator[](const std::size_t _index)
Array subscript operator.
Definition: Vector2.hh:484
void Set(T _x, T _y)
Set the contents of the vector.
Definition: Vector2.hh:149
const Vector2 & operator-=(const Vector2 &_v)
Subtraction assignment operator.
Definition: Vector2.hh:317
bool IsFinite() const
See if a point is finite (e.g., not nan)
Definition: Vector2.hh:473
const Vector2 operator*(const Vector2 &_v) const
Multiplication operators.
Definition: Vector2.hh:398
Vector2 Round()
Round to near whole number, return the result.
Definition: Vector2.hh:130
double Distance(const Vector2 &_pt) const
Calc distance to the given point.
Definition: Vector2.hh:85
void Normalize()
Normalize the vector length.
Definition: Vector2.hh:108
const Vector2 & operator+=(const Vector2 &_v)
Addition assignment operator.
Definition: Vector2.hh:261
friend Vector2< T > operator+(const T _s, const Vector2< T > &_v)
Addition operators.
Definition: Vector2.hh:282
T fail(T... args)
Vector2 operator-(const Vector2 &_v) const
Subtraction operator.
Definition: Vector2.hh:309
friend std::istream & operator>>(std::istream &_in, Vector2< T > &_pt)
Stream extraction operator.
Definition: Vector2.hh:564
static const size_t IGN_ONE_SIZE_T
size_t type with a value of 1
Definition: Helpers.hh:230
STL class.
T Dot(const Vector2< T > &_v) const
Get the dot product of this vector and _v.
Definition: Vector2.hh:158
const Vector2 & operator/=(T _v)
Division operator.
Definition: Vector2.hh:387
T min(T... args)
static const Vector2< T > One
math::Vector2(1, 1)
Definition: Vector2.hh:43
T AbsDot(const Vector2< T > &_v) const
Return the absolute dot product of this vector and another vector. This is similar to the Dot functio...
Definition: Vector2.hh:179
Vector2 Normalized() const
Returns a normalized vector.
Definition: Vector2.hh:121
static const Vector2< T > Zero
math::Vector2(0, 0)
Definition: Vector2.hh:40
T operator[](const std::size_t _index) const
Const-qualified array subscript operator.
Definition: Vector2.hh:492
Vector2 Abs() const
Get the absolute value of the vector.
Definition: Vector2.hh:165
static const size_t IGN_ZERO_SIZE_T
size_t type with a value of 0
Definition: Helpers.hh:227
T isfinite(T... args)
bool Equal(const Vector2 &_v, const T &_tol) const
Equality test with tolerance.
Definition: Vector2.hh:449
T max(T... args)
Vector2(const T &_x, const T &_y)
Constructor.
Definition: Vector2.hh:58
T Max() const
Get the maximum value in the vector.
Definition: Vector2.hh:216
void Min(const Vector2< T > &_v)
Set this vector's components to the minimum of itself and the passed in vector.
Definition: Vector2.hh:208
bool operator==(const Vector2 &_v) const
Equal to operator.
Definition: Vector2.hh:459
Vector2 Rounded() const
Get a rounded version of this vector.
Definition: Vector2.hh:139
const Vector2 operator/(const Vector2 &_v) const
Division operator.
Definition: Vector2.hh:359
Vector2< T > operator-(const T _s) const
Subtraction operators.
Definition: Vector2.hh:328
const Vector2 operator/(T _v) const
Division operator.
Definition: Vector2.hh:379
bool operator!=(const Vector2 &_v) const
Not equal to operator.
Definition: Vector2.hh:466
Vector2 operator-() const
Negation operator.
Definition: Vector2.hh:301
T Length() const
Returns the length (magnitude) of the vector.
Definition: Vector2.hh:93
const Vector2< T > & operator+=(const T _s)
Addition assignment operator.
Definition: Vector2.hh:291
Vector2< T > operator+(const T _s) const
Addition operators.
Definition: Vector2.hh:272
const Vector2 & operator/=(const Vector2 &_v)
Division operator.
Definition: Vector2.hh:368
const Vector2 operator*(T _v) const
Multiplication operators.
Definition: Vector2.hh:418
Definition: Angle.hh:42
const Vector2 & operator*=(T _v)
Multiplication assignment operator.
Definition: Vector2.hh:436
Vector2 operator+(const Vector2 &_v) const
Addition operator.
Definition: Vector2.hh:253
Vector2(const Vector2< T > &_v)
Copy constructor.
Definition: Vector2.hh:66
STL class.
T nearbyint(T... args)
static const Vector2 NaN
math::Vector2(NaN, NaN, NaN)
Definition: Vector2.hh:46
T clamp(T _v, T _min, T _max)
Simple clamping function.
Definition: Helpers.hh:406
T SquaredLength() const
Returns the square of the length (magnitude) of the vector.
Definition: Vector2.hh:100
Vector2 & operator=(const Vector2 &_v)
Assignment operator.
Definition: Vector2.hh:231
T Min() const
Get the minimum value in the vector.
Definition: Vector2.hh:223
friend const Vector2 operator*(const T _s, const Vector2 &_v)
Scalar left multiplication operators.
Definition: Vector2.hh:427