summaryrefslogtreecommitdiff
path: root/test/geometry/polygon.cpp
diff options
context:
space:
mode:
authorYidi <noob999noob999@gmail.com>2024-09-25 20:18:42 +0200
committerYidi <noob999noob999@gmail.com>2024-09-25 20:18:42 +0200
commit35d485bcf6a9ed0a9542628ce4aa94a3326d0884 (patch)
tree679675215d2cf5416664887eaf28c50b8a279549 /test/geometry/polygon.cpp
parentbfca807fde317bb2573ab7f54297f1f3c6eae8f1 (diff)
fix function name
Diffstat (limited to 'test/geometry/polygon.cpp')
-rw-r--r--test/geometry/polygon.cpp6
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);