/** * @license * Cesium - https://github.com/CesiumGS/cesium * Version 1.115 * * 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 w}from"./chunk-GGFNGKXD.js";import{a as u}from"./chunk-A7LPWAU6.js";import{a as M,b as c}from"./chunk-UNVMUIJM.js";import{e as a}from"./chunk-WVB7XP3Q.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),a(o)||(o=new f);let e=n.clock,t=n.cone,i=u(n.magnitude,1),p=i*Math.sin(t);return o.x=p*Math.cos(e),o.y=p*Math.sin(e),o.z=i*Math.cos(t),o};f.fromElements=function(n,o,e,t){return a(t)?(t.x=n,t.y=o,t.z=e,t):new f(n,o,e)};f.clone=function(n,o){if(a(n))return a(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),a(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(!a(o))o=new Array(t);else{if(!Array.isArray(o)&&o.length!==t)throw new M("If result is a typed array, it must have exactly array.length * 3 elements");o.length!==t&&(o.length=t)}for(let i=0;iw.EPSILON12);return a(i)?(i.x=p*L,i.y=m*x,i.z=h*B,i):new O(p*L,m*x,h*B)}var X=rn;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),a(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=w.toRadians(n),o=w.toRadians(o),R.fromRadians(n,o,e,t)};var zn=new O,Sn=new O,Mn=new O,qn=new O(1/6378137,1/6378137,1/6356752314245179e-9),Rn=new O(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9)),gn=w.EPSILON1;R.fromCartesian=function(n,o,e){let t=a(o)?o.oneOverRadii:qn,i=a(o)?o.oneOverRadiiSquared:Rn,p=a(o)?o._centerToleranceSquared:gn,m=X(n,t,i,p,Sn);if(!a(m))return;let h=O.multiplyComponents(m,i,zn);h=O.normalize(h,h);let b=O.subtract(n,m,Mn),j=Math.atan2(h.y,h.x),z=Math.asin(h.z),S=w.sign(O.dot(b,n))*O.magnitude(b);return a(e)?(e.longitude=j,e.latitude=z,e.height=S,e):new R(j,z,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(a(n))return a(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||a(n)&&a(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||a(n)&&a(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 cn=R;function d(n,o){this.x=u(n,0),this.y=u(o,0)}d.fromElements=function(n,o,e){return a(e)?(e.x=n,e.y=o,e):new d(n,o)};d.clone=function(n,o){if(a(n))return a(o)?(o.x=n.x,o.y=n.y,o):new d(n.x,n.y)};d.fromCartesian3=d.clone;d.fromCartesian4=d.clone;d.packedLength=2;d.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};d.unpack=function(n,o,e){return c.defined("array",n),o=u(o,0),a(e)||(e=new d),e.x=n[o++],e.y=n[o],e};d.packArray=function(n,o){c.defined("array",n);let e=n.length,t=e*2;if(!a(o))o=new Array(t);else{if(!Array.isArray(o)&&o.length!==t)throw new M("If result is a typed array, it must have exactly array.length * 2 elements");o.length!==t&&(o.length=t)}for(let i=0;i=this._radii.z-o))return e};var An=new O;r.prototype.getLocalCurvature=function(n,o){c.typeOf.object("surfacePosition",n),a(o)||(o=new G);let e=this.getSurfaceNormalIntersectionWithZAxis(n,0,An),t=O.distance(n,e),i=this.minimumRadius*t/this.maximumRadius**2,p=t*i**2;return G.fromElements(1/t,1/p,o)};var kn=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],Ln=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function an(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),p=0;for(let m=0;m<5;m++){let h=i*kn[m];p+=Ln[m]*(e(t+h)+e(t-h))}return p*=i,p}r.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=j,t=z)}let p=1,m=0,h=K[i],b=Q[i];if(Math.abs(n[y.getElementIndex(b,h)])>e){let j=n[y.getElementIndex(b,b)],z=n[y.getElementIndex(h,h)],S=n[y.getElementIndex(b,h)],q=(j-z)/2/S,g;q<0?g=-1/(-q+Math.sqrt(1+q*q)):g=1/(q+Math.sqrt(1+q*q)),p=1/Math.sqrt(1+g*g),m=g*p}return o=y.clone(y.IDENTITY,o),o[y.getElementIndex(h,h)]=o[y.getElementIndex(b,b)]=p,o[y.getElementIndex(b,h)]=m,o[y.getElementIndex(h,b)]=-m,o}var $=new y,On=new y;y.computeEigenDecomposition=function(n,o){c.typeOf.object("matrix",n);let e=w.EPSILON20,t=10,i=0,p=0;a(o)||(o={});let m=o.unitary=y.clone(y.IDENTITY,o.unitary),h=o.diagonal=y.clone(n,o.diagonal),b=e*Dn(h);for(;pb;)Xn(h,$),y.transpose($,On),y.multiply(h,$,h),y.multiply(On,h,h),y.multiply(m,$,m),++i>2&&(++p,i=0);return o};y.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};y.determinant=function(n){c.typeOf.object("matrix",n);let o=n[0],e=n[3],t=n[6],i=n[1],p=n[4],m=n[7],h=n[2],b=n[5],j=n[8];return o*(p*j-b*m)+i*(b*t-e*j)+h*(e*m-p*t)};y.inverse=function(n,o){c.typeOf.object("matrix",n),c.typeOf.object("result",o);let e=n[0],t=n[1],i=n[2],p=n[3],m=n[4],h=n[5],b=n[6],j=n[7],z=n[8],S=y.determinant(n);if(Math.abs(S)<=w.EPSILON15)throw new M("matrix is not invertible");o[0]=m*z-j*h,o[1]=j*i-t*z,o[2]=t*h-m*i,o[3]=b*h-p*z,o[4]=e*z-b*i,o[5]=p*i-e*h,o[6]=p*j-b*m,o[7]=b*t-e*j,o[8]=e*m-p*t;let q=1/S;return y.multiplyByScalar(o,q,o)};var Yn=new y;y.inverseTranspose=function(n,o){return c.typeOf.object("matrix",n),c.typeOf.object("result",o),y.inverse(y.transpose(n,Yn),o)};y.equals=function(n,o){return n===o||a(n)&&a(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]};y.equalsEpsilon=function(n,o,e){return e=u(e,0),n===o||a(n)&&a(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};y.IDENTITY=Object.freeze(new y(1,0,0,0,1,0,0,0,1));y.ZERO=Object.freeze(new y(0,0,0,0,0,0,0,0,0));y.COLUMN0ROW0=0;y.COLUMN0ROW1=1;y.COLUMN0ROW2=2;y.COLUMN1ROW0=3;y.COLUMN1ROW1=4;y.COLUMN1ROW2=5;y.COLUMN2ROW0=6;y.COLUMN2ROW1=7;y.COLUMN2ROW2=8;Object.defineProperties(y.prototype,{length:{get:function(){return y.packedLength}}});y.prototype.clone=function(n){return y.clone(this,n)};y.prototype.equals=function(n){return y.equals(this,n)};y.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]};y.prototype.equalsEpsilon=function(n,o){return y.equalsEpsilon(this,n,o)};y.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]}) (${this[1]}, ${this[4]}, ${this[7]}) (${this[2]}, ${this[5]}, ${this[8]})`};var so=y;export{O as a,cn as b,G as c,qo as d,so as e};