@quentinroy/polygon-centroid
v1.0.1
Published
Chunk an array into successive pairs.
Downloads
7
Readme
@quentinroy/polygon-centroid
Calculate the centroid of any non-self-intersecting closed polygon.
Install
npm install @quentinroy/polygon-centroid
Example
const polygonCentroid = require("@quentinroy/polygon-centroid");
const centroid = polygonCentroid([
{ x: 0, y: 0 },
{ x: 0, y: 1 },
{ x: 1, y: 1 },
]);