summaryrefslogtreecommitdiffstats
path: root/Polygon.h
diff options
context:
space:
mode:
Diffstat (limited to 'Polygon.h')
-rw-r--r--Polygon.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/Polygon.h b/Polygon.h
new file mode 100644
index 0000000..2a79a94
--- /dev/null
+++ b/Polygon.h
@@ -0,0 +1,19 @@
+#ifndef POLYGON_H_
+#define POLYGON_H_
+
+#include "Vertex.h"
+#include "Line.h"
+#include <vector>
+
+class Polygon : public std::vector<Vertex> {
+ private:
+ int quadrant(const Vertex &v) const;
+ public:
+ double area() const;
+ double perimeter() const;
+
+ bool contains(const Vertex &v) const;
+ bool intersects(const LINE *l) const;
+};
+
+#endif /*POLYGON_H_*/