/** * @license * Cesium - https://github.com/CesiumGS/cesium * Version 1.110.1 * * Copyright 2011-2022 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Columbus View (Pat. Pend.) * * Portions licensed separately. * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ import{a as z}from"./chunk-CLQ5X6HS.js";import{a as u}from"./chunk-FOJGNIAW.js";import{a as r,b as c}from"./chunk-UGI536VH.js";import{e as h}from"./chunk-BQUQ5TPM.js";function f(n,o,e){this.x=u(n,0),this.y=u(o,0),this.z=u(e,0)}f.fromSpherical=function(n,o){c.typeOf.object("spherical",n),h(o)||(o=new f);let e=n.clock,t=n.cone,i=u(n.magnitude,1),y=i*Math.sin(t);return o.x=y*Math.cos(e),o.y=y*Math.sin(e),o.z=i*Math.cos(t),o};f.fromElements=function(n,o,e,t){return h(t)?(t.x=n,t.y=o,t.z=e,t):new f(n,o,e)};f.clone=function(n,o){if(h(n))return h(o)?(o.x=n.x,o.y=n.y,o.z=n.z,o):new f(n.x,n.y,n.z)};f.fromCartesian4=f.clone;f.packedLength=3;f.pack=function(n,o,e){return c.typeOf.object("value",n),c.defined("array",o),e=u(e,0),o[e++]=n.x,o[e++]=n.y,o[e]=n.z,o};f.unpack=function(n,o,e){return c.defined("array",n),o=u(o,0),h(e)||(e=new f),e.x=n[o++],e.y=n[o++],e.z=n[o],e};f.packArray=function(n,o){c.defined("array",n);let e=n.length,t=e*3;if(!h(o))o=new Array(t);else{if(!Array.isArray(o)&&o.length!==t)throw new r("If result is a typed array, it must have exactly array.length * 3 elements");o.length!==t&&(o.length=t)}for(let i=0;iz.EPSILON12);return h(i)?(i.x=y*L,i.y=d*k,i.z=a*U,i):new O(y*L,d*k,a*U)}var X=hn;function R(n,o,e){this.longitude=u(n,0),this.latitude=u(o,0),this.height=u(e,0)}R.fromRadians=function(n,o,e,t){return c.typeOf.number("longitude",n),c.typeOf.number("latitude",o),e=u(e,0),h(t)?(t.longitude=n,t.latitude=o,t.height=e,t):new R(n,o,e)};R.fromDegrees=function(n,o,e,t){return c.typeOf.number("longitude",n),c.typeOf.number("latitude",o),n=z.toRadians(n),o=z.toRadians(o),R.fromRadians(n,o,e,t)};var mn=new O,bn=new O,un=new O,wn=new O(1/6378137,1/6378137,1/6356752314245179e-9),jn=new O(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9)),zn=z.EPSILON1;R.fromCartesian=function(n,o,e){let t=h(o)?o.oneOverRadii:wn,i=h(o)?o.oneOverRadiiSquared:jn,y=h(o)?o._centerToleranceSquared:zn,d=X(n,t,i,y,bn);if(!h(d))return;let a=O.multiplyComponents(d,i,mn);a=O.normalize(a,a);let m=O.subtract(n,d,un),b=Math.atan2(a.y,a.x),j=Math.asin(a.z),S=z.sign(O.dot(m,n))*O.magnitude(m);return h(e)?(e.longitude=b,e.latitude=j,e.height=S,e):new R(b,j,S)};R.toCartesian=function(n,o,e){return c.defined("cartographic",n),O.fromRadians(n.longitude,n.latitude,n.height,o,e)};R.clone=function(n,o){if(h(n))return h(o)?(o.longitude=n.longitude,o.latitude=n.latitude,o.height=n.height,o):new R(n.longitude,n.latitude,n.height)};R.equals=function(n,o){return n===o||h(n)&&h(o)&&n.longitude===o.longitude&&n.latitude===o.latitude&&n.height===o.height};R.equalsEpsilon=function(n,o,e){return e=u(e,0),n===o||h(n)&&h(o)&&Math.abs(n.longitude-o.longitude)<=e&&Math.abs(n.latitude-o.latitude)<=e&&Math.abs(n.height-o.height)<=e};R.ZERO=Object.freeze(new R(0,0,0));R.prototype.clone=function(n){return R.clone(this,n)};R.prototype.equals=function(n){return R.equals(this,n)};R.prototype.equalsEpsilon=function(n,o){return R.equalsEpsilon(this,n,o)};R.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};var on=R;function tn(n,o,e,t){o=u(o,0),e=u(e,0),t=u(t,0),c.typeOf.number.greaterThanOrEquals("x",o,0),c.typeOf.number.greaterThanOrEquals("y",e,0),c.typeOf.number.greaterThanOrEquals("z",t,0),n._radii=new O(o,e,t),n._radiiSquared=new O(o*o,e*e,t*t),n._radiiToTheFourth=new O(o*o*o*o,e*e*e*e,t*t*t*t),n._oneOverRadii=new O(o===0?0:1/o,e===0?0:1/e,t===0?0:1/t),n._oneOverRadiiSquared=new O(o===0?0:1/(o*o),e===0?0:1/(e*e),t===0?0:1/(t*t)),n._minimumRadius=Math.min(o,e,t),n._maximumRadius=Math.max(o,e,t),n._centerToleranceSquared=z.EPSILON1,n._radiiSquared.z!==0&&(n._squaredXOverSquaredZ=n._radiiSquared.x/n._radiiSquared.z)}function w(n,o,e){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,tn(this,n,o,e)}Object.defineProperties(w.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}}});w.clone=function(n,o){if(!h(n))return;let e=n._radii;return h(o)?(O.clone(e,o._radii),O.clone(n._radiiSquared,o._radiiSquared),O.clone(n._radiiToTheFourth,o._radiiToTheFourth),O.clone(n._oneOverRadii,o._oneOverRadii),O.clone(n._oneOverRadiiSquared,o._oneOverRadiiSquared),o._minimumRadius=n._minimumRadius,o._maximumRadius=n._maximumRadius,o._centerToleranceSquared=n._centerToleranceSquared,o):new w(e.x,e.y,e.z)};w.fromCartesian3=function(n,o){return h(o)||(o=new w),h(n)&&tn(o,n.x,n.y,n.z),o};w.WGS84=Object.freeze(new w(6378137,6378137,6356752314245179e-9));w.UNIT_SPHERE=Object.freeze(new w(1,1,1));w.MOON=Object.freeze(new w(z.LUNAR_RADIUS,z.LUNAR_RADIUS,z.LUNAR_RADIUS));w.prototype.clone=function(n){return w.clone(this,n)};w.packedLength=O.packedLength;w.pack=function(n,o,e){return c.typeOf.object("value",n),c.defined("array",o),e=u(e,0),O.pack(n._radii,o,e),o};w.unpack=function(n,o,e){c.defined("array",n),o=u(o,0);let t=O.unpack(n,o);return w.fromCartesian3(t,e)};w.prototype.geocentricSurfaceNormal=O.normalize;w.prototype.geodeticSurfaceNormalCartographic=function(n,o){c.typeOf.object("cartographic",n);let e=n.longitude,t=n.latitude,i=Math.cos(t),y=i*Math.cos(e),d=i*Math.sin(e),a=Math.sin(t);return h(o)||(o=new O),o.x=y,o.y=d,o.z=a,O.normalize(o,o)};w.prototype.geodeticSurfaceNormal=function(n,o){if(!O.equalsEpsilon(n,O.ZERO,z.EPSILON14))return h(o)||(o=new O),o=O.multiplyComponents(n,this._oneOverRadiiSquared,o),O.normalize(o,o)};var Sn=new O,Mn=new O;w.prototype.cartographicToCartesian=function(n,o){let e=Sn,t=Mn;this.geodeticSurfaceNormalCartographic(n,e),O.multiplyComponents(this._radiiSquared,e,t);let i=Math.sqrt(O.dot(e,t));return O.divideByScalar(t,i,t),O.multiplyByScalar(e,n.height,e),h(o)||(o=new O),O.add(t,e,o)};w.prototype.cartographicArrayToCartesianArray=function(n,o){c.defined("cartographics",n);let e=n.length;h(o)?o.length=e:o=new Array(e);for(let t=0;t=this._radii.z-o))return e};var Tn=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],gn=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function en(n,o,e){c.typeOf.number("a",n),c.typeOf.number("b",o),c.typeOf.func("func",e);let t=.5*(o+n),i=.5*(o-n),y=0;for(let d=0;d<5;d++){let a=i*Tn[d];y+=gn[d]*(e(t+a)+e(t-a))}return y*=i,y}w.prototype.surfaceArea=function(n){c.typeOf.object("rectangle",n);let o=n.west,e=n.east,t=n.south,i=n.north;for(;et&&(i=b,t=j)}let y=1,d=0,a=V[i],m=H[i];if(Math.abs(n[p.getElementIndex(m,a)])>e){let b=n[p.getElementIndex(m,m)],j=n[p.getElementIndex(a,a)],S=n[p.getElementIndex(m,a)],M=(b-j)/2/S,q;M<0?q=-1/(-M+Math.sqrt(1+M*M)):q=1/(M+Math.sqrt(1+M*M)),y=1/Math.sqrt(1+q*q),d=q*y}return o=p.clone(p.IDENTITY,o),o[p.getElementIndex(a,a)]=o[p.getElementIndex(m,m)]=y,o[p.getElementIndex(m,a)]=d,o[p.getElementIndex(a,m)]=-d,o}var Y=new p,fn=new p;p.computeEigenDecomposition=function(n,o){c.typeOf.object("matrix",n);let e=z.EPSILON20,t=10,i=0,y=0;h(o)||(o={});let d=o.unitary=p.clone(p.IDENTITY,o.unitary),a=o.diagonal=p.clone(n,o.diagonal),m=e*Nn(a);for(;ym;)Ln(a,Y),p.transpose(Y,fn),p.multiply(a,Y,a),p.multiply(fn,a,a),p.multiply(d,Y,d),++i>2&&(++y,i=0);return o};p.abs=function(n,o){return c.typeOf.object("matrix",n),c.typeOf.object("result",o),o[0]=Math.abs(n[0]),o[1]=Math.abs(n[1]),o[2]=Math.abs(n[2]),o[3]=Math.abs(n[3]),o[4]=Math.abs(n[4]),o[5]=Math.abs(n[5]),o[6]=Math.abs(n[6]),o[7]=Math.abs(n[7]),o[8]=Math.abs(n[8]),o};p.determinant=function(n){c.typeOf.object("matrix",n);let o=n[0],e=n[3],t=n[6],i=n[1],y=n[4],d=n[7],a=n[2],m=n[5],b=n[8];return o*(y*b-m*d)+i*(m*t-e*b)+a*(e*d-y*t)};p.inverse=function(n,o){c.typeOf.object("matrix",n),c.typeOf.object("result",o);let e=n[0],t=n[1],i=n[2],y=n[3],d=n[4],a=n[5],m=n[6],b=n[7],j=n[8],S=p.determinant(n);if(Math.abs(S)<=z.EPSILON15)throw new r("matrix is not invertible");o[0]=d*j-b*a,o[1]=b*i-t*j,o[2]=t*a-d*i,o[3]=m*a-y*j,o[4]=e*j-m*i,o[5]=y*i-e*a,o[6]=y*b-m*d,o[7]=m*t-e*b,o[8]=e*d-y*t;let M=1/S;return p.multiplyByScalar(o,M,o)};var kn=new p;p.inverseTranspose=function(n,o){return c.typeOf.object("matrix",n),c.typeOf.object("result",o),p.inverse(p.transpose(n,kn),o)};p.equals=function(n,o){return n===o||h(n)&&h(o)&&n[0]===o[0]&&n[1]===o[1]&&n[2]===o[2]&&n[3]===o[3]&&n[4]===o[4]&&n[5]===o[5]&&n[6]===o[6]&&n[7]===o[7]&&n[8]===o[8]};p.equalsEpsilon=function(n,o,e){return e=u(e,0),n===o||h(n)&&h(o)&&Math.abs(n[0]-o[0])<=e&&Math.abs(n[1]-o[1])<=e&&Math.abs(n[2]-o[2])<=e&&Math.abs(n[3]-o[3])<=e&&Math.abs(n[4]-o[4])<=e&&Math.abs(n[5]-o[5])<=e&&Math.abs(n[6]-o[6])<=e&&Math.abs(n[7]-o[7])<=e&&Math.abs(n[8]-o[8])<=e};p.IDENTITY=Object.freeze(new p(1,0,0,0,1,0,0,0,1));p.ZERO=Object.freeze(new p(0,0,0,0,0,0,0,0,0));p.COLUMN0ROW0=0;p.COLUMN0ROW1=1;p.COLUMN0ROW2=2;p.COLUMN1ROW0=3;p.COLUMN1ROW1=4;p.COLUMN1ROW2=5;p.COLUMN2ROW0=6;p.COLUMN2ROW1=7;p.COLUMN2ROW2=8;Object.defineProperties(p.prototype,{length:{get:function(){return p.packedLength}}});p.prototype.clone=function(n){return p.clone(this,n)};p.prototype.equals=function(n){return p.equals(this,n)};p.equalsArray=function(n,o,e){return n[0]===o[e]&&n[1]===o[e+1]&&n[2]===o[e+2]&&n[3]===o[e+3]&&n[4]===o[e+4]&&n[5]===o[e+5]&&n[6]===o[e+6]&&n[7]===o[e+7]&&n[8]===o[e+8]};p.prototype.equalsEpsilon=function(n,o){return p.equalsEpsilon(this,n,o)};p.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]}) (${this[1]}, ${this[4]}, ${this[7]}) (${this[2]}, ${this[5]}, ${this[8]})`};var uo=p;export{O as a,on as b,fo as c,uo as d};