summaryrefslogtreecommitdiff
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
parentbfca807fde317bb2573ab7f54297f1f3c6eae8f1 (diff)
fix function name
-rw-r--r--content/geometry/polygon.cpp2
-rw-r--r--test/geometry/polygon.cpp6
2 files changed, 4 insertions, 4 deletions
diff --git a/content/geometry/polygon.cpp b/content/geometry/polygon.cpp
index 3178290..064d81f 100644
--- a/content/geometry/polygon.cpp
+++ b/content/geometry/polygon.cpp
@@ -29,7 +29,7 @@ bool inside(pt p, const vector<pt>& poly) {
bool in = false;
for (int i = 0; i + 1 < sz(poly); i++) {
pt a = poly[i], b = poly[i + 1];
- if (pointOnLineSegment(a, b, p)) return false;
+ if (pointOnSegment(a, b, p)) return false;
if (real(a) > real(b)) swap(a,b);
if (real(a) <= real(p) && real(p) < real(b) &&
cross(p, a, b) < 0) {
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);