7 template <
typename TType>
32 if (other.
x == 0 || other.
y == 0)
33 throw std::invalid_argument(
"Division by zero: denominator has a zero component");
40 return (
x == other.
x) && (
y == other.
y);
45 return !(*
this == other);
65 return std::hypot(
x,
y);
72 throw std::invalid_argument(
"Cannot normalized zero vector");
79 return (
x *
x +
y *
y);
84 return (
x * other.
x +
y * other.
y);
99 return (
x * other.
y -
y * other.
x);
IVector2(TType x, TType y)
IVector2 & operator+=(const IVector2 &other)
IVector2 & operator-=(const IVector2 &other)
float cross(const IVector2 &other) const
float dot(const IVector2 &other)
IVector2 operator*(const IVector2 &other) const
IVector2 operator/(const IVector2 &other) const
IVector2 operator-(const IVector2 &other) const
IVector2< TType > normalize()
bool operator!=(const IVector2 &other) const
IVector2 operator+(const IVector2 &other) const
bool operator==(const IVector2 &other) const