diff options
| author | Yidi <noob999noob999@gmail.com> | 2024-09-25 20:18:42 +0200 |
|---|---|---|
| committer | Yidi <noob999noob999@gmail.com> | 2024-09-25 20:18:42 +0200 |
| commit | 35d485bcf6a9ed0a9542628ce4aa94a3326d0884 (patch) | |
| tree | 679675215d2cf5416664887eaf28c50b8a279549 /test | |
| parent | bfca807fde317bb2573ab7f54297f1f3c6eae8f1 (diff) | |
fix function name
Diffstat (limited to 'test')
| -rw-r--r-- | test/geometry/polygon.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/geometry/polygon.cpp b/test/geometry/polygon.cpp index 1dd46ca..643ea70 100644 --- a/test/geometry/polygon.cpp +++ b/test/geometry/polygon.cpp @@ -10,7 +10,7 @@ double abs(pt p) { return hypot(real(p), imag(p)); } // Liegt p auf der Strecke a-b? -bool pointOnLineSegment(pt a, pt b, pt p) { +bool pointOnSegment(pt a, pt b, pt p) { if (cross(a, b, p) != 0) return false; auto dist = norm(a - b); return norm(a - p) <= dist && norm(b - p) <= dist; @@ -65,7 +65,7 @@ void test_windingNumber(ll range) { int cur = details::lineSegmentIntersection(p, p + pt(1, 2'000'000'007), ps[j], ps[j+1]); if (ptLess(ps[j], ps[j+1])) expected -= cur; else expected += cur; - onBorder |= pointOnLineSegment(ps[j], ps[j+1], p); + onBorder |= pointOnSegment(ps[j], ps[j+1], p); } if (onBorder) continue; if (area(ps) < 0) expected = -expected; @@ -93,7 +93,7 @@ void test_inside(ll range) { bool onBorder = false; for (int j = 0; j < n; j++) { count += details::lineSegmentIntersection(p, p + pt(1, 2'000'000'007), ps[j], ps[j+1]); - onBorder |= pointOnLineSegment(ps[j], ps[j+1], p); + onBorder |= pointOnSegment(ps[j], ps[j+1], p); } bool expected = (count % 2) && !onBorder; bool got = inside(p, ps); |
