/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../core/screenUtils"],(function(e,t){"use strict";function n(e,t){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)}function r(e,t){const n=t.x-e.x,r=t.y-e.y;return Math.sqrt(n*n+r*r)}function c(e,n){if(n?(n.radius=0,n.center.x=0,n.center.y=0):n={radius:0,center:t.createScreenPoint()},0===e.length)return n;if(1===e.length)return n.center.x=e[0].x,n.center.y=e[0].y,n;if(2===e.length){const[t,r]=e,[c,a]=[r.x-t.x,r.y-t.y];return n.radius=Math.sqrt(c*c+a*a)/2,n.center.x=(t.x+r.x)/2,n.center.y=(t.y+r.y)/2,n}let r=0,c=0;for(let t=0;t<e.length;t++)r+=e[t].x,c+=e[t].y;r/=e.length,c/=e.length;const a=e.map((e=>e.x-r)),i=e.map((e=>e.y-c));let s=0,l=0,o=0,u=0,x=0,y=0,h=0;for(let t=0;t<a.length;t++){const e=a[t],n=i[t],r=e*e,c=n*n;s+=r,l+=c,o+=e*n,u+=r*e,x+=c*n,y+=e*c,h+=n*r}const f=.5*(u+y),g=.5*(x+h),d=s*l-o*o,M=(f*l-g*o)/d,S=(s*g-o*f)/d,b=t.createScreenPoint(M+r,S+c);return{radius:Math.sqrt(M*M+S*S+(s+l)/e.length),center:b}}e.euclideanDistance=r,e.fitCircleLSQ=c,e.manhattanDistance=n,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
