This commit is contained in:
Ryan Di 2025-04-08 00:02:22 +10:00
parent 98000be0e0
commit c2321a3bd6
2 changed files with 3 additions and 6 deletions

View file

@ -2,7 +2,6 @@ import { simplify } from "points-on-curve";
import { import {
polygonFromPoints, polygonFromPoints,
polygonIncludesPoint,
lineSegment, lineSegment,
lineSegmentIntersectionPoints, lineSegmentIntersectionPoints,
polygonIncludesPointNonZero, polygonIncludesPointNonZero,

View file

@ -59,11 +59,9 @@ export const polygonIncludesPointNonZero = <Point extends [number, number]>(
windingNumber++; windingNumber++;
} }
} }
} else { } else if (yj <= y) {
if (yj <= y) { if ((xj - xi) * (y - yi) - (x - xi) * (yj - yi) < 0) {
if ((xj - xi) * (y - yi) - (x - xi) * (yj - yi) < 0) { windingNumber--;
windingNumber--;
}
} }
} }
} }