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