define(["exports","./Cartesian3-e0307675","./Check-741c5f3c","./defaultValue-81eec7ed","./Math-e73894ab"],(function(e,t,n,i,a){"use strict";const r=new t.Cartesian3,o=new t.Cartesian3;function u(e,n,u,s,d){const c=e.x,l=e.y,f=e.z,h=n.x,m=n.y,y=n.z,p=c*c*h*h,C=l*l*m*m,g=f*f*y*y,x=p+C+g,_=Math.sqrt(1/x),S=t.Cartesian3.multiplyByScalar(e,_,r);if(xa.CesiumMath.EPSILON12);return i.defined(d)?(d.x=c*v,d.y=l*T,d.z=f*b,d):new t.Cartesian3(c*v,l*T,f*b)}function s(e,t,n){this.longitude=i.defaultValue(e,0),this.latitude=i.defaultValue(t,0),this.height=i.defaultValue(n,0)}s.fromRadians=function(e,t,n,a){return n=i.defaultValue(n,0),i.defined(a)?(a.longitude=e,a.latitude=t,a.height=n,a):new s(e,t,n)},s.fromDegrees=function(e,t,n,i){return e=a.CesiumMath.toRadians(e),t=a.CesiumMath.toRadians(t),s.fromRadians(e,t,n,i)};const d=new t.Cartesian3,c=new t.Cartesian3,l=new t.Cartesian3,f=new t.Cartesian3(1/6378137,1/6378137,1/6356752.314245179),h=new t.Cartesian3(1/40680631590769,1/40680631590769,1/40408299984661.445),m=a.CesiumMath.EPSILON1;function y(e,n,r,o){n=i.defaultValue(n,0),r=i.defaultValue(r,0),o=i.defaultValue(o,0),e._radii=new t.Cartesian3(n,r,o),e._radiiSquared=new t.Cartesian3(n*n,r*r,o*o),e._radiiToTheFourth=new t.Cartesian3(n*n*n*n,r*r*r*r,o*o*o*o),e._oneOverRadii=new t.Cartesian3(0===n?0:1/n,0===r?0:1/r,0===o?0:1/o),e._oneOverRadiiSquared=new t.Cartesian3(0===n?0:1/(n*n),0===r?0:1/(r*r),0===o?0:1/(o*o)),e._minimumRadius=Math.min(n,r,o),e._maximumRadius=Math.max(n,r,o),e._centerToleranceSquared=a.CesiumMath.EPSILON1,0!==e._radiiSquared.z&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function p(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,y(this,e,t,n)}s.fromCartesian=function(e,n,r){const o=i.defined(n)?n.oneOverRadii:f,y=i.defined(n)?n.oneOverRadiiSquared:h,p=u(e,o,y,i.defined(n)?n._centerToleranceSquared:m,c);if(!i.defined(p))return;let C=t.Cartesian3.multiplyComponents(p,y,d);C=t.Cartesian3.normalize(C,C);const g=t.Cartesian3.subtract(e,p,l),x=Math.atan2(C.y,C.x),_=Math.asin(C.z),S=a.CesiumMath.sign(t.Cartesian3.dot(g,e))*t.Cartesian3.magnitude(g);return i.defined(r)?(r.longitude=x,r.latitude=_,r.height=S,r):new s(x,_,S)},s.toCartesian=function(e,n,i){return t.Cartesian3.fromRadians(e.longitude,e.latitude,e.height,n,i)},s.clone=function(e,t){if(i.defined(e))return i.defined(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new s(e.longitude,e.latitude,e.height)},s.equals=function(e,t){return e===t||i.defined(e)&&i.defined(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},s.equalsEpsilon=function(e,t,n){return n=i.defaultValue(n,0),e===t||i.defined(e)&&i.defined(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n},s.ZERO=Object.freeze(new s(0,0,0)),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`},Object.defineProperties(p.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}}),p.clone=function(e,n){if(!i.defined(e))return;const a=e._radii;return i.defined(n)?(t.Cartesian3.clone(a,n._radii),t.Cartesian3.clone(e._radiiSquared,n._radiiSquared),t.Cartesian3.clone(e._radiiToTheFourth,n._radiiToTheFourth),t.Cartesian3.clone(e._oneOverRadii,n._oneOverRadii),t.Cartesian3.clone(e._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=e._minimumRadius,n._maximumRadius=e._maximumRadius,n._centerToleranceSquared=e._centerToleranceSquared,n):new p(a.x,a.y,a.z)},p.fromCartesian3=function(e,t){return i.defined(t)||(t=new p),i.defined(e)?(y(t,e.x,e.y,e.z),t):t},p.WGS84=Object.freeze(new p(6378137,6378137,6356752.314245179)),p.UNIT_SPHERE=Object.freeze(new p(1,1,1)),p.MOON=Object.freeze(new p(a.CesiumMath.LUNAR_RADIUS,a.CesiumMath.LUNAR_RADIUS,a.CesiumMath.LUNAR_RADIUS)),p.prototype.clone=function(e){return p.clone(this,e)},p.packedLength=t.Cartesian3.packedLength,p.pack=function(e,n,a){return a=i.defaultValue(a,0),t.Cartesian3.pack(e._radii,n,a),n},p.unpack=function(e,n,a){n=i.defaultValue(n,0);const r=t.Cartesian3.unpack(e,n);return p.fromCartesian3(r,a)},p.prototype.geocentricSurfaceNormal=t.Cartesian3.normalize,p.prototype.geodeticSurfaceNormalCartographic=function(e,n){const a=e.longitude,r=e.latitude,o=Math.cos(r),u=o*Math.cos(a),s=o*Math.sin(a),d=Math.sin(r);return i.defined(n)||(n=new t.Cartesian3),n.x=u,n.y=s,n.z=d,t.Cartesian3.normalize(n,n)},p.prototype.geodeticSurfaceNormal=function(e,n){if(!t.Cartesian3.equalsEpsilon(e,t.Cartesian3.ZERO,a.CesiumMath.EPSILON14))return i.defined(n)||(n=new t.Cartesian3),n=t.Cartesian3.multiplyComponents(e,this._oneOverRadiiSquared,n),t.Cartesian3.normalize(n,n)};const C=new t.Cartesian3,g=new t.Cartesian3;p.prototype.cartographicToCartesian=function(e,n){const a=C,r=g;this.geodeticSurfaceNormalCartographic(e,a),t.Cartesian3.multiplyComponents(this._radiiSquared,a,r);const o=Math.sqrt(t.Cartesian3.dot(a,r));return t.Cartesian3.divideByScalar(r,o,r),t.Cartesian3.multiplyByScalar(a,e.height,a),i.defined(n)||(n=new t.Cartesian3),t.Cartesian3.add(r,a,n)},p.prototype.cartographicArrayToCartesianArray=function(e,t){const n=e.length;i.defined(t)?t.length=n:t=new Array(n);for(let i=0;i=this._radii.z-n))return a};const q=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],w=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function M(e,t,n){const i=.5*(t+e),a=.5*(t-e);let r=0;for(let e=0;e<5;e++){const t=a*q[e];r+=w[e]*(n(i+t)+n(i-t))}return r*=a,r}function R(e,t){this.x=i.defaultValue(e,0),this.y=i.defaultValue(t,0)}p.prototype.surfaceArea=function(e){const t=e.west;let n=e.east;const i=e.south,r=e.north;for(;n