aboutsummaryrefslogtreecommitdiffstats
path: root/tests/libsample/point.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/libsample/point.h')
-rw-r--r--tests/libsample/point.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/tests/libsample/point.h b/tests/libsample/point.h
new file mode 100644
index 000000000..e5ec9c1bc
--- /dev/null
+++ b/tests/libsample/point.h
@@ -0,0 +1,51 @@
+#ifndef POINT_H
+#define POINT_H
+
+#include "complex.h"
+#include <utility>
+
+class Point
+{
+public:
+ Point(int x = 0, int y = 0);
+ Point(double x, double y);
+ ~Point() {}
+
+ double x() const { return m_x; }
+ double y() const { return m_y; }
+
+ bool operator==(const Point& other);
+ Point operator+(const Point& other);
+ Point operator-(const Point& other);
+
+ friend Point operator*(Point& pt, double mult);
+ friend Point operator*(Point& pt, int mult);
+ friend Point operator*(double mult, Point& pt);
+ friend Point operator*(int mult, Point& pt);
+ friend Point operator-(const Point& pt);
+ friend bool operator!(const Point& pt);
+
+ Point& operator+=(Point &other);
+ Point& operator-=(Point &other);
+
+ void show();
+
+private:
+ double m_x;
+ double m_y;
+};
+
+Point operator*(Point& pt, double mult);
+Point operator*(Point& pt, int mult);
+Point operator*(double mult, Point& pt);
+Point operator*(int mult, Point& pt);
+Point operator-(const Point& pt);
+bool operator!(const Point& pt);
+
+Complex transmutePointIntoComplex(Point point);
+Point transmuteComplexIntoPoint(Complex cpx);
+
+Point operator*(Point& pt, double multiplier);
+
+#endif // POINT_H
+