Skip to content

@technobuddha > library > Geometry > Polygon

Function: isOnPolygon()

ts
function isOnPolygon(
   point: Cartesian, 
   polygon: Polygon, 
   tolerance: number): boolean;

Defined in: is-on-polygon.ts:18

Determines whether a given point lies exactly on the boundary of a polygon.

Parameters

ParameterTypeDefault valueDescription
pointCartesianundefinedThe Cartesian coordinates of the point to test.
polygonPolygonundefinedThe polygon, represented as an array of Cartesian points.
tolerancenumber1e-10Optional tolerance for floating-point comparisons (default is 1e-10).

Returns

boolean

true if the point lies on any edge of the polygon within the given tolerance, otherwise false.