/** * @license * Cesium - https://github.com/CesiumGS/cesium * Version 1.144.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-PZM5FOOW.js";import{a as S,b as e}from"./chunk-3MNKUQ6L.js";import{f as z}from"./chunk-J4SK6SKL.js";var m=class p{constructor(n,o,c){this.x=n??0,this.y=o??0,this.z=c??0}static fromSpherical(n,o){e.typeOf.object("spherical",n),z(o)||(o=new p);let c=n.clock,t=n.cone,y=n.magnitude??1,O=y*Math.sin(t);return o.x=O*Math.cos(c),o.y=O*Math.sin(c),o.z=y*Math.cos(t),o}static fromElements(n,o,c,t){return z(t)?(t.x=n,t.y=o,t.z=c,t):new p(n,o,c)}static clone(n,o){if(z(n))return z(o)?(o.x=n.x,o.y=n.y,o.z=n.z,o):new p(n.x,n.y,n.z)}static pack(n,o,c){return e.typeOf.object("value",n),e.defined("array",o),c=c??0,o[c++]=n.x,o[c++]=n.y,o[c]=n.z,o}static unpack(n,o,c){return e.defined("array",n),o=o??0,z(c)||(c=new p),c.x=n[o++],c.y=n[o++],c.z=n[o],c}static packArray(n,o){e.defined("array",n);let c=n.length,t=c*3;if(!z(o))o=new Array(t);else{if(!Array.isArray(o)&&o.length!==t)throw new S("If result is a typed array, it must have exactly array.length * 3 elements");o.length!==t&&(o.length=t)}for(let y=0;yj;)_(f,B),p.transpose(B,H),p.multiply(f,B,f),p.multiply(H,f,f),p.multiply(b,B,b),++y>2&&(++O,y=0);return o}static abs(n,o){return e.typeOf.object("matrix",n),e.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}static determinant(n){e.typeOf.object("matrix",n);let o=n[0],c=n[3],t=n[6],y=n[1],O=n[4],b=n[7],f=n[2],j=n[5],w=n[8];return o*(O*w-j*b)+y*(j*t-c*w)+f*(c*b-O*t)}static inverse(n,o){e.typeOf.object("matrix",n),e.typeOf.object("result",o);let c=n[0],t=n[1],y=n[2],O=n[3],b=n[4],f=n[5],j=n[6],w=n[7],M=n[8],d=p.determinant(n);if(Math.abs(d)<=E.EPSILON15)throw new S("matrix is not invertible");o[0]=b*M-w*f,o[1]=w*y-t*M,o[2]=t*f-b*y,o[3]=j*f-O*M,o[4]=c*M-j*y,o[5]=O*y-c*f,o[6]=O*w-j*b,o[7]=j*t-c*w,o[8]=c*b-O*t;let a=1/d;return p.multiplyByScalar(o,a,o)}static inverseTranspose(n,o){return e.typeOf.object("matrix",n),e.typeOf.object("result",o),p.inverse(p.transpose(n,s),o)}static equals(n,o){return n===o||z(n)&&z(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]}static equalsEpsilon(n,o,c){return c=c??0,n===o||z(n)&&z(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}get length(){return p.packedLength}clone(n){return p.clone(this,n)}equals(n){return p.equals(this,n)}static equalsArray(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]}equalsEpsilon(n,o){return p.equalsEpsilon(this,n,o)}toString(){return`(${this[0]}, ${this[3]}, ${this[6]}) (${this[1]}, ${this[4]}, ${this[7]}) (${this[2]}, ${this[5]}, ${this[8]})`}};h.packedLength=9;h.fromArray=h.unpack;h.IDENTITY=Object.freeze(new h(1,0,0,0,1,0,0,0,1));h.ZERO=Object.freeze(new h(0,0,0,0,0,0,0,0,0));h.COLUMN0ROW0=0;h.COLUMN0ROW1=1;h.COLUMN0ROW2=2;h.COLUMN1ROW0=3;h.COLUMN1ROW1=4;h.COLUMN1ROW2=5;h.COLUMN2ROW0=6;h.COLUMN2ROW1=7;h.COLUMN2ROW2=8;var J=new R,K=new R,D=new R,F=new R,Q=new R,G=new R,B=new h,H=new h,s=new h;function v(p){let n=0;for(let o=0;o<9;++o){let c=p[o];n+=c*c}return Math.sqrt(n)}var Y=[1,0,0],g=[2,2,1];function x(p){let n=0;for(let o=0;o<3;++o){let c=p[h.getElementIndex(g[o],Y[o])];n+=2*c*c}return Math.sqrt(n)}function _(p,n){let o=E.EPSILON15,c=0,t=1;for(let j=0;j<3;++j){let w=Math.abs(p[h.getElementIndex(g[j],Y[j])]);w>c&&(t=j,c=w)}let y=1,O=0,b=Y[t],f=g[t];if(Math.abs(p[h.getElementIndex(f,b)])>o){let j=p[h.getElementIndex(f,f)],w=p[h.getElementIndex(b,b)],M=p[h.getElementIndex(f,b)],d=(j-w)/2/M,a;d<0?a=-1/(-d+Math.sqrt(1+d*d)):a=1/(d+Math.sqrt(1+d*d)),y=1/Math.sqrt(1+a*a),O=a*y}return n=h.clone(h.IDENTITY,n),n[h.getElementIndex(b,b)]=n[h.getElementIndex(f,f)]=y,n[h.getElementIndex(f,b)]=O,n[h.getElementIndex(b,f)]=-O,n}var On=h;var $={};$.EMPTY_OBJECT=Object.freeze({});$.EMPTY_ARRAY=Object.freeze([]);var fn=$;export{R as a,On as b,fn as c};