define(["exports","./Cartesian4-b0ddc4ba","./Check-7b2a090c","./when-b60132fc","./buildModuleUrl-8cce5713","./Math-31e539c2"],(function(t,a,i,n,e,s){"use strict";function r(t,a,i,n,e,s,r){var h=function(t,a){return t*a*(4+t*(4-3*a))/16}(t,i);return(1-h)*t*a*(n+h*e*(r+h*s*(2*r*r-1)))}var h=new a.Cartesian3,o=new a.Cartesian3;function d(t,i,n,e){a.Cartesian3.normalize(e.cartographicToCartesian(i,o),h),a.Cartesian3.normalize(e.cartographicToCartesian(n,o),o),function(t,a,i,n,e,h,o){var d,c,u,M,l,g=(a-i)/a,_=h-n,p=Math.atan((1-g)*Math.tan(e)),f=Math.atan((1-g)*Math.tan(o)),v=Math.cos(p),m=Math.sin(p),H=Math.cos(f),C=Math.sin(f),O=v*H,b=v*C,S=m*C,q=m*H,U=_,w=s.Math3D.TWO_PI,A=Math.cos(U),R=Math.sin(U);do{A=Math.cos(U),R=Math.sin(U);var D,y=b-q*A;u=Math.sqrt(H*H*R*R+y*y),c=S+O*A,d=Math.atan2(u,c),0===u?(D=0,M=1):M=1-(D=O*R/u)*D,w=U,l=c-2*S/M,isNaN(l)&&(l=0),U=_+r(g,D,M,d,u,c,l)}while(Math.abs(U-w)>s.Math3D.EPSILON12);var E=M*(a*a-i*i)/(i*i),P=E*(256+E*(E*(74-47*E)-128))/1024,x=l*l,N=i*(1+E*(4096+E*(E*(320-175*E)-768))/16384)*(d-P*u*(l+P*(c*(2*x-1)-P*l*(4*u*u-3)*(4*x-3)/6)/4)),T=Math.atan2(H*R,b-q*A),z=Math.atan2(v*R,b*A-q);t._distance=N,t._startHeading=T,t._endHeading=z,t._uSquared=E}(t,e.maximumRadius,e.minimumRadius,i.longitude,i.latitude,n.longitude,n.latitude),t._start=a.Cartographic.clone(i,t._start),t._end=a.Cartographic.clone(n,t._end),t._start.height=0,t._end.height=0,function(t){var a=t._uSquared,i=t._ellipsoid.maximumRadius,n=t._ellipsoid.minimumRadius,e=(i-n)/i,s=Math.cos(t._startHeading),r=Math.sin(t._startHeading),h=(1-e)*Math.tan(t._start.latitude),o=1/Math.sqrt(1+h*h),d=o*h,c=Math.atan2(h,s),u=o*r,M=u*u,l=1-M,g=Math.sqrt(l),_=a/4,p=_*_,f=p*_,v=p*p,m=1+_-3*p/4+5*f/4-175*v/64,H=1-_+15*p/8-35*f/8,C=1-3*_+35*p/4,O=1-5*_,b=m*c-H*Math.sin(2*c)*_/2-C*Math.sin(4*c)*p/16-O*Math.sin(6*c)*f/48-5*Math.sin(8*c)*v/512,S=t._constants;S.a=i,S.b=n,S.f=e,S.cosineHeading=s,S.sineHeading=r,S.tanU=h,S.cosineU=o,S.sineU=d,S.sigma=c,S.sineAlpha=u,S.sineSquaredAlpha=M,S.cosineSquaredAlpha=l,S.cosineAlpha=g,S.u2Over4=_,S.u4Over16=p,S.u6Over64=f,S.u8Over256=v,S.a0=m,S.a1=H,S.a2=C,S.a3=O,S.distanceRatio=b}(t)}function c(t,i,s){var r=n.defaultValue(s,e.Ellipsoid.WGS84);this._ellipsoid=r,this._start=new a.Cartographic,this._end=new a.Cartographic,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,n.defined(t)&&n.defined(i)&&d(this,t,i,r)}Object.defineProperties(c.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}}),c.prototype.setEndPoints=function(t,a){d(this,t,a,this._ellipsoid)},c.prototype.interpolateUsingFraction=function(t,a){return this.interpolateUsingSurfaceDistance(this._distance*t,a)},c.prototype.interpolateUsingSurfaceDistance=function(t,i){var e=this._constants,s=e.distanceRatio+t/e.b,h=Math.cos(2*s),o=Math.cos(4*s),d=Math.cos(6*s),c=Math.sin(2*s),u=Math.sin(4*s),M=Math.sin(6*s),l=Math.sin(8*s),g=s*s,_=s*g,p=e.u8Over256,f=e.u2Over4,v=e.u6Over64,m=e.u4Over16,H=2*_*p*h/3+s*(1-f+7*m/4-15*v/4+579*p/64-(m-15*v/4+187*p/16)*h-(5*v/4-115*p/16)*o-29*p*d/16)+(f/2-m+71*v/32-85*p/16)*c+(5*m/16-5*v/4+383*p/96)*u-g*((v-11*p/2)*c+5*p*u/2)+(29*v/96-29*p/16)*M+539*p*l/1536,C=Math.asin(Math.sin(H)*e.cosineAlpha),O=Math.atan(e.a/e.b*Math.tan(C));H-=e.sigma;var b=Math.cos(2*e.sigma+H),S=Math.sin(H),q=Math.cos(H),U=e.cosineU*q,w=e.sineU*S,A=Math.atan2(S*e.sineHeading,U-w*e.cosineHeading)-r(e.f,e.sineAlpha,e.cosineSquaredAlpha,H,S,q,b);return n.defined(i)?(i.longitude=this._start.longitude+A,i.latitude=O,i.height=0,i):new a.Cartographic(this._start.longitude+A,O,0)},t.EllipsoidGeodesic=c}));
