/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{floatEqualRelative as t}from"../../../core/mathUtils.js";import{DerivedCircle as a,interpolateCircle as r}from"./circleUtils.js";import{angularRangeOriented as o,wrapAtan2 as s}from"./mathUtils.js";function h(r,h){const[n,c,i,e]=h.a,[m,M]=r,[f,l]=n,[p,u]=c,j=m-p,U=M-u,b=Math.sqrt(j*j+U*U),q=f-p,x=l-u,I=Math.sqrt(q*q+x*x),P=0===b||0===I||!t(b,I),d=b,[w,y]=o(s(M-u,m-p),Math.atan2(l-u,f-p),i,e);return new a(p,u,d,w,y,P)}function n(t,a,o){const{cx:s,cy:h,thetaStart:n,thetaEnd:c}=t,[i,e,m,M]=a.a,f=n*(1-o)+c*o;return[{a:[r(t,o),[s,h],Math.abs(f-n)<Math.PI?1:0,M]},{a:[[...i],[s,h],Math.abs(c-f)<Math.PI?1:0,M]}]}export{h as deriveCircleFromEllipticArc4,n as splitEllipticArc4};
