Companion

object Companion

Functions

Link copied to clipboard
fun isPointInPolygon(pointX: Float, pointY: Float, polygon: List<Point2>): Boolean

Check if a point is inside a polygon using ray casting algorithm. Casts a ray from the point to the right and counts edge intersections. If odd number of intersections, point is inside; if even, point is outside.