diff options
| author | mzuenni <michi.zuendorf@gmail.com> | 2023-02-03 19:39:14 +0100 |
|---|---|---|
| committer | mzuenni <michi.zuendorf@gmail.com> | 2023-02-03 19:39:14 +0100 |
| commit | 8ca4bbf3e4e7be7eb00dc83ed83969c992367a41 (patch) | |
| tree | 626e558da21a19b3e7ff208ef6db8aabe0e8b253 /geometry | |
| parent | 3c757b9b02580021b21ee13f771e309bfb2b68f6 (diff) | |
simplified code
Diffstat (limited to 'geometry')
| -rw-r--r-- | geometry/polygon.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/geometry/polygon.cpp b/geometry/polygon.cpp index 3a633af..6465fdb 100644 --- a/geometry/polygon.cpp +++ b/geometry/polygon.cpp @@ -40,13 +40,13 @@ bool inside(pt p, const vector<pt>& poly) { // Change line 43 and 49 >= if border counts as inside bool inside(pt p, const vector<pt>& hull) { int l = 0, r = sz(hull) - 1; - if (orientation(hull[0], hull[r], p) > 0) return false; + if (cross(hull[0], hull[r], p) > 0) return false; while (l + 1 < r) { int m = (l + r) / 2; - if (orientation(hull[0], hull[m], p) >= 0) l = m; + if (cross(hull[0], hull[m], p) >= 0) l = m; else r = m; } - return orientation(hull[l], hull[r], p) > 0; + return cross(hull[l], hull[r], p) > 0; } void rotateMin(vector<pt>& hull) { |
