28 inline Vector2<T>::Vector2() :
38 inline Vector2<T>::Vector2(T X, T Y) :
49 inline Vector2<T>::Vector2(
const Vector2<U>& vector) :
50 x(static_cast<T>(vector.x)),
51 y(static_cast<T>(vector.y))
58 inline Vector2<T>
operator -(
const Vector2<T>& right)
60 return Vector2<T>(-right.x, -right.y);
66 inline Vector2<T>&
operator +=(Vector2<T>& left,
const Vector2<T>& right)
77 inline Vector2<T>&
operator -=(Vector2<T>& left,
const Vector2<T>& right)
88 inline Vector2<T>
operator +(
const Vector2<T>& left,
const Vector2<T>& right)
90 return Vector2<T>(left.x + right.x, left.y + right.y);
96 inline Vector2<T>
operator -(
const Vector2<T>& left,
const Vector2<T>& right)
98 return Vector2<T>(left.x - right.x, left.y - right.y);
103 template <
typename T>
104 inline Vector2<T>
operator *(
const Vector2<T>& left, T right)
106 return Vector2<T>(left.x * right, left.y * right);
111 template <
typename T>
112 inline Vector2<T>
operator *(T left,
const Vector2<T>& right)
114 return Vector2<T>(right.x * left, right.y * left);
119 template <
typename T>
120 inline Vector2<T>&
operator *=(Vector2<T>& left, T right)
130 template <
typename T>
131 inline Vector2<T>
operator /(
const Vector2<T>& left, T right)
133 return Vector2<T>(left.x / right, left.y / right);
138 template <
typename T>
139 inline Vector2<T>&
operator /=(Vector2<T>& left, T right)
149 template <
typename T>
150 inline bool operator ==(
const Vector2<T>& left,
const Vector2<T>& right)
152 return (left.x == right.x) && (left.y == right.y);
157 template <
typename T>
158 inline bool operator !=(
const Vector2<T>& left,
const Vector2<T>& right)
160 return (left.x != right.x) || (left.y != right.y);