summaryrefslogtreecommitdiffstats
path: root/Polygon.h
blob: 093a160cde39a033575934544bd638d86d82249c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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_*/