Newer
Older
smartwell_front_dz / XLJCYJ / mars3d-cesium / Workers / chunk-WADCMYQO.js
wangxitong on 8 Jul 2024 28 KB 达州变更
/**
 * @license
 * Cesium - https://github.com/CesiumGS/cesium
 * Version 1.109.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-2LQD2HPA.js";import{a as u}from"./chunk-3B6S2GOO.js";import{a as r,b as c}from"./chunk-EYEHMX6X.js";import{e as h}from"./chunk-BWKFPVR5.js";function f(e,t,n){this.x=u(e,0),this.y=u(t,0),this.z=u(n,0)}f.fromSpherical=function(e,t){c.typeOf.object("spherical",e),h(t)||(t=new f);let n=e.clock,r=e.cone,a=u(e.magnitude,1),i=a*Math.sin(r);return t.x=i*Math.cos(n),t.y=i*Math.sin(n),t.z=a*Math.cos(r),t},f.fromElements=function(e,t,n,r){return h(r)?(r.x=e,r.y=t,r.z=n,r):new f(e,t,n)},f.clone=function(e,t){if(h(e))return h(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new f(e.x,e.y,e.z)},f.fromCartesian4=f.clone,f.packedLength=3,f.pack=function(e,t,n){return c.typeOf.object("value",e),c.defined("array",t),n=u(n,0),t[n++]=e.x,t[n++]=e.y,t[n]=e.z,t},f.unpack=function(e,t,n){return c.defined("array",e),t=u(t,0),h(n)||(n=new f),n.x=e[t++],n.y=e[t++],n.z=e[t],n},f.packArray=function(e,t){c.defined("array",e);let n=e.length,a=3*n;if(h(t)){if(!Array.isArray(t)&&t.length!==a)throw new r("If result is a typed array, it must have exactly array.length * 3 elements");t.length!==a&&(t.length=a)}else t=new Array(a);for(let r=0;r<n;++r)f.pack(e[r],t,3*r);return t},f.unpackArray=function(e,t){if(c.defined("array",e),c.typeOf.number.greaterThanOrEquals("array.length",e.length,3),e.length%3!==0)throw new r("array length must be a multiple of 3.");let n=e.length;h(t)?t.length=n/3:t=new Array(n/3);for(let r=0;r<n;r+=3){let n=r/3;t[n]=f.unpack(e,r,t[n])}return t},f.fromArray=f.unpack,f.maximumComponent=function(e){return c.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z)},f.minimumComponent=function(e){return c.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z)},f.minimumByComponent=function(e,t,n){return c.typeOf.object("first",e),c.typeOf.object("second",t),c.typeOf.object("result",n),n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},f.maximumByComponent=function(e,t,n){return c.typeOf.object("first",e),c.typeOf.object("second",t),c.typeOf.object("result",n),n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},f.clamp=function(e,t,n,r){c.typeOf.object("value",e),c.typeOf.object("min",t),c.typeOf.object("max",n),c.typeOf.object("result",r);let a=z.clamp(e.x,t.x,n.x),i=z.clamp(e.y,t.y,n.y),o=z.clamp(e.z,t.z,n.z);return r.x=a,r.y=i,r.z=o,r},f.magnitudeSquared=function(e){return c.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z},f.magnitude=function(e){return Math.sqrt(f.magnitudeSquared(e))};var P=new f;f.distance=function(e,t){return c.typeOf.object("left",e),c.typeOf.object("right",t),f.subtract(e,t,P),f.magnitude(P)},f.distanceSquared=function(e,t){return c.typeOf.object("left",e),c.typeOf.object("right",t),f.subtract(e,t,P),f.magnitudeSquared(P)},f.normalize=function(e,t){c.typeOf.object("cartesian",e),c.typeOf.object("result",t);let n=f.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,isNaN(t.x)||isNaN(t.y)||isNaN(t.z))throw new r("normalized result is not a number");return t},f.dot=function(e,t){return c.typeOf.object("left",e),c.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z},f.multiplyComponents=function(e,t,n){return c.typeOf.object("left",e),c.typeOf.object("right",t),c.typeOf.object("result",n),n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},f.divideComponents=function(e,t,n){return c.typeOf.object("left",e),c.typeOf.object("right",t),c.typeOf.object("result",n),n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},f.add=function(e,t,n){return c.typeOf.object("left",e),c.typeOf.object("right",t),c.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},f.subtract=function(e,t,n){return c.typeOf.object("left",e),c.typeOf.object("right",t),c.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},f.multiplyByScalar=function(e,t,n){return c.typeOf.object("cartesian",e),c.typeOf.number("scalar",t),c.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},f.divideByScalar=function(e,t,n){return c.typeOf.object("cartesian",e),c.typeOf.number("scalar",t),c.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},f.negate=function(e,t){return c.typeOf.object("cartesian",e),c.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t},f.abs=function(e,t){return c.typeOf.object("cartesian",e),c.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var nn=new f;f.lerp=function(e,t,n,r){return c.typeOf.object("start",e),c.typeOf.object("end",t),c.typeOf.number("t",n),c.typeOf.object("result",r),f.multiplyByScalar(t,n,nn),r=f.multiplyByScalar(e,1-n,r),f.add(nn,r,r)};var D=new f,G=new f;f.angleBetween=function(e,t){c.typeOf.object("left",e),c.typeOf.object("right",t),f.normalize(e,D),f.normalize(t,G);let n=f.dot(D,G),r=f.magnitude(f.cross(D,G,D));return Math.atan2(r,n)};var yn=new f;f.mostOrthogonalAxis=function(e,t){c.typeOf.object("cartesian",e),c.typeOf.object("result",t);let n=f.normalize(e,yn);return f.abs(n,n),t=n.x<=n.y?n.x<=n.z?f.clone(f.UNIT_X,t):f.clone(f.UNIT_Z,t):n.y<=n.z?f.clone(f.UNIT_Y,t):f.clone(f.UNIT_Z,t),t},f.projectVector=function(e,t,n){c.defined("a",e),c.defined("b",t),c.defined("result",n);let r=f.dot(e,t)/f.dot(t,t);return f.multiplyByScalar(t,r,n)},f.equals=function(e,t){return e===t||h(e)&&h(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},f.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},f.equalsEpsilon=function(e,t,n,r){return e===t||h(e)&&h(t)&&z.equalsEpsilon(e.x,t.x,n,r)&&z.equalsEpsilon(e.y,t.y,n,r)&&z.equalsEpsilon(e.z,t.z,n,r)},f.cross=function(e,t,n){c.typeOf.object("left",e),c.typeOf.object("right",t),c.typeOf.object("result",n);let r=e.x,a=e.y,i=e.z,o=t.x,u=t.y,f=t.z,l=a*f-i*u,s=i*o-r*f,p=r*u-a*o;return n.x=l,n.y=s,n.z=p,n},f.midpoint=function(e,t,n){return c.typeOf.object("left",e),c.typeOf.object("right",t),c.typeOf.object("result",n),n.x=.5*(e.x+t.x),n.y=.5*(e.y+t.y),n.z=.5*(e.z+t.z),n},f.fromDegrees=function(e,t,n,r,a){return c.typeOf.number("longitude",e),c.typeOf.number("latitude",t),e=z.toRadians(e),t=z.toRadians(t),f.fromRadians(e,t,n,r,a)};var g=new f,Z=new f,dn=new f(40680631590769,40680631590769,40408299984661.445);f.fromRadians=function(e,t,n,r,a){c.typeOf.number("longitude",e),c.typeOf.number("latitude",t),n=u(n,0);let i=h(r)?r.radiiSquared:dn,o=Math.cos(t);g.x=o*Math.cos(e),g.y=o*Math.sin(e),g.z=Math.sin(t),g=f.normalize(g,g),f.multiplyComponents(i,g,Z);let l=Math.sqrt(f.dot(g,Z));return Z=f.divideByScalar(Z,l,Z),g=f.multiplyByScalar(g,n,g),h(a)||(a=new f),f.add(Z,g,a)},f.fromDegreesArray=function(e,t,n){if(c.defined("coordinates",e),e.length<2||e.length%2!==0)throw new r("the number of coordinates must be a multiple of 2 and at least 2");let a=e.length;h(n)?n.length=a/2:n=new Array(a/2);for(let r=0;r<a;r+=2){let a=e[r],i=e[r+1],o=r/2;n[o]=f.fromDegrees(a,i,0,t,n[o])}return n},f.fromRadiansArray=function(e,t,n){if(c.defined("coordinates",e),e.length<2||e.length%2!==0)throw new r("the number of coordinates must be a multiple of 2 and at least 2");let a=e.length;h(n)?n.length=a/2:n=new Array(a/2);for(let r=0;r<a;r+=2){let a=e[r],i=e[r+1],o=r/2;n[o]=f.fromRadians(a,i,0,t,n[o])}return n},f.fromDegreesArrayHeights=function(e,t,n){if(c.defined("coordinates",e),e.length<3||e.length%3!==0)throw new r("the number of coordinates must be a multiple of 3 and at least 3");let a=e.length;h(n)?n.length=a/3:n=new Array(a/3);for(let r=0;r<a;r+=3){let a=e[r],i=e[r+1],o=e[r+2],c=r/3;n[c]=f.fromDegrees(a,i,o,t,n[c])}return n},f.fromRadiansArrayHeights=function(e,t,n){if(c.defined("coordinates",e),e.length<3||e.length%3!==0)throw new r("the number of coordinates must be a multiple of 3 and at least 3");let a=e.length;h(n)?n.length=a/3:n=new Array(a/3);for(let r=0;r<a;r+=3){let a=e[r],i=e[r+1],o=e[r+2],c=r/3;n[c]=f.fromRadians(a,i,o,t,n[c])}return n},f.ZERO=Object.freeze(new f(0,0,0)),f.ONE=Object.freeze(new f(1,1,1)),f.UNIT_X=Object.freeze(new f(1,0,0)),f.UNIT_Y=Object.freeze(new f(0,1,0)),f.UNIT_Z=Object.freeze(new f(0,0,1)),f.prototype.clone=function(e){return f.clone(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.prototype.equalsEpsilon=function(e,t,n){return f.equalsEpsilon(this,e,t,n)},f.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z})`};var O=f,an=new O,On=new O;function hn(e,t,n,a,i){if(!h(e))throw new r("cartesian is required.");if(!h(t))throw new r("oneOverRadii is required.");if(!h(n))throw new r("oneOverRadiiSquared is required.");if(!h(a))throw new r("centerToleranceSquared is required.");let o=e.x,c=e.y,u=e.z,f=t.x,l=t.y,s=t.z,p=o*o*f*f,y=c*c*l*l,d=u*u*s*s,m=p+y+d,b=Math.sqrt(1/m),g=O.multiplyByScalar(e,b,an);if(m<a)return isFinite(b)?O.clone(g,i):void 0;let x=n.x,w=n.y,j=n.z,q=On;q.x=g.x*x*2,q.y=g.y*w*2,q.z=g.z*j*2;let R,M,S,v,_,E,T,N,A,C,I,k=(1-b)*O.magnitude(e)/(.5*O.magnitude(q)),L=0;do{k-=L,S=1/(1+k*x),v=1/(1+k*w),_=1/(1+k*j),E=S*S,T=v*v,N=_*_,A=E*S,C=T*v,I=N*_,R=p*E+y*T+d*N-1,M=p*A*x+y*C*w+d*I*j;let e=-2*M;L=R/e}while(Math.abs(R)>z.EPSILON12);return h(i)?(i.x=o*S,i.y=c*v,i.z=u*_,i):new O(o*S,c*v,u*_)}var X=hn;function R(e,t,n){this.longitude=u(e,0),this.latitude=u(t,0),this.height=u(n,0)}R.fromRadians=function(e,t,n,r){return c.typeOf.number("longitude",e),c.typeOf.number("latitude",t),n=u(n,0),h(r)?(r.longitude=e,r.latitude=t,r.height=n,r):new R(e,t,n)},R.fromDegrees=function(e,t,n,r){return c.typeOf.number("longitude",e),c.typeOf.number("latitude",t),e=z.toRadians(e),t=z.toRadians(t),R.fromRadians(e,t,n,r)};var mn=new O,bn=new O,un=new O,wn=new O(1/6378137,1/6378137,1/6356752.314245179),jn=new O(1/40680631590769,1/40680631590769,1/40408299984661.445),zn=z.EPSILON1;R.fromCartesian=function(e,t,n){let r=h(t)?t.oneOverRadii:wn,a=h(t)?t.oneOverRadiiSquared:jn,i=h(t)?t._centerToleranceSquared:zn,o=X(e,r,a,i,bn);if(!h(o))return;let c=O.multiplyComponents(o,a,mn);c=O.normalize(c,c);let u=O.subtract(e,o,un),f=Math.atan2(c.y,c.x),l=Math.asin(c.z),s=z.sign(O.dot(u,e))*O.magnitude(u);return h(n)?(n.longitude=f,n.latitude=l,n.height=s,n):new R(f,l,s)},R.toCartesian=function(e,t,n){return c.defined("cartographic",e),O.fromRadians(e.longitude,e.latitude,e.height,t,n)},R.clone=function(e,t){if(h(e))return h(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new R(e.longitude,e.latitude,e.height)},R.equals=function(e,t){return e===t||h(e)&&h(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},R.equalsEpsilon=function(e,t,n){return n=u(n,0),e===t||h(e)&&h(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n},R.ZERO=Object.freeze(new R(0,0,0)),R.prototype.clone=function(e){return R.clone(this,e)},R.prototype.equals=function(e){return R.equals(this,e)},R.prototype.equalsEpsilon=function(e,t){return R.equalsEpsilon(this,e,t)},R.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};var on=R;function tn(e,t,n,r){t=u(t,0),n=u(n,0),r=u(r,0),c.typeOf.number.greaterThanOrEquals("x",t,0),c.typeOf.number.greaterThanOrEquals("y",n,0),c.typeOf.number.greaterThanOrEquals("z",r,0),e._radii=new O(t,n,r),e._radiiSquared=new O(t*t,n*n,r*r),e._radiiToTheFourth=new O(t*t*t*t,n*n*n*n,r*r*r*r),e._oneOverRadii=new O(0===t?0:1/t,0===n?0:1/n,0===r?0:1/r),e._oneOverRadiiSquared=new O(0===t?0:1/(t*t),0===n?0:1/(n*n),0===r?0:1/(r*r)),e._minimumRadius=Math.min(t,n,r),e._maximumRadius=Math.max(t,n,r),e._centerToleranceSquared=z.EPSILON1,0!==e._radiiSquared.z&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function w(e,t,n){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,e,t,n)}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(e,t){if(!h(e))return;let n=e._radii;return h(t)?(O.clone(n,t._radii),O.clone(e._radiiSquared,t._radiiSquared),O.clone(e._radiiToTheFourth,t._radiiToTheFourth),O.clone(e._oneOverRadii,t._oneOverRadii),O.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new w(n.x,n.y,n.z)},w.fromCartesian3=function(e,t){return h(t)||(t=new w),h(e)&&tn(t,e.x,e.y,e.z),t},w.WGS84=Object.freeze(new w(6378137,6378137,6356752.314245179)),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(e){return w.clone(this,e)},w.packedLength=O.packedLength,w.pack=function(e,t,n){return c.typeOf.object("value",e),c.defined("array",t),n=u(n,0),O.pack(e._radii,t,n),t},w.unpack=function(e,t,n){c.defined("array",e),t=u(t,0);let r=O.unpack(e,t);return w.fromCartesian3(r,n)},w.prototype.geocentricSurfaceNormal=O.normalize,w.prototype.geodeticSurfaceNormalCartographic=function(e,t){c.typeOf.object("cartographic",e);let n=e.longitude,r=e.latitude,a=Math.cos(r),i=a*Math.cos(n),o=a*Math.sin(n),u=Math.sin(r);return h(t)||(t=new O),t.x=i,t.y=o,t.z=u,O.normalize(t,t)},w.prototype.geodeticSurfaceNormal=function(e,t){if(!O.equalsEpsilon(e,O.ZERO,z.EPSILON14))return h(t)||(t=new O),t=O.multiplyComponents(e,this._oneOverRadiiSquared,t),O.normalize(t,t)};var Sn=new O,Mn=new O;w.prototype.cartographicToCartesian=function(e,t){let n=Sn,r=Mn;this.geodeticSurfaceNormalCartographic(e,n),O.multiplyComponents(this._radiiSquared,n,r);let a=Math.sqrt(O.dot(n,r));return O.divideByScalar(r,a,r),O.multiplyByScalar(n,e.height,n),h(t)||(t=new O),O.add(r,n,t)},w.prototype.cartographicArrayToCartesianArray=function(e,t){c.defined("cartographics",e);let n=e.length;h(t)?t.length=n:t=new Array(n);for(let r=0;r<n;r++)t[r]=this.cartographicToCartesian(e[r],t[r]);return t};var Rn=new O,rn=new O,qn=new O;w.prototype.cartesianToCartographic=function(e,t){let n=this.scaleToGeodeticSurface(e,rn);if(!h(n))return;let r=this.geodeticSurfaceNormal(n,Rn),a=O.subtract(e,n,qn),i=Math.atan2(r.y,r.x),o=Math.asin(r.z),c=z.sign(O.dot(a,e))*O.magnitude(a);return h(t)?(t.longitude=i,t.latitude=o,t.height=c,t):new on(i,o,c)},w.prototype.cartesianArrayToCartographicArray=function(e,t){c.defined("cartesians",e);let n=e.length;h(t)?t.length=n:t=new Array(n);for(let r=0;r<n;++r)t[r]=this.cartesianToCartographic(e[r],t[r]);return t},w.prototype.scaleToGeodeticSurface=function(e,t){return X(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},w.prototype.scaleToGeocentricSurface=function(e,t){c.typeOf.object("cartesian",e),h(t)||(t=new O);let n=e.x,r=e.y,a=e.z,i=this._oneOverRadiiSquared,o=1/Math.sqrt(n*n*i.x+r*r*i.y+a*a*i.z);return O.multiplyByScalar(e,o,t)},w.prototype.transformPositionToScaledSpace=function(e,t){return h(t)||(t=new O),O.multiplyComponents(e,this._oneOverRadii,t)},w.prototype.transformPositionFromScaledSpace=function(e,t){return h(t)||(t=new O),O.multiplyComponents(e,this._radii,t)},w.prototype.equals=function(e){return this===e||h(e)&&O.equals(this._radii,e._radii)},w.prototype.toString=function(){return this._radii.toString()},w.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,t,n){if(c.typeOf.object("position",e),!z.equalsEpsilon(this._radii.x,this._radii.y,z.EPSILON15))throw new r("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");c.typeOf.number.greaterThan("Ellipsoid.radii.z",this._radii.z,0),t=u(t,0);let a=this._squaredXOverSquaredZ;if(h(n)||(n=new O),n.x=0,n.y=0,n.z=e.z*(1-a),!(Math.abs(n.z)>=this._radii.z-t))return n};var Tn=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],gn=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function en(e,t,n){c.typeOf.number("a",e),c.typeOf.number("b",t),c.typeOf.func("func",n);let r=.5*(t+e),a=.5*(t-e),i=0;for(let o=0;o<5;o++){let e=a*Tn[o];i+=gn[o]*(n(r+e)+n(r-e))}return i*=a,i}w.prototype.surfaceArea=function(e){c.typeOf.object("rectangle",e);let t=e.west,n=e.east,r=e.south,a=e.north;for(;n<t;)n+=z.TWO_PI;let i=this._radiiSquared,o=i.x,u=i.y,f=i.z,l=o*u;return en(r,a,(function(e){let r=Math.cos(e),a=Math.sin(e);return Math.cos(e)*en(t,n,(function(e){let t=Math.cos(e),n=Math.sin(e);return Math.sqrt(l*a*a+f*(u*t*t+o*n*n)*r*r)}))}))};var fo=w;function p(e,t,n,r,a,i,o,c,f){this[0]=u(e,0),this[1]=u(r,0),this[2]=u(o,0),this[3]=u(t,0),this[4]=u(a,0),this[5]=u(c,0),this[6]=u(n,0),this[7]=u(i,0),this[8]=u(f,0)}p.packedLength=9,p.pack=function(e,t,n){return c.typeOf.object("value",e),c.defined("array",t),n=u(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t},p.unpack=function(e,t,n){return c.defined("array",e),t=u(t,0),h(n)||(n=new p),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n},p.packArray=function(e,t){c.defined("array",e);let n=e.length,a=9*n;if(h(t)){if(!Array.isArray(t)&&t.length!==a)throw new r("If result is a typed array, it must have exactly array.length * 9 elements");t.length!==a&&(t.length=a)}else t=new Array(a);for(let r=0;r<n;++r)p.pack(e[r],t,9*r);return t},p.unpackArray=function(e,t){if(c.defined("array",e),c.typeOf.number.greaterThanOrEquals("array.length",e.length,9),e.length%9!==0)throw new r("array length must be a multiple of 9.");let n=e.length;h(t)?t.length=n/9:t=new Array(n/9);for(let r=0;r<n;r+=9){let n=r/9;t[n]=p.unpack(e,r,t[n])}return t},p.clone=function(e,t){if(h(e))return h(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new p(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},p.fromArray=p.unpack,p.fromColumnMajorArray=function(e,t){return c.defined("values",e),p.clone(e,t)},p.fromRowMajorArray=function(e,t){return c.defined("values",e),h(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new p(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},p.fromQuaternion=function(e,t){c.typeOf.object("quaternion",e);let n=e.x*e.x,r=e.x*e.y,a=e.x*e.z,i=e.x*e.w,o=e.y*e.y,u=e.y*e.z,f=e.y*e.w,l=e.z*e.z,s=e.z*e.w,y=e.w*e.w,d=n-o-l+y,O=2*(r-s),m=2*(a+f),b=2*(r+s),g=-n+o-l+y,x=2*(u-i),w=2*(a-f),z=2*(u+i),j=-n-o+l+y;return h(t)?(t[0]=d,t[1]=b,t[2]=w,t[3]=O,t[4]=g,t[5]=z,t[6]=m,t[7]=x,t[8]=j,t):new p(d,O,m,b,g,x,w,z,j)},p.fromHeadingPitchRoll=function(e,t){c.typeOf.object("headingPitchRoll",e);let n=Math.cos(-e.pitch),r=Math.cos(-e.heading),a=Math.cos(e.roll),i=Math.sin(-e.pitch),o=Math.sin(-e.heading),u=Math.sin(e.roll),f=n*r,l=-a*o+u*i*r,s=u*o+a*i*r,y=n*o,d=a*r+u*i*o,O=-u*r+a*i*o,m=-i,b=u*n,g=a*n;return h(t)?(t[0]=f,t[1]=y,t[2]=m,t[3]=l,t[4]=d,t[5]=b,t[6]=s,t[7]=O,t[8]=g,t):new p(f,l,s,y,d,O,m,b,g)},p.fromScale=function(e,t){return c.typeOf.object("scale",e),h(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new p(e.x,0,0,0,e.y,0,0,0,e.z)},p.fromUniformScale=function(e,t){return c.typeOf.number("scale",e),h(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new p(e,0,0,0,e,0,0,0,e)},p.fromCrossProduct=function(e,t){return c.typeOf.object("vector",e),h(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new p(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},p.fromRotationX=function(e,t){c.typeOf.number("angle",e);let n=Math.cos(e),r=Math.sin(e);return h(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=r,t[6]=0,t[7]=-r,t[8]=n,t):new p(1,0,0,0,n,-r,0,r,n)},p.fromRotationY=function(e,t){c.typeOf.number("angle",e);let n=Math.cos(e),r=Math.sin(e);return h(t)?(t[0]=n,t[1]=0,t[2]=-r,t[3]=0,t[4]=1,t[5]=0,t[6]=r,t[7]=0,t[8]=n,t):new p(n,0,r,0,1,0,-r,0,n)},p.fromRotationZ=function(e,t){c.typeOf.number("angle",e);let n=Math.cos(e),r=Math.sin(e);return h(t)?(t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new p(n,-r,0,r,n,0,0,0,1)},p.toArray=function(e,t){return c.typeOf.object("matrix",e),h(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},p.getElementIndex=function(e,t){return c.typeOf.number.greaterThanOrEquals("row",t,0),c.typeOf.number.lessThanOrEquals("row",t,2),c.typeOf.number.greaterThanOrEquals("column",e,0),c.typeOf.number.lessThanOrEquals("column",e,2),3*e+t},p.getColumn=function(e,t,n){c.typeOf.object("matrix",e),c.typeOf.number.greaterThanOrEquals("index",t,0),c.typeOf.number.lessThanOrEquals("index",t,2),c.typeOf.object("result",n);let r=3*t,a=e[r],i=e[r+1],o=e[r+2];return n.x=a,n.y=i,n.z=o,n},p.setColumn=function(e,t,n,r){c.typeOf.object("matrix",e),c.typeOf.number.greaterThanOrEquals("index",t,0),c.typeOf.number.lessThanOrEquals("index",t,2),c.typeOf.object("cartesian",n),c.typeOf.object("result",r),r=p.clone(e,r);let a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},p.getRow=function(e,t,n){c.typeOf.object("matrix",e),c.typeOf.number.greaterThanOrEquals("index",t,0),c.typeOf.number.lessThanOrEquals("index",t,2),c.typeOf.object("result",n);let r=e[t],a=e[t+3],i=e[t+6];return n.x=r,n.y=a,n.z=i,n},p.setRow=function(e,t,n,r){return c.typeOf.object("matrix",e),c.typeOf.number.greaterThanOrEquals("index",t,0),c.typeOf.number.lessThanOrEquals("index",t,2),c.typeOf.object("cartesian",n),c.typeOf.object("result",r),r=p.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var _n=new O;p.setScale=function(e,t,n){c.typeOf.object("matrix",e),c.typeOf.object("scale",t),c.typeOf.object("result",n);let r=p.getScale(e,_n),a=t.x/r.x,i=t.y/r.y,o=t.z/r.z;return n[0]=e[0]*a,n[1]=e[1]*a,n[2]=e[2]*a,n[3]=e[3]*i,n[4]=e[4]*i,n[5]=e[5]*i,n[6]=e[6]*o,n[7]=e[7]*o,n[8]=e[8]*o,n};var En=new O;p.setUniformScale=function(e,t,n){c.typeOf.object("matrix",e),c.typeOf.number("scale",t),c.typeOf.object("result",n);let r=p.getScale(e,En),a=t/r.x,i=t/r.y,o=t/r.z;return n[0]=e[0]*a,n[1]=e[1]*a,n[2]=e[2]*a,n[3]=e[3]*i,n[4]=e[4]*i,n[5]=e[5]*i,n[6]=e[6]*o,n[7]=e[7]*o,n[8]=e[8]*o,n};var v=new O;p.getScale=function(e,t){return c.typeOf.object("matrix",e),c.typeOf.object("result",t),t.x=O.magnitude(O.fromElements(e[0],e[1],e[2],v)),t.y=O.magnitude(O.fromElements(e[3],e[4],e[5],v)),t.z=O.magnitude(O.fromElements(e[6],e[7],e[8],v)),t};var cn=new O;p.getMaximumScale=function(e){return p.getScale(e,cn),O.maximumComponent(cn)};var Cn=new O;p.setRotation=function(e,t,n){c.typeOf.object("matrix",e),c.typeOf.object("result",n);let r=p.getScale(e,Cn);return n[0]=t[0]*r.x,n[1]=t[1]*r.x,n[2]=t[2]*r.x,n[3]=t[3]*r.y,n[4]=t[4]*r.y,n[5]=t[5]*r.y,n[6]=t[6]*r.z,n[7]=t[7]*r.z,n[8]=t[8]*r.z,n};var sn=new O;function Nn(e){let t=0;for(let n=0;n<9;++n){let r=e[n];t+=r*r}return Math.sqrt(t)}p.getRotation=function(e,t){c.typeOf.object("matrix",e),c.typeOf.object("result",t);let n=p.getScale(e,sn);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[3]/n.y,t[4]=e[4]/n.y,t[5]=e[5]/n.y,t[6]=e[6]/n.z,t[7]=e[7]/n.z,t[8]=e[8]/n.z,t},p.multiply=function(e,t,n){c.typeOf.object("left",e),c.typeOf.object("right",t),c.typeOf.object("result",n);let r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],f=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],l=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],s=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],p=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=f,n[6]=l,n[7]=s,n[8]=p,n},p.add=function(e,t,n){return c.typeOf.object("left",e),c.typeOf.object("right",t),c.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},p.subtract=function(e,t,n){return c.typeOf.object("left",e),c.typeOf.object("right",t),c.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},p.multiplyByVector=function(e,t,n){c.typeOf.object("matrix",e),c.typeOf.object("cartesian",t),c.typeOf.object("result",n);let r=t.x,a=t.y,i=t.z,o=e[0]*r+e[3]*a+e[6]*i,u=e[1]*r+e[4]*a+e[7]*i,f=e[2]*r+e[5]*a+e[8]*i;return n.x=o,n.y=u,n.z=f,n},p.multiplyByScalar=function(e,t,n){return c.typeOf.object("matrix",e),c.typeOf.number("scalar",t),c.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},p.multiplyByScale=function(e,t,n){return c.typeOf.object("matrix",e),c.typeOf.object("scale",t),c.typeOf.object("result",n),n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},p.multiplyByUniformScale=function(e,t,n){return c.typeOf.object("matrix",e),c.typeOf.number("scale",t),c.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},p.negate=function(e,t){return c.typeOf.object("matrix",e),c.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},p.transpose=function(e,t){c.typeOf.object("matrix",e),c.typeOf.object("result",t);let n=e[0],r=e[3],a=e[6],i=e[1],o=e[4],u=e[7],f=e[2],l=e[5],s=e[8];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=f,t[7]=l,t[8]=s,t};var V=[1,0,0],H=[2,2,1];function An(e){let t=0;for(let n=0;n<3;++n){let r=e[p.getElementIndex(H[n],V[n])];t+=2*r*r}return Math.sqrt(t)}function Ln(e,t){let n=z.EPSILON15,r=0,a=1;for(let f=0;f<3;++f){let t=Math.abs(e[p.getElementIndex(H[f],V[f])]);t>r&&(a=f,r=t)}let i=1,o=0,c=V[a],u=H[a];if(Math.abs(e[p.getElementIndex(u,c)])>n){let t,n=e[p.getElementIndex(u,u)],r=e[p.getElementIndex(c,c)],a=e[p.getElementIndex(u,c)],f=(n-r)/2/a;t=f<0?-1/(-f+Math.sqrt(1+f*f)):1/(f+Math.sqrt(1+f*f)),i=1/Math.sqrt(1+t*t),o=t*i}return t=p.clone(p.IDENTITY,t),t[p.getElementIndex(c,c)]=t[p.getElementIndex(u,u)]=i,t[p.getElementIndex(u,c)]=o,t[p.getElementIndex(c,u)]=-o,t}var Y=new p,fn=new p;p.computeEigenDecomposition=function(e,t){c.typeOf.object("matrix",e);let n=z.EPSILON20,r=10,a=0,i=0;h(t)||(t={});let o=t.unitary=p.clone(p.IDENTITY,t.unitary),u=t.diagonal=p.clone(e,t.diagonal),f=n*Nn(u);for(;i<r&&An(u)>f;)Ln(u,Y),p.transpose(Y,fn),p.multiply(u,Y,u),p.multiply(fn,u,u),p.multiply(o,Y,o),++a>2&&(++i,a=0);return t},p.abs=function(e,t){return c.typeOf.object("matrix",e),c.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t},p.determinant=function(e){c.typeOf.object("matrix",e);let t=e[0],n=e[3],r=e[6],a=e[1],i=e[4],o=e[7],u=e[2],f=e[5],l=e[8];return t*(i*l-f*o)+a*(f*r-n*l)+u*(n*o-i*r)},p.inverse=function(e,t){c.typeOf.object("matrix",e),c.typeOf.object("result",t);let n=e[0],a=e[1],i=e[2],o=e[3],u=e[4],f=e[5],l=e[6],s=e[7],h=e[8],y=p.determinant(e);if(Math.abs(y)<=z.EPSILON15)throw new r("matrix is not invertible");t[0]=u*h-s*f,t[1]=s*i-a*h,t[2]=a*f-u*i,t[3]=l*f-o*h,t[4]=n*h-l*i,t[5]=o*i-n*f,t[6]=o*s-l*u,t[7]=l*a-n*s,t[8]=n*u-o*a;let d=1/y;return p.multiplyByScalar(t,d,t)};var kn=new p;p.inverseTranspose=function(e,t){return c.typeOf.object("matrix",e),c.typeOf.object("result",t),p.inverse(p.transpose(e,kn),t)},p.equals=function(e,t){return e===t||h(e)&&h(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},p.equalsEpsilon=function(e,t,n){return n=u(n,0),e===t||h(e)&&h(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},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(e){return p.clone(this,e)},p.prototype.equals=function(e){return p.equals(this,e)},p.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},p.prototype.equalsEpsilon=function(e,t){return p.equalsEpsilon(this,e,t)},p.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]})\n(${this[1]}, ${this[4]}, ${this[7]})\n(${this[2]}, ${this[5]}, ${this[8]})`};var uo=p;export{O as a,on as b,fo as c,uo as d};