Cleaned up geometry libraries
This commit is contained in:
parent
3b88ee3957
commit
ee5f54689c
|
@ -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 {
|
||||
|
|
|
@ -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; }
|
||||
|
|
Loading…
Reference in a new issue