Calculate the centroid of any non-self-intersecting closed polygon.
npm install @quentinroy/polygon-centroid
const polygonCentroid = require("@quentinroy/polygon-centroid");
const centroid = polygonCentroid([
{ x: 0, y: 0 },
{ x: 0, y: 1 },
{ x: 1, y: 1 },
]);