IntersectionUtils

Utility functions for geometric intersection and point-in-polygon tests

Functions

Link copied to clipboard
fun hasIntersection(pointsA: List<Point>, pointsB: List<Point>): Boolean

Tests whether two convex polygons overlap using the Separating Axis Theorem (SAT).

Link copied to clipboard
fun isPointCloseToPoly(poly: List<Point>, x: Double, y: Double, radius: Double): Boolean

Tests whether the point (x, y) is within radius pixels of the polygon poly.

Link copied to clipboard

Tests whether the point (x, y) is inside the polygon poly using the ray-casting algorithm.