2 lines
7.5 KiB
JavaScript
2 lines
7.5 KiB
JavaScript
|
/* 2020-9-22 15:23:25 | 版权所有 军懋国兴 */
|
||
|
define(["exports","./when-cbf8cd21","./Check-35e1a91d"],function(e,o,a){"use strict";function r(e){null==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)}r.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},r.prototype.genrand_int32=function(){var e,r,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){for(this.mti==this.N+1&&this.init_genrand(5489),r=0;r<this.N-this.M;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+this.M]^e>>>1^t[1&e];for(;r<this.N-1;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+(this.M-this.N)]^e>>>1^t[1&e];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[1&e],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,(e^=e>>>18)>>>0},r.prototype.random=function(){return this.genrand_int32()*(1/4294967296)};var u={EPSILON1:.1,EPSILON2:.01,EPSILON3:.001,EPSILON4:1e-4,EPSILON5:1e-5,EPSILON6:1e-6,EPSILON7:1e-7,EPSILON8:1e-8,EPSILON9:1e-9,EPSILON10:1e-10,EPSILON11:1e-11,EPSILON12:1e-12,EPSILON13:1e-13,EPSILON14:1e-14,EPSILON15:1e-15,EPSILON16:1e-16,EPSILON17:1e-17,EPSILON18:1e-18,EPSILON19:1e-19,EPSILON20:1e-20,EPSILON21:1e-21,GRAVITATIONALPARAMETER:3986004418e5,SOLAR_RADIUS:6955e5,LUNAR_RADIUS:1737400,SIXTY_FOUR_KILOBYTES:65536,FOUR_GIGABYTES:4294967296};u.sign=o.defaultValue(Math.sign,function(e){return 0===(e=+e)||e!=e?e:0<e?1:-1}),u.signNotZero=function(e){return e<0?-1:1},u.toSNorm=function(e,r){return r=o.defaultValue(r,255),Math.round((.5*u.clamp(e,-1,1)+.5)*r)},u.fromSNorm=function(e,r){return r=o.defaultValue(r,255),u.clamp(e,0,r)/r*2-1},u.normalize=function(e,r,t){return 0===(t=Math.max(t-r,0))?0:u.clamp((e-r)/t,0,1)},u.sinh=o.defaultValue(Math.sinh,function(e){return(Math.exp(e)-Math.exp(-e))/2}),u.cosh=o.defaultValue(Math.cosh,function(e){return(Math.exp(e)+Math.exp(-e))/2}),u.lerp=function(e,r,t){return(1-t)*e+t*r},u.PI=Math.PI,u.ONE_OVER_PI=1/Math.PI,u.PI_OVER_TWO=Math.PI/2,u.PI_OVER_THREE=Math.PI/3,u.PI_OVER_FOUR=Math.PI/4,u.PI_OVER_SIX=Math.PI/6,u.THREE_PI_OVER_TWO=3*Math.PI/2,u.TWO_PI=2*Math.PI,u.ONE_OVER_TWO_PI=1/(2*Math.PI),u.RADIANS_PER_DEGREE=Math.PI/180,u.DEGREES_PER_RADIAN=180/Math.PI,u.RADIANS_PER_ARCSECOND=u.RADIANS_PER_DEGREE/3600,u.toRadians=function(e){if(!o.defined(e))throw new a.DeveloperError("degrees is required.");return e*u.RADIANS_PER_DEGREE},u.toDegrees=function(e){if(!o.defined(e))throw new a.DeveloperError("radians is required.");return e*u.DEGREES_PER_RADIAN},u.convertLongitudeRange=function(e){if(!o.defined(e))throw new a.DeveloperError("angle is required.");var r=u.TWO_PI,t=e-Math.floor(e/r)*r;return t<-Math.PI?t+r:t>=Math.PI?t-r:t},u.clampToLatitudeRange=function(e){if(!o.defined(e))throw new a.DeveloperError("angle is required.");return u.clamp(e,-1*u.PI_OVER_TWO,u.PI_OVER_TWO)},u.negativePiToPi=function(e){if(!o.defined(e))throw new a.DeveloperError("angle is required.");return u.zeroToTwoPi(e+u.PI)-u.PI},u.zeroToTwoPi=function(e){if(!o.defined(e))throw new a.DeveloperError("angle is required.");var r=u.mod(e,u.TWO_PI);return Math.abs(r)<u.EPSILON14&&Math.abs(e)>u.EPSILON14?u.TWO_PI:r},u.mod=function(e,r){if(!o.defined(e))throw new a.DeveloperError("m is required.");if(!o.defined(r))throw new a.DeveloperError("n is required.");return(e%r+r)%r},u.equalsEpsilon=function(e,r,t,i){if(!o.defined(e))throw new a.DeveloperError("left is required.");if(!o.defined(r))throw new a.DeveloperError("right is required.");t=o.defaultValue(t,0),i=o.defaultValue(i,t);var n=Math.abs(e-r);return n<=i||n<=t*Math.max(Math.abs(e),Math.abs(r))},u.lessThan=function(e,r,t){if(!o.defined(e))throw new a.DeveloperError("first is required.");if(!o.defined(r))throw new a.DeveloperError("second is
|