36 template<
typename Other>
45 template <
typename Other>
47 x =
static_cast<T
>(other.x);
48 y =
static_cast<T
>(other.y);
59 return x == other.x &&
68 return !(*
this == other);
77 return x > other.x &&
y > other.y;
86 return x >= other.x &&
y >= other.y;
95 return x < other.x &&
y < other.y;
104 return x <= other.x &&
y <= other.y;
Vector2 & operator*=(const Vector2 &rhs) noexcept
Multiplies (per-element) two vectors.
Definition: Vector2.h:192
Vector2 operator*(const Vector2 &rhs) const noexcept
Multiplies (per-element) two vectors.
Definition: Vector2.h:158
T & operator[](int n) noexcept
Indexes the vector.
Definition: Vector2.h:111
Vector2< int > Point2i
Definition: Vector2.h:290
Vector2< T > & operator=(const Vector2< Other > &other) noexcept
Copies another vector.
Definition: Vector2.h:46
bool operator<=(const Vector2 &other) const noexcept
Checks if both coordinates are smaller or equal to respective coordinates of another vector...
Definition: Vector2.h:103
Vector2 operator+(const Vector2 &rhs) const noexcept
Adds (per-element) two vectors.
Definition: Vector2.h:142
Vector2() noexcept
Initializes a vector with zeroes.
Definition: Vector2.h:17
T x
x coordinate.
Definition: Vector2.h:12
Vector2(T x_) noexcept
Initializes all elements with the same value.
Definition: Vector2.h:23
Vector2< unsigned int > Point2u
Definition: Vector2.h:293
bool operator==(const Vector2 &other) const noexcept
Checks if two vectors are equal.
Definition: Vector2.h:58
bool operator>(const Vector2 &other) const noexcept
Checks if both coordinates are greater then respective coordinates of another vector.
Definition: Vector2.h:76
Vector2 operator/(const Vector2 &rhs) const noexcept
Divides (per-element) two vectors.
Definition: Vector2.h:166
bool operator<(const Vector2 &other) const noexcept
Checks if both coordinates are smaller then respective coordinates of another vector.
Definition: Vector2.h:94
Vector2 & operator/=(const Vector2 &rhs) noexcept
Divides (per-element) two vectors.
Definition: Vector2.h:201
T y
y coordinate.
Definition: Vector2.h:13
Vector2< double > Point2d
Definition: Vector2.h:287
Vector2< float > Point2f
Definition: Vector2.h:284
bool operator!=(const Vector2 &other) const noexcept
Checks if two vectors are not equal.
Definition: Vector2.h:67
Vector2 & operator+=(const Vector2 &rhs) noexcept
Adds (per-element) two vectors.
Definition: Vector2.h:174
Vector2 operator-(void) const noexcept
Negates all elements.
Definition: Vector2.h:134
bool operator>=(const Vector2 &other) const noexcept
Checks if both coordinates are greater or equal to respective coordinates of another vector...
Definition: Vector2.h:85
Vector2 & operator-=(const Vector2 &rhs) noexcept
Subtracts (per-element) two vectors.
Definition: Vector2.h:183
Vector2< int > Size
Definition: Vector2.h:299
Vector2< unsigned short > Point2us
Definition: Vector2.h:296
Generic 2D vector.
Definition: Vector2.h:11
Vector2(T x_, T y_) noexcept
Initializes elements with given value.
Definition: Vector2.h:30