# .css-1ydg16i{color:#000;-webkit-text-decoration:none;text-decoration:none;}UNPKG

 1 ```// Last module patch version validated against: 3.0.1 ``` 2 ``` ``` 3 ```/** ``` 4 ``` * Returns the signed area of the specified polygon. If the vertices of the polygon are in counterclockwise order ``` 5 ``` * (assuming a coordinate system where the origin <0,0> is in the top-left corner), the returned area is positive; ``` 6 ``` * otherwise it is negative, or zero. ``` 7 ``` * ``` 8 ``` * @param polygon Array of coordinates , and so on. ``` 9 ``` */ ``` 10 ```export function polygonArea(polygon: Array<[number, number]>): number; ``` 11 ``` ``` 12 ```/** ``` 13 ``` * Returns the centroid of the specified polygon. ``` 14 ``` * ``` 15 ``` * @param polygon Array of coordinates , and so on. ``` 16 ``` */ ``` 17 ```export function polygonCentroid(polygon: Array<[number, number]>): [number, number]; ``` 18 ``` ``` 19 ```/** ``` 20 ``` * Returns the convex hull of the specified points using Andrew’s monotone chain algorithm. ``` 21 ``` * The returned hull is represented as an array containing a subset of the input points arranged in ``` 22 ``` * counterclockwise order. Returns null if points has fewer than three elements. ``` 23 ``` * ``` 24 ``` * @param points Array of coordinates , and so on. ``` 25 ``` */ ``` 26 ```export function polygonHull(points: Array<[number, number]>): Array<[number, number]> | null; ``` 27 ``` ``` 28 ```/** ``` 29 ``` * Returns true if and only if the specified point is inside the specified polygon. ``` 30 ``` * ``` 31 ``` * @param polygon Array of coordinates , and so on. ``` 32 ``` * @param point Coordinates of point . ``` 33 ``` */ ``` 34 ```export function polygonContains(polygon: Array<[number, number]>, point: [number, number]): boolean; ``` 35 ``` ``` 36 ```/** ``` 37 ``` * Returns the length of the perimeter of the specified polygon. ``` 38 ``` * ``` 39 ``` * @param polygon Array of coordinates , and so on. ``` 40 ``` */ ``` 41 ```export function polygonLength(polygon: Array<[number, number]>): number; ```