Skip to content

five-on-it / packages/shared/src/area / pointInPolygon

Function: pointInPolygon() ​

pointInPolygon(x, z, polygon): boolean

Defined in: packages/shared/src/area.ts:33

Whether a point lies inside a polygon (the even-odd rule: a ray from it crosses the outline an odd number of times). A point on an edge may count either way.

Parameters ​

x ​

number

z ​

number

polygon ​

readonly AreaPoint[]

Returns ​

boolean