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

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