"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.calculatePolygonCentroid=function(t){if(!t||t.length<3)return null;for(var e=0,u=0,n=0,l=t.length,i=0;i<l;i+=1){var r=t[i],d=t[(i+1)%l],o=r.longitude*d.latitude-d.longitude*r.latitude;e+=o,u+=(r.latitude+d.latitude)*o,n+=(r.longitude+d.longitude)*o}if(e*=.5,Math.abs(e)<1e-10)return{latitude:t.reduce((function(t,e){return t+e.latitude}),0)/l,longitude:t.reduce((function(t,e){return t+e.longitude}),0)/l};var a=1/(6*e);return{latitude:u*=a,longitude:n*=a}};
//# sourceMappingURL=calculatePolygonCentroid.js.map
