29 lines
29 KiB
Java
29 lines
29 KiB
Java
![]() |
/**
|
||
|
* @license
|
||
|
* Cesium - https://github.com/CesiumGS/cesium
|
||
|
* Version 1.109
|
||
|
*
|
||
|
* 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-LI57NJAL.js";import{a as u}from"./chunk-P44SUSQU.js";import{a as r,b as c}from"./chunk-FUATUYJ3.js";import{e as h}from"./chunk-ODUTJJQ5.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),h(o)||(o=new f);let e=n.clock,t=n.cone,i=u(n.magnitude,1),y=i*Math.sin(t);return o.x=y*Math.cos(e),o.y=y*Math.sin(e),o.z=i*Math.cos(t),o};f.fromElements=function(n,o,e,t){return h(t)?(t.x=n,t.y=o,t.z=e,t):new f(n,o,e)};f.clone=function(n,o){if(h(n))return h(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),h(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(!h(o))o=new Array(t);else{if(!Array.isArray(o)&&o.length!==t)throw new r("If result is a typed array, it must have exactly array.length * 3 elements");o.length!==t&&(o.length=t)}for(let i=0;i<e;++i)f.pack(n[i],o,i*3);return o};f.unpackArray=function(n,o){if(c.defined("array",n),c.typeOf.number.greaterThanOrEquals("array.length",n.length,3),n.length%3!==0)throw new r("array length must be a multiple of 3.");let e=n.length;h(o)?o.length=e/3:o=new Array(e/3);for(let t=0;t<e;t+=3){let i=t/3;o[i]=f.unpack(n,t,o[i])}return o};f.fromArray=f.unpack;f.maximumComponent=function(n){return c.typeOf.object("cartesian",n),Math.max(n.x,n.y,n.z)};f.minimumComponent=function(n){return c.typeOf.object("cartesian",n),Math.min(n.x,n.y,n.z)};f.minimumByComponent=function(n,o,e){return c.typeOf.object("first",n),c.typeOf.object("second",o),c.typeOf.object("result",e),e.x=Math.min(n.x,o.x),e.y=Math.min(n.y,o.y),e.z=Math.min(n.z,o.z),e};f.maximumByComponent=function(n,o,e){return c.typeOf.object("first",n),c.typeOf.object("second",o),c.typeOf.object("result",e),e.x=Math.max(n.x,o.x),e.y=Math.max(n.y,o.y),e.z=Math.max(n.z,o.z),e};f.clamp=function(n,o,e,t){c.typeOf.object("value",n),c.typeOf.object("min",o),c.typeOf.object("max",e),c.typeOf.object("result",t);let i=z.clamp(n.x,o.x,e.x),y=z.clamp(n.y,o.y,e.y),d=z.clamp(n.z,o.z,e.z);return t.x=i,t.y=y,t.z=d,t};f.magnitudeSquared=function(n){return c.typeOf.object("cartesian",n),n.x*n.x+n.y*n.y+n.z*n.z};f.magnitude=function(n){return Math.sqrt(f.magnitudeSquared(n))};var P=new f;f.distance=function(n,o){return c.typeOf.object("left",n),c.typeOf.object("right",o),f.subtract(n,o,P),f.magnitude(P)};f.distanceSquared=function(n,o){return c.typeOf.object("left",n),c.typeOf.object("right",o),f.subtract(n,o,P),f.magnitudeSquared(P)};f.normalize=function(n,o){c.typeOf.object("cartesian",n),c.typeOf.object("result",o);let e=f.magnitude(n);if(o.x=n.x/e,o.y=n.y/e,o.z=n.z/e,isNaN(o.x)||isNaN(o.y)||isNaN(o.z))throw new r("normalized result is not a number");return o};f.dot=function(n,o){return c.typeOf.object("left",n),c.typeOf.object("right",o),n.x*o.x+n.y*o.y+n.z*o.z};f.multiplyComponents=function(n,o,e){return c.typeOf.object("left",n),c.typeOf.object("right",o),c.typeOf.object("result",e),e.x=n.x*o.x,e.y=n.y*o.y,e.z=n.z*o.z,e};f.divideComponents=function(n,o,e){return c.typeOf.object("left",n),c.typeOf.object("right",o),c.typeOf.object("result",e),e.x=n.x/o.x,e.y=n.y/o.y,e.z=n.z/o.z,e};f.add=function(n,o,e){return c.typeOf.object("left",n),c.typeOf.object("right",o),c.typeOf.object("result",e),e.x=n.x+o.x,e.y=n.y+o.y,e.z=n.z+o.z,e};f.subtract=function(n,o,e){return c.typeOf.object("left",n),c.typeOf.object("right",o),c.typeOf.object("result",e),e.x=n.x-o.x,e.y=n.y-o.y,e.z=n.z-o.z,e};f.multiplyByScalar=function(n,o,e){return c.typeOf.object("cartesian",n),c.typeOf.number("scalar",o),c.typeOf.object("result",e),e.x=n.x*o,e.y=n.y*o,e.z=n.z*o,e};f.divideByScalar=function(n,o,e){return c.typeOf.object("cartesian",n),c.typeOf.number("scalar",o),c.typeOf.object("result",e),e.x=n.x/o,e.y=n.y/o,e.z=n.z/o,e};f.negate=function(n,o){return c.typeOf.object("cartesian",n),c.typeOf.object("result"
|
||
|
(${this[1]}, ${this[4]}, ${this[7]})
|
||
|
(${this[2]}, ${this[5]}, ${this[8]})`};var uo=p;export{O as a,on as b,fo as c,uo as d};
|