Cleaned up geometry libraries

This commit is contained in:
Anthony Wang 2020-08-12 09:29:40 -05:00
parent 3b88ee3957
commit ee5f54689c
2 changed files with 6 additions and 6 deletions

View file

@ -27,7 +27,7 @@ double angle(point a, point o, point b) {
return acos(dot(oa, ob) / sqrt(norm_sq(oa) * norm_sq(ob)));
}
// (q.x - p.x) * (r.y - p.y) - (r.x - p.x) * (q.y - p.y)
// bool ccw(pl p, pl q, pl r) { return (q.f - p.f) * (r.s - p.s) - (r.f - p.f) * (q.s - p.s) > 0; }
bool ccw(point p, point q, point r) { return cross(vec(p, q), vec(p, r)) > 0; }
struct line {

View file

@ -1,5 +1,5 @@
struct point {
ll x, y; // long long to avoid overflow problems
ll x, y;
point() { x = y = 0; }
point(ll _x, ll _y) : x(_x), y(_y) {}
bool operator < (point p) const { return (x == p.x && y < p.y) || x < p.x; }