Skip to content

@technobuddha > library > Geometry > Polygon

Function: isClosed()

ts
function isClosed(polygon: Polygon): boolean;

Defined in: is-closed.ts:13

Determines whether a given polygon is closed.

A polygon is considered closed if it has more than one point and its first and last points have identical x and y coordinates.

Parameters

ParameterTypeDescription
polygonPolygonAn array of points representing the polygon, where each point has x and y properties.

Returns

boolean

true if the polygon is closed; otherwise, false.