summaryrefslogtreecommitdiff
path: root/point.h
diff options
context:
space:
mode:
authorAndrew Guschin <guschin.drew@gmail.com>2022-04-02 09:13:33 +0400
committerAndrew Guschin <guschin.drew@gmail.com>2022-04-02 09:13:33 +0400
commit806a1e093eeac8b426b20717c14260c9cb896798 (patch)
tree7b6e1a01958269ce78b9716461a9fa4c05d3dc5e /point.h
parent15ccb946f43283bfc91d80ddf012d9ae2a0333ed (diff)
Removed CUDA files and changed build system to premakeremake
Diffstat (limited to 'point.h')
-rw-r--r--point.h87
1 files changed, 0 insertions, 87 deletions
diff --git a/point.h b/point.h
deleted file mode 100644
index 36cfda9..0000000
--- a/point.h
+++ /dev/null
@@ -1,87 +0,0 @@
-//
-// Created by saintruler on 11.04.19.
-//
-
-#ifndef OPENGLTEST_POINT_H
-#define OPENGLTEST_POINT_H
-
-#include <cmath>
-
-class point
-{
-public:
- point(double x, double y)
- {
- this->x = x;
- this->y = y;
- }
-
- friend point operator+(const point& left, const point& right)
- {
- return point(left.x + right.x, left.y + right.y);
- }
-
- friend point operator+=(point& left, const point& right)
- {
- left.x += right.x;
- left.y += right.y;
- return left;
- }
-
- friend point operator-(const point& left, const point& right)
- {
- return point(left.x - right.x, left.y - right.y);
- }
-
- friend point operator-=(point& left, const double right)
- {
- left.x -= right;
- left.y -= right;
- return left;
- }
-
- friend point operator/(const point& left, const double right)
- {
- return point(left.x / right, left.y / right);
- }
-
- friend point operator/=(point& left, const double right)
- {
- left.x /= right;
- left.y /= right;
- return left;
- }
-
- friend point operator*(const point& left, const double right)
- {
- return point(left.x * right, left.y * right);
- }
-
- friend point operator*=(point& left, const double right)
- {
- left.x *= right;
- left.y *= right;
- return left;
- }
-
- double length()
- {
- return sqrt(pow(x, 2) + pow(y, 2));
- }
-
- double length_sqared()
- {
- return pow(x, 2) + pow(y, 2);
- }
-
- void normalize()
- {
- const double l = length();
- this->x /= l;
- this->y /= l;
- }
-
- double x, y;
-};
-
-#endif //OPENGLTEST_POINT_H