define(["exports","./defaultValue-865ac579","./Math-76ce6367"],(function(e,t,n){"use strict";function i(e,n,i){this.x=t.defaultValue(e,0),this.y=t.defaultValue(n,0),this.z=t.defaultValue(i,0)}i.fromSpherical=function(e,n){t.defined(n)||(n=new i);const r=e.clock,a=e.cone,o=t.defaultValue(e.magnitude,1),u=o*Math.sin(a);return n.x=u*Math.cos(r),n.y=u*Math.sin(r),n.z=o*Math.cos(a),n},i.fromElements=function(e,n,r,a){return t.defined(a)?(a.x=e,a.y=n,a.z=r,a):new i(e,n,r)},i.clone=function(e,n){if(t.defined(e))return t.defined(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n):new i(e.x,e.y,e.z)},i.fromCartesian4=i.clone,i.packedLength=3,i.pack=function(e,n,i){return i=t.defaultValue(i,0),n[i++]=e.x,n[i++]=e.y,n[i]=e.z,n},i.unpack=function(e,n,r){return n=t.defaultValue(n,0),t.defined(r)||(r=new i),r.x=e[n++],r.y=e[n++],r.z=e[n],r},i.packArray=function(e,n){const r=e.length,a=3*r;t.defined(n)?(Array.isArray(n)||n.length===a)&&n.length!==a&&(n.length=a):n=new Array(a);for(let t=0;tn.CesiumMath.EPSILON12);return t.defined(u)?(u.x=s*b,u.y=c*T,u.z=d*E,u):new i(s*b,c*T,d*E)}function g(e,n,i){this.longitude=t.defaultValue(e,0),this.latitude=t.defaultValue(n,0),this.height=t.defaultValue(i,0)}g.fromRadians=function(e,n,i,r){return i=t.defaultValue(i,0),t.defined(r)?(r.longitude=e,r.latitude=n,r.height=i,r):new g(e,n,i)},g.fromDegrees=function(e,t,i,r){return e=n.CesiumMath.toRadians(e),t=n.CesiumMath.toRadians(t),g.fromRadians(e,t,i,r)};const x=new i,z=new i,M=new i,w=new i(1/6378137,1/6378137,1/6356752.314245179),S=new i(1/40680631590769,1/40680631590769,1/40408299984661.445),C=new i(1/1737400,1/1737400,1/1737400),R=new i(1/301855876e4,1/301855876e4,1/301855876e4),q=new i(1/6378137,1/6378137,1/6356752.314140356),O=new i(1/40680631590769,1/40680631590769,1/40408299983328.77),_=n.CesiumMath.EPSILON1;function b(e,r,a,o){r=t.defaultValue(r,0),a=t.defaultValue(a,0),o=t.defaultValue(o,0),e._radii=new i(r,a,o),e._radiiSquared=new i(r*r,a*a,o*o),e._radiiToTheFourth=new i(r*r*r*r,a*a*a*a,o*o*o*o),e._oneOverRadii=new i(0===r?0:1/r,0===a?0:1/a,0===o?0:1/o),e._oneOverRadiiSquared=new i(0===r?0:1/(r*r),0===a?0:1/(a*a),0===o?0:1/(o*o)),e._minimumRadius=Math.min(r,a,o),e._maximumRadius=Math.max(r,a,o),e._centerToleranceSquared=n.CesiumMath.EPSILON1,0!==e._radiiSquared.z&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function T(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,b(this,e,t,n)}g.fromCartesian=function(e,r,a){let o=null,u=null;const s=t.defined(r)?r._centerToleranceSquared:_;"CGCS2000"===globalThis?.ellipsoidCoordinates?(o=q,u=O):"MOON"===globalThis?.ellipsoidCoordinates?(o=C,u=R):(o=t.defined(r)?r.oneOverRadii:w,u=t.defined(r)?r.oneOverRadiiSquared:S);const c=p(e,o,u,s,z);if(!t.defined(c))return;let d=i.multiplyComponents(c,u,x);d=i.normalize(d,d);const l=i.subtract(e,c,M),f=Math.atan2(d.y,d.x),h=Math.asin(d.z),m=n.CesiumMath.sign(i.dot(l,e))*i.magnitude(l);return t.defined(a)?(a.longitude=f,a.latitude=h,a.height=m,a):new g(f,h,m)},g.toCartesian=function(e,t,n){return i.fromRadians(e.longitude,e.latitude,e.height,t,n)},g.clone=function(e,n){if(t.defined(e))return t.defined(n)?(n.longitude=e.longitude,n.latitude=e.latitude,n.height=e.height,n):new g(e.longitude,e.latitude,e.height)},g.equals=function(e,n){return e===n||t.defined(e)&&t.defined(n)&&e.longitude===n.longitude&&e.latitude===n.latitude&&e.height===n.height},g.equalsEpsilon=function(e,n,i){return i=t.defaultValue(i,0),e===n||t.defined(e)&&t.defined(n)&&Math.abs(e.longitude-n.longitude)<=i&&Math.abs(e.latitude-n.latitude)<=i&&Math.abs(e.height-n.height)<=i},g.ZERO=Object.freeze(new g(0,0,0)),g.prototype.clone=function(e){return g.clone(this,e)},g.prototype.equals=function(e){return g.equals(this,e)},g.prototype.equalsEpsilon=function(e,t){return g.equalsEpsilon(this,e,t)},g.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`},Object.defineProperties(T.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}}}),T.clone=function(e,n){if(!t.defined(e))return;const r=e._radii;return t.defined(n)?(i.clone(r,n._radii),i.clone(e._radiiSquared,n._radiiSquared),i.clone(e._radiiToTheFourth,n._radiiToTheFourth),i.clone(e._oneOverRadii,n._oneOverRadii),i.clone(e._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=e._minimumRadius,n._maximumRadius=e._maximumRadius,n._centerToleranceSquared=e._centerToleranceSquared,n):new T(r.x,r.y,r.z)},T.fromCartesian3=function(e,n){return t.defined(n)||(n=new T),t.defined(e)?(b(n,e.x,e.y,e.z),n):n},T.WGS84=Object.freeze(new T(6378137,6378137,6356752.314245179)),T.CGCS2000=Object.freeze(new T(6378137,6378137,6356752.314140356)),T.MOON2023=Object.freeze(new T(1737400,1737400,1737400)),T.UNIT_SPHERE=Object.freeze(new T(1,1,1)),T.MOON=Object.freeze(new T(n.CesiumMath.LUNAR_RADIUS,n.CesiumMath.LUNAR_RADIUS,n.CesiumMath.LUNAR_RADIUS)),T.prototype.clone=function(e){return T.clone(this,e)},T.packedLength=i.packedLength,T.pack=function(e,n,r){return r=t.defaultValue(r,0),i.pack(e._radii,n,r),n},T.unpack=function(e,n,r){n=t.defaultValue(n,0);const a=i.unpack(e,n);return T.fromCartesian3(a,r)},T.prototype.geocentricSurfaceNormal=i.normalize,T.prototype.geodeticSurfaceNormalCartographic=function(e,n){const r=e.longitude,a=e.latitude,o=Math.cos(a),u=o*Math.cos(r),s=o*Math.sin(r),c=Math.sin(a);return t.defined(n)||(n=new i),n.x=u,n.y=s,n.z=c,i.normalize(n,n)},T.prototype.geodeticSurfaceNormal=function(e,r){if(!i.equalsEpsilon(e,i.ZERO,n.CesiumMath.EPSILON14))return t.defined(r)||(r=new i),r=i.multiplyComponents(e,this._oneOverRadiiSquared,r),i.normalize(r,r)};const E=new i,A=new i;T.prototype.cartographicToCartesian=function(e,n){const r=E,a=A;this.geodeticSurfaceNormalCartographic(e,r),i.multiplyComponents(this._radiiSquared,r,a);const o=Math.sqrt(i.dot(r,a));return i.divideByScalar(a,o,a),i.multiplyByScalar(r,e.height,r),t.defined(n)||(n=new i),i.add(a,r,n)},T.prototype.cartographicArrayToCartesianArray=function(e,n){const i=e.length;t.defined(n)?n.length=i:n=new Array(i);for(let t=0;t=this._radii.z-n))return r};const V=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],U=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function k(e,t,n){const i=.5*(t+e),r=.5*(t-e);let a=0;for(let e=0;e<5;e++){const t=r*V[e];a+=U[e]*(n(i+t)+n(i-t))}return a*=r,a}function L(e,n,i,r,a,o,u,s,c){this[0]=t.defaultValue(e,0),this[1]=t.defaultValue(r,0),this[2]=t.defaultValue(u,0),this[3]=t.defaultValue(n,0),this[4]=t.defaultValue(a,0),this[5]=t.defaultValue(s,0),this[6]=t.defaultValue(i,0),this[7]=t.defaultValue(o,0),this[8]=t.defaultValue(c,0)}T.prototype.surfaceArea=function(e){const t=e.west;let i=e.east;const r=e.south,a=e.north;for(;ir&&(a=t,r=n)}let o=1,u=0;const s=Z[a],c=F[a];if(Math.abs(e[L.getElementIndex(c,s)])>i){const t=(e[L.getElementIndex(c,c)]-e[L.getElementIndex(s,s)])/2/e[L.getElementIndex(c,s)];let n;n=t<0?-1/(-t+Math.sqrt(1+t*t)):1/(t+Math.sqrt(1+t*t)),o=1/Math.sqrt(1+n*n),u=n*o}return(t=L.clone(L.IDENTITY,t))[L.getElementIndex(s,s)]=t[L.getElementIndex(c,c)]=o,t[L.getElementIndex(c,s)]=u,t[L.getElementIndex(s,c)]=-u,t}const Y=new L,H=new L;L.computeEigenDecomposition=function(e,i){const r=n.CesiumMath.EPSILON20;let a=0,o=0;t.defined(i)||(i={});const u=i.unitary=L.clone(L.IDENTITY,i.unitary),s=i.diagonal=L.clone(e,i.diagonal),c=r*function(e){let t=0;for(let n=0;n<9;++n){const i=e[n];t+=i*i}return Math.sqrt(t)}(s);for(;o<10&&G(s)>c;)X(s,Y),L.transpose(Y,H),L.multiply(s,Y,s),L.multiply(H,s,s),L.multiply(u,Y,u),++a>2&&(++o,a=0);return i},L.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t},L.determinant=function(e){const t=e[0],n=e[3],i=e[6],r=e[1],a=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(a*c-s*o)+r*(s*i-n*c)+u*(n*o-a*i)},L.inverse=function(e,t){const n=e[0],i=e[1],r=e[2],a=e[3],o=e[4],u=e[5],s=e[6],c=e[7],d=e[8],l=L.determinant(e);t[0]=o*d-c*u,t[1]=c*r-i*d,t[2]=i*u-o*r,t[3]=s*u-a*d,t[4]=n*d-s*r,t[5]=a*r-n*u,t[6]=a*c-s*o,t[7]=s*i-n*c,t[8]=n*o-a*i;const f=1/l;return L.multiplyByScalar(t,f,t)};const Q=new L;L.inverseTranspose=function(e,t){return L.inverse(L.transpose(e,Q),t)},L.equals=function(e,n){return e===n||t.defined(e)&&t.defined(n)&&e[0]===n[0]&&e[1]===n[1]&&e[2]===n[2]&&e[3]===n[3]&&e[4]===n[4]&&e[5]===n[5]&&e[6]===n[6]&&e[7]===n[7]&&e[8]===n[8]},L.equalsEpsilon=function(e,n,i){return i=t.defaultValue(i,0),e===n||t.defined(e)&&t.defined(n)&&Math.abs(e[0]-n[0])<=i&&Math.abs(e[1]-n[1])<=i&&Math.abs(e[2]-n[2])<=i&&Math.abs(e[3]-n[3])<=i&&Math.abs(e[4]-n[4])<=i&&Math.abs(e[5]-n[5])<=i&&Math.abs(e[6]-n[6])<=i&&Math.abs(e[7]-n[7])<=i&&Math.abs(e[8]-n[8])<=i},L.IDENTITY=Object.freeze(new L(1,0,0,0,1,0,0,0,1)),L.ZERO=Object.freeze(new L(0,0,0,0,0,0,0,0,0)),L.COLUMN0ROW0=0,L.COLUMN0ROW1=1,L.COLUMN0ROW2=2,L.COLUMN1ROW0=3,L.COLUMN1ROW1=4,L.COLUMN1ROW2=5,L.COLUMN2ROW0=6,L.COLUMN2ROW1=7,L.COLUMN2ROW2=8,Object.defineProperties(L.prototype,{length:{get:function(){return L.packedLength}}}),L.prototype.clone=function(e){return L.clone(this,e)},L.prototype.equals=function(e){return L.equals(this,e)},L.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},L.prototype.equalsEpsilon=function(e,t){return L.equalsEpsilon(this,e,t)},L.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]})\n(${this[1]}, ${this[4]}, ${this[7]})\n(${this[2]}, ${this[5]}, ${this[8]})`},e.Cartesian3=i,e.Cartographic=g,e.Ellipsoid=T,e.Matrix3=L}));