isPointCloseToPoly

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.

Combines a point-in-polygon test with an edge-proximity test so that points near the polygon boundary also return true.

Return

true if the point is inside or within radius of the polygon.

Parameters

poly

Polygon vertices (projected 2D points).

x

X coordinate to test.

y

Y coordinate to test.

radius

Maximum distance from the polygon edge to still be considered "close".