19 lines
373 B
C++
19 lines
373 B
C++
#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_*/
|