1
0
Fork 0

Update geometry/point.cc

Signed-off-by: subcrip <contact@subc.rip>
This commit is contained in:
subcrip 2024-11-24 08:16:24 +00:00
parent f107381e58
commit 562bf6c4b8
1 changed files with 4 additions and 4 deletions

View File

@ -14,10 +14,10 @@ template <typename T> struct point {
inline point operator*(const T& a) const { return point(x * a, y * a); } inline point operator*(const T& a) const { return point(x * a, y * a); }
inline T operator*(const point& rhs) const { return x * rhs.y - y * rhs.x; } inline T operator*(const point& rhs) const { return x * rhs.y - y * rhs.x; }
inline point operator/(const T& a) const { return point(x / a, y / a); } inline point operator/(const T& a) const { return point(x / a, y / a); }
inline point operator+=(const point& rhs) { x += rhs.x, y += rhs.y; return *this; } inline point& operator+=(const point& rhs) { x += rhs.x, y += rhs.y; return *this; }
inline point operator-=(const point& rhs) { x -= rhs.x, y -= rhs.y; return *this; } inline point& operator-=(const point& rhs) { x -= rhs.x, y -= rhs.y; return *this; }
inline point operator*=(const T& a) { x *= a, y *= a; return *this; } inline point& operator*=(const T& a) { x *= a, y *= a; return *this; }
inline point operator/=(const T& a) { x /= a, y /= a; return *this; } inline point& operator/=(const T& a) { x /= a, y /= a; return *this; }
inline bool operator==(const point& rhs) const { return x == rhs.x and y == rhs.y; } inline bool operator==(const point& rhs) const { return x == rhs.x and y == rhs.y; }
inline bool operator!=(const point& rhs) const { return not (*this == rhs); } inline bool operator!=(const point& rhs) const { return not (*this == rhs); }