bimland/public/Cesium/Workers/Cartographic-3309dd0d.js

2 lines
8.6 KiB
JavaScript
Raw Normal View History

2023-07-26 17:04:38 +08:00
define(["exports","./Check-7b2a090c","./when-b60132fc","./Math-119be1a3"],(function(e,n,t,a){"use strict";function i(e,n,a){this.x=t.defaultValue(e,0),this.y=t.defaultValue(n,0),this.z=t.defaultValue(a,0)}i.fromSpherical=function(e,n){t.defined(n)||(n=new i);var a=e.clock,r=e.cone,u=t.defaultValue(e.magnitude,1),o=u*Math.sin(r);return n.x=o*Math.cos(a),n.y=o*Math.sin(a),n.z=u*Math.cos(r),n},i.fromElements=function(e,n,a,r){return t.defined(r)?(r.x=e,r.y=n,r.z=a,r):new i(e,n,a)},i.clone=function(e,n){if(t.defined(e))return t.defined(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n):new i(e.x,e.y,e.z)},i.fromCartesian4=i.clone,i.packedLength=3,i.pack=function(e,n,a){return a=t.defaultValue(a,0),n[a++]=e.x,n[a++]=e.y,n[a]=e.z,n},i.unpack=function(e,n,a){return n=t.defaultValue(n,0),t.defined(a)||(a=new i),a.x=e[n++],a.y=e[n++],a.z=e[n],a},i.packArray=function(e,n){var a=e.length;t.defined(n)?n.length=3*a:n=new Array(3*a);for(var r=0;r<a;++r)i.pack(e[r],n,3*r);return n},i.unpackArray=function(e,n){var a=e.length;t.defined(n)?n.length=a/3:n=new Array(a/3);for(var r=0;r<a;r+=3){var u=r/3;n[u]=i.unpack(e,r,n[u])}return n},i.fromArray=i.unpack,i.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},i.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},i.minimumByComponent=function(e,n,t){return t.x=Math.min(e.x,n.x),t.y=Math.min(e.y,n.y),t.z=Math.min(e.z,n.z),t},i.maximumByComponent=function(e,n,t){return t.x=Math.max(e.x,n.x),t.y=Math.max(e.y,n.y),t.z=Math.max(e.z,n.z),t},i.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},i.magnitude=function(e){return Math.sqrt(i.magnitudeSquared(e))};var r=new i;i.distance=function(e,n){return i.subtract(e,n,r),i.magnitude(r)},i.distanceSquared=function(e,n){return i.subtract(e,n,r),i.magnitudeSquared(r)},i.normalize=function(e,n){var t=i.magnitude(e);return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},i.dot=function(e,n){return e.x*n.x+e.y*n.y+e.z*n.z},i.multiplyComponents=function(e,n,t){return t.x=e.x*n.x,t.y=e.y*n.y,t.z=e.z*n.z,t},i.divideComponents=function(e,n,t){return t.x=e.x/n.x,t.y=e.y/n.y,t.z=e.z/n.z,t},i.add=function(e,n,t){return t.x=e.x+n.x,t.y=e.y+n.y,t.z=e.z+n.z,t},i.subtract=function(e,n,t){return t.x=e.x-n.x,t.y=e.y-n.y,t.z=e.z-n.z,t},i.multiplyByScalar=function(e,n,t){return t.x=e.x*n,t.y=e.y*n,t.z=e.z*n,t},i.divideByScalar=function(e,n,t){return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},i.negate=function(e,n){return n.x=-e.x,n.y=-e.y,n.z=-e.z,n},i.abs=function(e,n){return n.x=Math.abs(e.x),n.y=Math.abs(e.y),n.z=Math.abs(e.z),n};var u=new i;i.lerp=function(e,n,t,a){return i.multiplyByScalar(n,t,u),a=i.multiplyByScalar(e,1-t,a),i.add(u,a,a)};var o=new i,d=new i;i.angleBetween=function(e,n){i.normalize(e,o),i.normalize(n,d);var t=i.dot(o,d),a=i.magnitude(i.cross(o,d,o));return Math.atan2(a,t)};var s=new i;i.mostOrthogonalAxis=function(e,n){var t=i.normalize(e,s);return i.abs(t,t),n=t.x<=t.y?t.x<=t.z?i.clone(i.UNIT_X,n):i.clone(i.UNIT_Z,n):t.y<=t.z?i.clone(i.UNIT_Y,n):i.clone(i.UNIT_Z,n)},i.projectVector=function(e,n,t){var a=i.dot(e,n)/i.dot(n,n);return i.multiplyByScalar(n,a,t)},i.equals=function(e,n){return e===n||t.defined(e)&&t.defined(n)&&e.x===n.x&&e.y===n.y&&e.z===n.z},i.equalsArray=function(e,n,t){return e.x===n[t]&&e.y===n[t+1]&&e.z===n[t+2]},i.equalsEpsilon=function(e,n,i,r){return e===n||t.defined(e)&&t.defined(n)&&a.CesiumMath.equalsEpsilon(e.x,n.x,i,r)&&a.CesiumMath.equalsEpsilon(e.y,n.y,i,r)&&a.CesiumMath.equalsEpsilon(e.z,n.z,i,r)},i.cross=function(e,n,t){var a=e.x,i=e.y,r=e.z,u=n.x,o=n.y,d=n.z,s=i*d-r*o,f=r*u-a*d,l=a*o-i*u;return t.x=s,t.y=f,t.z=l,t},i.midpoint=function(e,n,t){return t.x=.5*(e.x+n.x),t.y=.5*(e.y+n.y),t.z=.5*(e.z+n.z),t},i.fromDegrees=function(e,n,t,r,u){return e=a.CesiumMath.toRadians(e),n=a.CesiumMath.toRadians(n),i.fromRadians(e,n,t,r,u)};var f=new i,l=new i,c=new i(40680631590769,40680631590769,40408299984661.445),h=new i(40680631590769,40680631590769,40680631590769);i.fromRadians=function(e,n,r,u,o){r=t.defaultValue(r,0);var d=t.defined(u)?u.radiiSquared:h;a.CesiumMath.equalsEpsilon(a.CesiumMath.Radius,6356752.314245179,a.CesiumMath.EPSILON10)&&(d=t.defi