1 #ifndef GEOM_CONVEX_COVER_H
2 #define GEOM_CONVEX_COVER_H
62 std::vector<Point> boundary;
66 bool contains_point(
Point p);
68 inline Point operator[](
int i)
const {
69 int l = boundary.size();
70 if(l == 0)
return Point();
71 return boundary[i >= 0 ? i % l : (i % l) + l];
82 ConvexHull(std::vector<Point>
const & points) {
94 bool no_colinear_points()
const;
95 bool top_point_first()
const;
96 bool meets_invariants()
const;
99 bool empty()
const {
return boundary.empty();}
102 bool singular()
const {
return boundary.size() == 1;}
105 bool linear()
const {
return boundary.size() == 2;}
106 bool is_degenerate()
const;
112 Point const * furthest(
Point direction)
const;
114 bool is_left(
Point p,
int n);
115 int find_left(
Point p);
133 unsigned find_bottom_right(
ConvexHull const &a);
142 pr.boundary.reserve(p.boundary.size());
144 for(
unsigned i = 0; i < p.boundary.size(); i++) {
145 pr.boundary.push_back(p.boundary[i]*m);
161 #endif //2GEOM_CONVEX_COVER_H
Definition: convex-cover.h:54
ConvexHull graham_merge(ConvexHull a, ConvexHull b)
Definition: convex-cover.cpp:408
Cartesian point.
Definition: point.h:20
bool is_clockwise() const
Definition: convex-cover.cpp:225