/** * @license * Cesium - https://github.com/CesiumGS/cesium * Version 1.140.0 * * 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 E}from"./chunk-N6SIW7ZL.js";import{a as S,b as y}from"./chunk-K35RPNUR.js";import{e as z}from"./chunk-RTRJ3LVQ.js";var m=class o{constructor(n,c,e){this.x=n??0,this.y=c??0,this.z=e??0}static fromSpherical(n,c){y.typeOf.object("spherical",n),z(c)||(c=new o);let e=n.clock,t=n.cone,f=n.magnitude??1,O=f*Math.sin(t);return c.x=O*Math.cos(e),c.y=O*Math.sin(e),c.z=f*Math.cos(t),c}static fromElements(n,c,e,t){return z(t)?(t.x=n,t.y=c,t.z=e,t):new o(n,c,e)}static clone(n,c){if(z(n))return z(c)?(c.x=n.x,c.y=n.y,c.z=n.z,c):new o(n.x,n.y,n.z)}static pack(n,c,e){return y.typeOf.object("value",n),y.defined("array",c),e=e??0,c[e++]=n.x,c[e++]=n.y,c[e]=n.z,c}static unpack(n,c,e){return y.defined("array",n),c=c??0,z(e)||(e=new o),e.x=n[c++],e.y=n[c++],e.z=n[c],e}static packArray(n,c){y.defined("array",n);let e=n.length,t=e*3;if(!z(c))c=new Array(t);else{if(!Array.isArray(c)&&c.length!==t)throw new S("If result is a typed array, it must have exactly array.length * 3 elements");c.length!==t&&(c.length=t)}for(let f=0;fe&&(t=h,e=w)}let f=1,O=0,b=Y[t],j=g[t];if(Math.abs(o[p.getElementIndex(j,b)])>c){let h=o[p.getElementIndex(j,j)],w=o[p.getElementIndex(b,b)],M=o[p.getElementIndex(j,b)],d=(h-w)/2/M,i;d<0?i=-1/(-d+Math.sqrt(1+d*d)):i=1/(d+Math.sqrt(1+d*d)),f=1/Math.sqrt(1+i*i),O=i*f}return n=p.clone(p.IDENTITY,n),n[p.getElementIndex(b,b)]=n[p.getElementIndex(j,j)]=f,n[p.getElementIndex(j,b)]=O,n[p.getElementIndex(b,j)]=-O,n}var B=new p,F=new p;p.computeEigenDecomposition=function(o,n){y.typeOf.object("matrix",o);let c=E.EPSILON20,e=10,t=0,f=0;z(n)||(n={});let O=n.unitary=p.clone(p.IDENTITY,n.unitary),b=n.diagonal=p.clone(o,n.diagonal),j=c*G(b);for(;fj;)_(b,B),p.transpose(B,F),p.multiply(b,B,b),p.multiply(F,b,b),p.multiply(O,B,O),++t>2&&(++f,t=0);return n};p.abs=function(o,n){return y.typeOf.object("matrix",o),y.typeOf.object("result",n),n[0]=Math.abs(o[0]),n[1]=Math.abs(o[1]),n[2]=Math.abs(o[2]),n[3]=Math.abs(o[3]),n[4]=Math.abs(o[4]),n[5]=Math.abs(o[5]),n[6]=Math.abs(o[6]),n[7]=Math.abs(o[7]),n[8]=Math.abs(o[8]),n};p.determinant=function(o){y.typeOf.object("matrix",o);let n=o[0],c=o[3],e=o[6],t=o[1],f=o[4],O=o[7],b=o[2],j=o[5],h=o[8];return n*(f*h-j*O)+t*(j*e-c*h)+b*(c*O-f*e)};p.inverse=function(o,n){y.typeOf.object("matrix",o),y.typeOf.object("result",n);let c=o[0],e=o[1],t=o[2],f=o[3],O=o[4],b=o[5],j=o[6],h=o[7],w=o[8],M=p.determinant(o);if(Math.abs(M)<=E.EPSILON15)throw new S("matrix is not invertible");n[0]=O*w-h*b,n[1]=h*t-e*w,n[2]=e*b-O*t,n[3]=j*b-f*w,n[4]=c*w-j*t,n[5]=f*t-c*b,n[6]=f*h-j*O,n[7]=j*e-c*h,n[8]=c*O-f*e;let d=1/M;return p.multiplyByScalar(n,d,n)};var x=new p;p.inverseTranspose=function(o,n){return y.typeOf.object("matrix",o),y.typeOf.object("result",n),p.inverse(p.transpose(o,x),n)};p.equals=function(o,n){return o===n||z(o)&&z(n)&&o[0]===n[0]&&o[1]===n[1]&&o[2]===n[2]&&o[3]===n[3]&&o[4]===n[4]&&o[5]===n[5]&&o[6]===n[6]&&o[7]===n[7]&&o[8]===n[8]};p.equalsEpsilon=function(o,n,c){return c=c??0,o===n||z(o)&&z(n)&&Math.abs(o[0]-n[0])<=c&&Math.abs(o[1]-n[1])<=c&&Math.abs(o[2]-n[2])<=c&&Math.abs(o[3]-n[3])<=c&&Math.abs(o[4]-n[4])<=c&&Math.abs(o[5]-n[5])<=c&&Math.abs(o[6]-n[6])<=c&&Math.abs(o[7]-n[7])<=c&&Math.abs(o[8]-n[8])<=c};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(o){return p.clone(this,o)};p.prototype.equals=function(o){return p.equals(this,o)};p.equalsArray=function(o,n,c){return o[0]===n[c]&&o[1]===n[c+1]&&o[2]===n[c+2]&&o[3]===n[c+3]&&o[4]===n[c+4]&&o[5]===n[c+5]&&o[6]===n[c+6]&&o[7]===n[c+7]&&o[8]===n[c+8]};p.prototype.equalsEpsilon=function(o,n){return p.equalsEpsilon(this,o,n)};p.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]}) (${this[1]}, ${this[4]}, ${this[7]}) (${this[2]}, ${this[5]}, ${this[8]})`};var pn=p;var $={};$.EMPTY_OBJECT=Object.freeze({});$.EMPTY_ARRAY=Object.freeze([]);var On=$;export{R as a,pn as b,On as c};