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