1 |
- define(["exports","./RuntimeError-346a3079","./when-4bbc8319","./ComponentDatatype-93750d1a"],function(e,P,b,k){"use strict";function S(e,t,n){this.x=b.defaultValue(e,0),this.y=b.defaultValue(t,0),this.z=b.defaultValue(n,0)}S.fromSpherical=function(e,t){b.defined(t)||(t=new S);var n=e.clock,r=e.cone,a=b.defaultValue(e.magnitude,1),e=a*Math.sin(r);return t.x=e*Math.cos(n),t.y=e*Math.sin(n),t.z=a*Math.cos(r),t},S.fromElements=function(e,t,n,r){return b.defined(r)?(r.x=e,r.y=t,r.z=n,r):new S(e,t,n)},S.fromCartesian4=S.clone=function(e,t){if(b.defined(e))return b.defined(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new S(e.x,e.y,e.z)},S.packedLength=3,S.pack=function(e,t,n){return n=b.defaultValue(n,0),t[n++]=e.x,t[n++]=e.y,t[n]=e.z,t},S.unpack=function(e,t,n){return t=b.defaultValue(t,0),(n=!b.defined(n)?new S:n).x=e[t++],n.y=e[t++],n.z=e[t],n},S.packArray=function(e,t){var n=e.length,r=3*n;if(b.defined(t)){if(!Array.isArray(t)&&t.length!==r)throw new P.DeveloperError("If result is a typed array, it must have exactly array.length * 3 elements");t.length!==r&&(t.length=r)}else t=new Array(r);for(var a=0;a<n;++a)S.pack(e[a],t,3*a);return t},S.unpackArray=function(e,t){var n=e.length;b.defined(t)?t.length=n/3:t=new Array(n/3);for(var r=0;r<n;r+=3){var a=r/3;t[a]=S.unpack(e,r,t[a])}return t},S.fromArray=S.unpack,S.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},S.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},S.minimumByComponent=function(e,t,n){return 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},S.maximumByComponent=function(e,t,n){return 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},S.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},S.magnitude=function(e){return Math.sqrt(S.magnitudeSquared(e))};var n=new S;S.distance=function(e,t){return S.subtract(e,t,n),S.magnitude(n)},S.distanceSquared=function(e,t){return S.subtract(e,t,n),S.magnitudeSquared(n)},S.normalize=function(e,t){var n=S.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},S.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},S.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},S.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},S.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},S.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},S.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},S.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},S.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},S.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var a=new S;S.lerp=function(e,t,n,r){return S.multiplyByScalar(t,n,a),r=S.multiplyByScalar(e,1-n,r),S.add(a,r,r)};var r=new S,i=new S;S.angleBetween=function(e,t){S.normalize(e,r),S.normalize(t,i);e=S.dot(r,i),t=S.magnitude(S.cross(r,i,r));return Math.atan2(t,e)};var u=new S;S.mostOrthogonalAxis=function(e,t){e=S.normalize(e,u);return S.abs(e,e),t=e.x<=e.y?e.x<=e.z?S.clone(S.UNIT_X,t):S.clone(S.UNIT_Z,t):e.y<=e.z?S.clone(S.UNIT_Y,t):S.clone(S.UNIT_Z,t)},S.projectVector=function(e,t,n){e=S.dot(e,t)/S.dot(t,t);return S.multiplyByScalar(t,e,n)},S.equals=function(e,t){return e===t||b.defined(e)&&b.defined(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},S.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},S.equalsEpsilon=function(e,t,n,r){return e===t||b.defined(e)&&b.defined(t)&&k.CesiumMath.equalsEpsilon(e.x,t.x,n,r)&&k.CesiumMath.equalsEpsilon(e.y,t.y,n,r)&&k.CesiumMath.equalsEpsilon(e.z,t.z,n,r)},S.cross=function(e,t,n){var r=e.x,a=e.y,i=e.z,u=t.x,o=t.y,e=t.z,t=i*u-r*e,u=r*o-a*u;return n.x=a*e-i*o,n.y=t,n.z=u,n},S.midpoint=function(e,t,n){return n.x=.5*(e.x+t.x),n.y=.5*(e.y+t.y),n.z=.5*(e.z+t.z),n},S.fromDegrees=function(e,t,n,r,a){return e=k.CesiumMath.toRadians(e),t=k.CesiumMath.toRadians(t),S.fromRadians(e,t,n,r,a)};var o=new S,s=new S,f=new S(40680631590769,40680631590769,40408299984661.445);S.fromRadians=function(e,t,n,r,a){n=b.defaultValue(n,0);var i=b.defined(r)?r.radiiSquared:f,r=Math.cos(t);o.x=r*Math.cos(e),o.y=r*Math.sin(e),o.z=Math.sin(t),o=S.normalize(o,o),S.multiplyComponents(i,o,s);i=Math.sqrt(S.dot(o,s));return s=S.divideByScalar(s,i,s),o=S.multiplyByScalar(o,n,o),b.defined(a)||(a=new S),S.add(s,o,a)},S.fromDegreesArray=function(e,t,n){var r=e.length;b.defined(n)?n.length=r/2:n=new Array(r/2);for(var a=0;a<r;a+=2){var i=e[a],u=e[a+1],o=a/2;n[o]=S.fromDegrees(i,u,0,t,n[o])}return n},S.fromRadiansArray=function(e,t,n){var r=e.length;b.defined(n)?n.length=r/2:n=new Array(r/2);for(var a=0;a<r;a+=2){var i=e[a],u=e[a+1],o=a/2;n[o]=S.fromRadians(i,u,0,t,n[o])}return n},S.fromDegreesArrayHeights=function(e,t,n){var r=e.length;b.defined(n)?n.length=r/3:n=new Array(r/3);for(var a=0;a<r;a+=3){var i=e[a],u=e[a+1],o=e[a+2],s=a/3;n[s]=S.fromDegrees(i,u,o,t,n[s])}return n},S.fromRadiansArrayHeights=function(e,t,n){var r=e.length;b.defined(n)?n.length=r/3:n=new Array(r/3);for(var a=0;a<r;a+=3){var i=e[a],u=e[a+1],o=e[a+2],s=a/3;n[s]=S.fromRadians(i,u,o,t,n[s])}return n},S.ZERO=Object.freeze(new S(0,0,0)),S.ONE=Object.freeze(new S(1,1,1)),S.UNIT_X=Object.freeze(new S(1,0,0)),S.UNIT_Y=Object.freeze(new S(0,1,0)),S.UNIT_Z=Object.freeze(new S(0,0,1)),S.prototype.clone=function(e){return S.clone(this,e)},S.prototype.equals=function(e){return S.equals(this,e)},S.prototype.equalsEpsilon=function(e,t,n){return S.equalsEpsilon(this,e,t,n)},S.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"};var q=new S,_=new S;function l(e,t,n,r,a){var i=e.x,u=e.y,o=e.z,s=t.x,f=t.y,t=t.z,l=i*i*s*s,d=u*u*f*f,c=o*o*t*t,s=l+d+c,f=Math.sqrt(1/s),t=S.multiplyByScalar(e,f,q);if(s<r)return isFinite(f)?S.clone(t,a):void 0;var h=n.x,m=n.y,y=n.z,n=_;n.x=t.x*h*2,n.y=t.y*m*2,n.z=t.z*y*2;var p=(1-f)*S.magnitude(e)/(.5*S.magnitude(n)),x=0;do{var M,w,g,z,v,C,O,x=(O=l*(z=(M=1/(1+(p-=x)*h))*M)+d*(v=(w=1/(1+p*m))*w)+c*(C=(g=1/(1+p*y))*g)-1)/(-2*(l*(z*M)*h+d*(v*w)*m+c*(C*g)*y))}while(Math.abs(O)>k.CesiumMath.EPSILON12);return b.defined(a)?(a.x=i*M,a.y=u*w,a.z=o*g,a):new S(i*M,u*w,o*g)}function d(e,t,n){this.longitude=b.defaultValue(e,0),this.latitude=b.defaultValue(t,0),this.height=b.defaultValue(n,0)}d.fromRadians=function(e,t,n,r){return n=b.defaultValue(n,0),b.defined(r)?(r.longitude=e,r.latitude=t,r.height=n,r):new d(e,t,n)},d.fromDegrees=function(e,t,n,r){return e=k.CesiumMath.toRadians(e),t=k.CesiumMath.toRadians(t),d.fromRadians(e,t,n,r)};var c=new S,h=new S,m=new S,y=new S(1/6378137,1/6378137,1/6356752.314245179),p=new S(1/40680631590769,1/40680631590769,1/40408299984661.445),x=k.CesiumMath.EPSILON1;function M(e,t,n,r){t=b.defaultValue(t,0),n=b.defaultValue(n,0),r=b.defaultValue(r,0),e._radii=new S(t,n,r),e._radiiSquared=new S(t*t,n*n,r*r),e._radiiToTheFourth=new S(t*t*t*t,n*n*n*n,r*r*r*r),e._oneOverRadii=new S(0===t?0:1/t,0===n?0:1/n,0===r?0:1/r),e._oneOverRadiiSquared=new S(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=k.CesiumMath.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,M(this,e,t,n)}d.fromCartesian=function(e,t,n){var r=b.defined(t)?t.oneOverRadii:y,a=b.defined(t)?t.oneOverRadiiSquared:p,r=l(e,r,a,b.defined(t)?t._centerToleranceSquared:x,h);if(b.defined(r)){t=S.multiplyComponents(r,a,c),t=S.normalize(t,t),a=S.subtract(e,r,m),r=Math.atan2(t.y,t.x),t=Math.asin(t.z),a=k.CesiumMath.sign(S.dot(a,e))*S.magnitude(a);return b.defined(n)?(n.longitude=r,n.latitude=t,n.height=a,n):new d(r,t,a)}},d.toCartesian=function(e,t,n){return S.fromRadians(e.longitude,e.latitude,e.height,t,n)},d.clone=function(e,t){if(b.defined(e))return b.defined(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new d(e.longitude,e.latitude,e.height)},d.equals=function(e,t){return e===t||b.defined(e)&&b.defined(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},d.equalsEpsilon=function(e,t,n){return n=b.defaultValue(n,0),e===t||b.defined(e)&&b.defined(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n},d.ZERO=Object.freeze(new d(0,0,0)),d.prototype.clone=function(e){return d.clone(this,e)},d.prototype.equals=function(e){return d.equals(this,e)},d.prototype.equalsEpsilon=function(e,t){return d.equalsEpsilon(this,e,t)},d.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},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(b.defined(e)){var n=e._radii;return b.defined(t)?(S.clone(n,t._radii),S.clone(e._radiiSquared,t._radiiSquared),S.clone(e._radiiToTheFourth,t._radiiToTheFourth),S.clone(e._oneOverRadii,t._oneOverRadii),S.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 b.defined(t)||(t=new w),b.defined(e)&&M(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(k.CesiumMath.LUNAR_RADIUS,k.CesiumMath.LUNAR_RADIUS,k.CesiumMath.LUNAR_RADIUS)),w.prototype.clone=function(e){return w.clone(this,e)},w.packedLength=S.packedLength,w.pack=function(e,t,n){return n=b.defaultValue(n,0),S.pack(e._radii,t,n),t},w.unpack=function(e,t,n){t=b.defaultValue(t,0);t=S.unpack(e,t);return w.fromCartesian3(t,n)},w.prototype.geocentricSurfaceNormal=S.normalize,w.prototype.geodeticSurfaceNormalCartographic=function(e,t){var n=e.longitude,r=e.latitude,a=Math.cos(r),e=a*Math.cos(n),n=a*Math.sin(n),r=Math.sin(r);return(t=!b.defined(t)?new S:t).x=e,t.y=n,t.z=r,S.normalize(t,t)},w.prototype.geodeticSurfaceNormal=function(e,t){if(!S.equalsEpsilon(e,S.ZERO,k.CesiumMath.EPSILON14))return b.defined(t)||(t=new S),t=S.multiplyComponents(e,this._oneOverRadiiSquared,t),S.normalize(t,t)};var g=new S,z=new S;w.prototype.cartographicToCartesian=function(e,t){var n=g,r=z;this.geodeticSurfaceNormalCartographic(e,n),S.multiplyComponents(this._radiiSquared,n,r);var a=Math.sqrt(S.dot(n,r));return S.divideByScalar(r,a,r),S.multiplyByScalar(n,e.height,n),b.defined(t)||(t=new S),S.add(r,n,t)},w.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;b.defined(t)?t.length=n:t=new Array(n);for(var r=0;r<n;r++)t[r]=this.cartographicToCartesian(e[r],t[r]);return t};var v=new S,C=new S,O=new S;w.prototype.cartesianToCartographic=function(e,t){var n=this.scaleToGeodeticSurface(e,C);if(b.defined(n)){var r=this.geodeticSurfaceNormal(n,v),a=S.subtract(e,n,O),n=Math.atan2(r.y,r.x),r=Math.asin(r.z),a=k.CesiumMath.sign(S.dot(a,e))*S.magnitude(a);return b.defined(t)?(t.longitude=n,t.latitude=r,t.height=a,t):new d(n,r,a)}},w.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;b.defined(t)?t.length=n:t=new Array(n);for(var r=0;r<n;++r)t[r]=this.cartesianToCartographic(e[r],t[r]);return t},w.prototype.scaleToGeodeticSurface=function(e,t){return l(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},w.prototype.scaleToGeocentricSurface=function(e,t){b.defined(t)||(t=new S);var n=e.x,r=e.y,a=e.z,i=this._oneOverRadiiSquared,i=1/Math.sqrt(n*n*i.x+r*r*i.y+a*a*i.z);return S.multiplyByScalar(e,i,t)},w.prototype.transformPositionToScaledSpace=function(e,t){return b.defined(t)||(t=new S),S.multiplyComponents(e,this._oneOverRadii,t)},w.prototype.transformPositionFromScaledSpace=function(e,t){return b.defined(t)||(t=new S),S.multiplyComponents(e,this._radii,t)},w.prototype.equals=function(e){return this===e||b.defined(e)&&S.equals(this._radii,e._radii)},w.prototype.toString=function(){return this._radii.toString()},w.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,t,n){t=b.defaultValue(t,0);var r=this._squaredXOverSquaredZ;if((n=!b.defined(n)?new S:n).x=0,n.y=0,n.z=e.z*(1-r),!(Math.abs(n.z)>=this._radii.z-t))return n};var R=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],V=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function E(e,t,n){for(var r=.5*(t+e),a=.5*(t-e),i=0,u=0;u<5;u++){var o=a*R[u];i+=V[u]*(n(r+o)+n(r-o))}return i*=a}function B(e,t,n,r,a,i,u,o,s){this[0]=b.defaultValue(e,0),this[1]=b.defaultValue(r,0),this[2]=b.defaultValue(u,0),this[3]=b.defaultValue(t,0),this[4]=b.defaultValue(a,0),this[5]=b.defaultValue(o,0),this[6]=b.defaultValue(n,0),this[7]=b.defaultValue(i,0),this[8]=b.defaultValue(s,0)}w.prototype.surfaceArea=function(e){for(var t=e.west,a=e.east,n=e.south,r=e.north;a<t;)a+=k.CesiumMath.TWO_PI;var e=this._radiiSquared,i=e.x,u=e.y,o=e.z,s=i*u;return E(n,r,function(e){var n=Math.cos(e),r=Math.sin(e);return Math.cos(e)*E(t,a,function(e){var t=Math.cos(e),e=Math.sin(e);return Math.sqrt(s*r*r+o*(u*t*t+i*e*e)*n*n)})})},B.packedLength=9,B.pack=function(e,t,n){return n=b.defaultValue(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},B.unpack=function(e,t,n){return t=b.defaultValue(t,0),(n=!b.defined(n)?new B: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},B.clone=function(e,t){if(b.defined(e))return b.defined(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 B(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},B.fromArray=function(e,t,n){return t=b.defaultValue(t,0),(n=!b.defined(n)?new B:n)[0]=e[t],n[1]=e[t+1],n[2]=e[t+2],n[3]=e[t+3],n[4]=e[t+4],n[5]=e[t+5],n[6]=e[t+6],n[7]=e[t+7],n[8]=e[t+8],n},B.fromColumnMajorArray=function(e,t){return B.clone(e,t)},B.fromRowMajorArray=function(e,t){return b.defined(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 B(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},B.fromQuaternion=function(e,t){var n=e.x*e.x,r=e.x*e.y,a=e.x*e.z,i=e.x*e.w,u=e.y*e.y,o=e.y*e.z,s=e.y*e.w,f=e.z*e.z,l=e.z*e.w,d=e.w*e.w,c=n-u-f+d,h=2*(r-l),m=2*(a+s),e=2*(r+l),r=u-n-f+d,l=2*(o-i),s=2*(a-s),i=2*(o+i),d=-n-u+f+d;return b.defined(t)?(t[0]=c,t[1]=e,t[2]=s,t[3]=h,t[4]=r,t[5]=i,t[6]=m,t[7]=l,t[8]=d,t):new B(c,h,m,e,r,l,s,i,d)},B.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),r=Math.cos(-e.heading),a=Math.cos(e.roll),i=Math.sin(-e.pitch),u=Math.sin(-e.heading),o=Math.sin(e.roll),s=n*r,f=-a*u+o*i*r,l=o*u+a*i*r,d=n*u,e=a*r+o*i*u,u=-o*r+a*i*u,i=-i,o=o*n,n=a*n;return b.defined(t)?(t[0]=s,t[1]=d,t[2]=i,t[3]=f,t[4]=e,t[5]=o,t[6]=l,t[7]=u,t[8]=n,t):new B(s,f,l,d,e,u,i,o,n)},B.fromScale=function(e,t){return b.defined(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 B(e.x,0,0,0,e.y,0,0,0,e.z)},B.fromUniformScale=function(e,t){return b.defined(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 B(e,0,0,0,e,0,0,0,e)},B.fromCrossProduct=function(e,t){return b.defined(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 B(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},B.fromRotationX=function(e,t){var n=Math.cos(e),e=Math.sin(e);return b.defined(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=e,t[6]=0,t[7]=-e,t[8]=n,t):new B(1,0,0,0,n,-e,0,e,n)},B.fromRotationY=function(e,t){var n=Math.cos(e),e=Math.sin(e);return b.defined(t)?(t[0]=n,t[1]=0,t[2]=-e,t[3]=0,t[4]=1,t[5]=0,t[6]=e,t[7]=0,t[8]=n,t):new B(n,0,e,0,1,0,-e,0,n)},B.fromRotationZ=function(e,t){var n=Math.cos(e),e=Math.sin(e);return b.defined(t)?(t[0]=n,t[1]=e,t[2]=0,t[3]=-e,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new B(n,-e,0,e,n,0,0,0,1)},B.toArray=function(e,t){return b.defined(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]]},B.getElementIndex=function(e,t){return 3*e+t},B.getColumn=function(e,t,n){var r=3*t,a=e[r],t=e[1+r],r=e[2+r];return n.x=a,n.y=t,n.z=r,n},B.setColumn=function(e,t,n,r){t*=3;return(r=B.clone(e,r))[t]=n.x,r[1+t]=n.y,r[2+t]=n.z,r},B.getRow=function(e,t,n){var r=e[t],a=e[t+3],t=e[t+6];return n.x=r,n.y=a,n.z=t,n},B.setRow=function(e,t,n,r){return(r=B.clone(e,r))[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var T=new S;B.getScale=function(e,t){return t.x=S.magnitude(S.fromElements(e[0],e[1],e[2],T)),t.y=S.magnitude(S.fromElements(e[3],e[4],e[5],T)),t.z=S.magnitude(S.fromElements(e[6],e[7],e[8],T)),t};var A=new S;B.getMaximumScale=function(e){return B.getScale(e,A),S.maximumComponent(A)},B.multiply=function(e,t,n){var 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],u=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],o=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],f=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],l=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],t=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=a,n[2]=i,n[3]=u,n[4]=o,n[5]=s,n[6]=f,n[7]=l,n[8]=t,n},B.add=function(e,t,n){return 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},B.subtract=function(e,t,n){return 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},B.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,u=e[0]*r+e[3]*a+e[6]*i,t=e[1]*r+e[4]*a+e[7]*i,i=e[2]*r+e[5]*a+e[8]*i;return n.x=u,n.y=t,n.z=i,n},B.multiplyByScalar=function(e,t,n){return 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},B.multiplyByScale=function(e,t,n){return 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},B.negate=function(e,t){return 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},B.transpose=function(e,t){var n=e[0],r=e[3],a=e[6],i=e[1],u=e[4],o=e[7],s=e[2],f=e[5],e=e[8];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t[4]=u,t[5]=o,t[6]=s,t[7]=f,t[8]=e,t};var I=new S(1,1,1);B.getRotation=function(e,t){var n=S.divideComponents(I,B.getScale(e,A),A);return t=B.multiplyByScale(e,n,t)};var N=[1,0,0],U=[2,2,1];var L=new B,W=new B;B.computeEigenDecomposition=function(e,t){for(var n=k.CesiumMath.EPSILON20,r=0,a=0,i=(t=!b.defined(t)?{}:t).unitary=B.clone(B.IDENTITY,t.unitary),u=t.diagonal=B.clone(e,t.diagonal),o=n*function(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}(u);a<10&&function(e){for(var t=0,n=0;n<3;++n){var r=e[B.getElementIndex(U[n],N[n])];t+=2*r*r}return Math.sqrt(t)}(u)>o;)!function(e,t){for(var n=k.CesiumMath.EPSILON15,r=0,a=1,i=0;i<3;++i){var u=Math.abs(e[B.getElementIndex(U[i],N[i])]);r<u&&(a=i,r=u)}var o=1,s=0,f=N[a],l=U[a];Math.abs(e[B.getElementIndex(l,f)])>n&&(s=(n=(n=(e[B.getElementIndex(l,l)]-e[B.getElementIndex(f,f)])/2/e[B.getElementIndex(l,f)])<0?-1/(-n+Math.sqrt(1+n*n)):1/(n+Math.sqrt(1+n*n)))*(o=1/Math.sqrt(1+n*n))),(t=B.clone(B.IDENTITY,t))[B.getElementIndex(f,f)]=t[B.getElementIndex(l,l)]=o,t[B.getElementIndex(l,f)]=s,t[B.getElementIndex(f,l)]=-s}(u,L),B.transpose(L,W),B.multiply(u,L,u),B.multiply(W,u,u),B.multiply(i,L,i),2<++r&&(++a,r=0);return t},B.abs=function(e,t){return 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},B.determinant=function(e){var t=e[0],n=e[3],r=e[6],a=e[1],i=e[4],u=e[7],o=e[2],s=e[5],e=e[8];return t*(i*e-s*u)+a*(s*r-n*e)+o*(n*u-i*r)},B.inverse=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],u=e[4],o=e[5],s=e[6],f=e[7],l=e[8],e=B.determinant(e);return t[0]=u*l-f*o,t[1]=f*a-r*l,t[2]=r*o-u*a,t[3]=s*o-i*l,t[4]=n*l-s*a,t[5]=i*a-n*o,t[6]=i*f-s*u,t[7]=s*r-n*f,t[8]=n*u-i*r,B.multiplyByScalar(t,1/e,t)};var j=new B;function X(e,t,n,r){this.x=b.defaultValue(e,0),this.y=b.defaultValue(t,0),this.z=b.defaultValue(n,0),this.w=b.defaultValue(r,0)}B.inverseTranspose=function(e,t){return B.inverse(B.transpose(e,j),t)},B.equals=function(e,t){return e===t||b.defined(e)&&b.defined(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]},B.equalsEpsilon=function(e,t,n){return n=b.defaultValue(n,0),e===t||b.defined(e)&&b.defined(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},B.IDENTITY=Object.freeze(new B(1,0,0,0,1,0,0,0,1)),B.ZERO=Object.freeze(new B(0,0,0,0,0,0,0,0,0)),B.COLUMN0ROW0=0,B.COLUMN0ROW1=1,B.COLUMN0ROW2=2,B.COLUMN1ROW0=3,B.COLUMN1ROW1=4,B.COLUMN1ROW2=5,B.COLUMN2ROW0=6,B.COLUMN2ROW1=7,B.COLUMN2ROW2=8,Object.defineProperties(B.prototype,{length:{get:function(){return B.packedLength}}}),B.prototype.clone=function(e){return B.clone(this,e)},B.prototype.equals=function(e){return B.equals(this,e)},B.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]},B.prototype.equalsEpsilon=function(e,t){return B.equalsEpsilon(this,e,t)},B.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},X.fromElements=function(e,t,n,r,a){return b.defined(a)?(a.x=e,a.y=t,a.z=n,a.w=r,a):new X(e,t,n,r)},X.fromColor=function(e,t){return b.defined(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new X(e.red,e.green,e.blue,e.alpha)},X.clone=function(e,t){if(b.defined(e))return b.defined(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new X(e.x,e.y,e.z,e.w)},X.packedLength=4,X.pack=function(e,t,n){return n=b.defaultValue(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t},X.unpack=function(e,t,n){return t=b.defaultValue(t,0),(n=!b.defined(n)?new X:n).x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n},X.packArray=function(e,t){var n=e.length,r=4*n;if(b.defined(t)){if(!Array.isArray(t)&&t.length!==r)throw new P.DeveloperError("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==r&&(t.length=r)}else t=new Array(r);for(var a=0;a<n;++a)X.pack(e[a],t,4*a);return t},X.unpackArray=function(e,t){var n=e.length;b.defined(t)?t.length=n/4:t=new Array(n/4);for(var r=0;r<n;r+=4){var a=r/4;t[a]=X.unpack(e,r,t[a])}return t},X.fromArray=X.unpack,X.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},X.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},X.minimumByComponent=function(e,t,n){return 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.w=Math.min(e.w,t.w),n},X.maximumByComponent=function(e,t,n){return 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.w=Math.max(e.w,t.w),n},X.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},X.magnitude=function(e){return Math.sqrt(X.magnitudeSquared(e))};var D=new X;X.distance=function(e,t){return X.subtract(e,t,D),X.magnitude(D)},X.distanceSquared=function(e,t){return X.subtract(e,t,D),X.magnitudeSquared(D)},X.normalize=function(e,t){var n=X.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},X.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},X.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},X.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},X.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},X.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},X.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},X.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},X.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},X.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var Z=new X;X.lerp=function(e,t,n,r){return X.multiplyByScalar(t,n,Z),r=X.multiplyByScalar(e,1-n,r),X.add(Z,r,r)};var Y=new X;X.mostOrthogonalAxis=function(e,t){e=X.normalize(e,Y);return X.abs(e,e),t=e.x<=e.y?e.x<=e.z?e.x<=e.w?X.clone(X.UNIT_X,t):X.clone(X.UNIT_W,t):e.z<=e.w?X.clone(X.UNIT_Z,t):X.clone(X.UNIT_W,t):e.y<=e.z?e.y<=e.w?X.clone(X.UNIT_Y,t):X.clone(X.UNIT_W,t):e.z<=e.w?X.clone(X.UNIT_Z,t):X.clone(X.UNIT_W,t)},X.equals=function(e,t){return e===t||b.defined(e)&&b.defined(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},X.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},X.equalsEpsilon=function(e,t,n,r){return e===t||b.defined(e)&&b.defined(t)&&k.CesiumMath.equalsEpsilon(e.x,t.x,n,r)&&k.CesiumMath.equalsEpsilon(e.y,t.y,n,r)&&k.CesiumMath.equalsEpsilon(e.z,t.z,n,r)&&k.CesiumMath.equalsEpsilon(e.w,t.w,n,r)},X.ZERO=Object.freeze(new X(0,0,0,0)),X.ONE=Object.freeze(new X(1,1,1,1)),X.UNIT_X=Object.freeze(new X(1,0,0,0)),X.UNIT_Y=Object.freeze(new X(0,1,0,0)),X.UNIT_Z=Object.freeze(new X(0,0,1,0)),X.UNIT_W=Object.freeze(new X(0,0,0,1)),X.prototype.clone=function(e){return X.clone(this,e)},X.prototype.equals=function(e){return X.equals(this,e)},X.prototype.equalsEpsilon=function(e,t,n){return X.equalsEpsilon(this,e,t,n)},X.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"};var F=new Float32Array(1),G=new Uint8Array(F.buffer),t=new Uint32Array([287454020]),H=68===new Uint8Array(t.buffer)[0];function Q(e,t,n,r,a,i,u,o,s,f,l,d,c,h,m,y){this[0]=b.defaultValue(e,0),this[1]=b.defaultValue(a,0),this[2]=b.defaultValue(s,0),this[3]=b.defaultValue(c,0),this[4]=b.defaultValue(t,0),this[5]=b.defaultValue(i,0),this[6]=b.defaultValue(f,0),this[7]=b.defaultValue(h,0),this[8]=b.defaultValue(n,0),this[9]=b.defaultValue(u,0),this[10]=b.defaultValue(l,0),this[11]=b.defaultValue(m,0),this[12]=b.defaultValue(r,0),this[13]=b.defaultValue(o,0),this[14]=b.defaultValue(d,0),this[15]=b.defaultValue(y,0)}X.packFloat=function(e,t){return b.defined(t)||(t=new X),F[0]=e,H?(t.x=G[0],t.y=G[1],t.z=G[2],t.w=G[3]):(t.x=G[3],t.y=G[2],t.z=G[1],t.w=G[0]),t},X.unpackFloat=function(e){return H?(G[0]=e.x,G[1]=e.y,G[2]=e.z,G[3]=e.w):(G[0]=e.w,G[1]=e.z,G[2]=e.y,G[3]=e.x),F[0]},Q.packedLength=16,Q.pack=function(e,t,n){return n=b.defaultValue(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[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},Q.unpack=function(e,t,n){return t=b.defaultValue(t,0),(n=!b.defined(n)?new Q: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[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},Q.clone=function(e,t){if(b.defined(e))return b.defined(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[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new Q(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},Q.fromArray=Q.unpack,Q.fromColumnMajorArray=function(e,t){return Q.clone(e,t)},Q.fromRowMajorArray=function(e,t){return b.defined(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new Q(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},Q.fromRotationTranslation=function(e,t,n){return t=b.defaultValue(t,S.ZERO),b.defined(n)?(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=0,n[4]=e[3],n[5]=e[4],n[6]=e[5],n[7]=0,n[8]=e[6],n[9]=e[7],n[10]=e[8],n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,n):new Q(e[0],e[3],e[6],t.x,e[1],e[4],e[7],t.y,e[2],e[5],e[8],t.z,0,0,0,1)},Q.fromTranslationQuaternionRotationScale=function(e,t,n,r){b.defined(r)||(r=new Q);var a=n.x,i=n.y,u=n.z,o=t.x*t.x,s=t.x*t.y,f=t.x*t.z,l=t.x*t.w,d=t.y*t.y,c=t.y*t.z,h=t.y*t.w,m=t.z*t.z,y=t.z*t.w,p=t.w*t.w,x=2*(s-y),n=2*(f+h),t=2*(s+y),s=d-o-m+p,y=2*(c-l),h=2*(f-h),c=2*(c+l),l=-o-d+m+p;return r[0]=(o-d-m+p)*a,r[1]=t*a,r[2]=h*a,r[3]=0,r[4]=x*i,r[5]=s*i,r[6]=c*i,r[7]=0,r[8]=n*u,r[9]=y*u,r[10]=l*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},Q.fromTranslationRotationScale=function(e,t){return Q.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},Q.fromTranslation=function(e,t){return Q.fromRotationTranslation(B.IDENTITY,e,t)},Q.fromScale=function(e,t){return b.defined(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new Q(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},Q.fromUniformScale=function(e,t){return b.defined(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new Q(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var J=new S,K=new S,$=new S;Q.fromCamera=function(e,t){var n=e.position,r=e.direction,a=e.up;S.normalize(r,J),S.normalize(S.cross(J,a,K),K),S.normalize(S.cross(K,J,$),$);var i=K.x,u=K.y,o=K.z,s=J.x,f=J.y,l=J.z,d=$.x,c=$.y,h=$.z,m=n.x,e=n.y,r=n.z,a=i*-m+u*-e+o*-r,n=d*-m+c*-e+h*-r,r=s*m+f*e+l*r;return b.defined(t)?(t[0]=i,t[1]=d,t[2]=-s,t[3]=0,t[4]=u,t[5]=c,t[6]=-f,t[7]=0,t[8]=o,t[9]=h,t[10]=-l,t[11]=0,t[12]=a,t[13]=n,t[14]=r,t[15]=1,t):new Q(i,u,o,a,d,c,h,n,-s,-f,-l,r,0,0,0,1)},Q.computePerspectiveFieldOfView=function(e,t,n,r,a){var i=1/Math.tan(.5*e),e=(r+n)/(n-r),r=2*r*n/(n-r);return a[0]=i/t,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=i,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=e,a[11]=-1,a[12]=0,a[13]=0,a[14]=r,a[15]=0,a},Q.computeOrthographicOffCenter=function(e,t,n,r,a,i,u){var o=1/(t-e),s=1/(r-n),f=1/(i-a),e=-(t+e)*o,n=-(r+n)*s,a=-(i+a)*f;return s*=2,f*=-2,u[0]=o*=2,u[1]=0,u[2]=0,u[3]=0,u[4]=0,u[5]=s,u[6]=0,u[7]=0,u[8]=0,u[9]=0,u[10]=f,u[11]=0,u[12]=e,u[13]=n,u[14]=a,u[15]=1,u},Q.computePerspectiveOffCenter=function(e,t,n,r,a,i,u){var o=2*a/(r-n),s=(t+e)/(t-e),r=(r+n)/(r-n),n=-(i+a)/(i-a),i=-2*i*a/(i-a);return u[0]=2*a/(t-e),u[1]=0,u[2]=0,u[3]=0,u[4]=0,u[5]=o,u[6]=0,u[7]=0,u[8]=s,u[9]=r,u[10]=n,u[11]=-1,u[12]=0,u[13]=0,u[14]=i,u[15]=0,u},Q.computeInfinitePerspectiveOffCenter=function(e,t,n,r,a,i){var u=2*a/(r-n),o=(t+e)/(t-e),r=(r+n)/(r-n),n=-2*a;return i[0]=2*a/(t-e),i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=o,i[9]=r,i[10]=-1,i[11]=-1,i[12]=0,i[13]=0,i[14]=n,i[15]=0,i},Q.computeViewportTransformation=function(e,t,n,r){b.defined(r)||(r=new Q),e=b.defaultValue(e,b.defaultValue.EMPTY_OBJECT);var a=b.defaultValue(e.x,0),i=b.defaultValue(e.y,0),u=b.defaultValue(e.width,0),o=b.defaultValue(e.height,0);t=b.defaultValue(t,0);var s=.5*u,e=.5*o,u=.5*((n=b.defaultValue(n,1))-t),o=e,n=u,a=a+s,e=i+e,u=t+u;return r[0]=s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=o,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=n,r[11]=0,r[12]=a,r[13]=e,r[14]=u,r[15]=1,r},Q.computeView=function(e,t,n,r,a){return a[0]=r.x,a[1]=n.x,a[2]=-t.x,a[3]=0,a[4]=r.y,a[5]=n.y,a[6]=-t.y,a[7]=0,a[8]=r.z,a[9]=n.z,a[10]=-t.z,a[11]=0,a[12]=-S.dot(r,e),a[13]=-S.dot(n,e),a[14]=S.dot(t,e),a[15]=1,a},Q.toArray=function(e,t){return b.defined(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[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},Q.getElementIndex=function(e,t){return 4*e+t},Q.getColumn=function(e,t,n){var r=4*t,a=e[r],i=e[1+r],t=e[2+r],r=e[3+r];return n.x=a,n.y=i,n.z=t,n.w=r,n},Q.setColumn=function(e,t,n,r){t*=4;return(r=Q.clone(e,r))[t]=n.x,r[1+t]=n.y,r[2+t]=n.z,r[3+t]=n.w,r},Q.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n};var ee=new S;Q.setScale=function(e,t,n){var r=Q.getScale(e,ee),r=S.divideComponents(t,r,ee);return Q.multiplyByScale(e,r,n)},Q.getRow=function(e,t,n){var r=e[t],a=e[t+4],i=e[t+8],t=e[t+12];return n.x=r,n.y=a,n.z=i,n.w=t,n},Q.setRow=function(e,t,n,r){return(r=Q.clone(e,r))[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var te=new S;Q.getScale=function(e,t){return t.x=S.magnitude(S.fromElements(e[0],e[1],e[2],te)),t.y=S.magnitude(S.fromElements(e[4],e[5],e[6],te)),t.z=S.magnitude(S.fromElements(e[8],e[9],e[10],te)),t};var ne=new S;Q.getMaximumScale=function(e){return Q.getScale(e,ne),S.maximumComponent(ne)},Q.multiply=function(e,t,n){var r=e[0],a=e[1],i=e[2],u=e[3],o=e[4],s=e[5],f=e[6],l=e[7],d=e[8],c=e[9],h=e[10],m=e[11],y=e[12],p=e[13],x=e[14],M=e[15],w=t[0],g=t[1],z=t[2],v=t[3],C=t[4],O=t[5],b=t[6],S=t[7],q=t[8],_=t[9],R=t[10],V=t[11],E=t[12],T=t[13],A=t[14],I=t[15],N=a*w+s*g+c*z+p*v,U=i*w+f*g+h*z+x*v,L=u*w+l*g+m*z+M*v,W=r*C+o*O+d*b+y*S,e=a*C+s*O+c*b+p*S,t=i*C+f*O+h*b+x*S,C=u*C+l*O+m*b+M*S,O=r*q+o*_+d*R+y*V,b=a*q+s*_+c*R+p*V,S=i*q+f*_+h*R+x*V,R=u*q+l*_+m*R+M*V,V=r*E+o*T+d*A+y*I,p=a*E+s*T+c*A+p*I,x=i*E+f*T+h*A+x*I,I=u*E+l*T+m*A+M*I;return n[0]=r*w+o*g+d*z+y*v,n[1]=N,n[2]=U,n[3]=L,n[4]=W,n[5]=e,n[6]=t,n[7]=C,n[8]=O,n[9]=b,n[10]=S,n[11]=R,n[12]=V,n[13]=p,n[14]=x,n[15]=I,n},Q.add=function(e,t,n){return 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[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},Q.subtract=function(e,t,n){return 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[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},Q.multiplyTransformation=function(e,t,n){var r=e[0],a=e[1],i=e[2],u=e[4],o=e[5],s=e[6],f=e[8],l=e[9],d=e[10],c=e[12],h=e[13],m=e[14],y=t[0],p=t[1],x=t[2],M=t[4],w=t[5],g=t[6],z=t[8],v=t[9],C=t[10],O=t[12],b=t[13],S=t[14],q=a*y+o*p+l*x,_=i*y+s*p+d*x,e=r*M+u*w+f*g,t=a*M+o*w+l*g,M=i*M+s*w+d*g,w=r*z+u*v+f*C,g=a*z+o*v+l*C,C=i*z+s*v+d*C,c=r*O+u*b+f*S+c,h=a*O+o*b+l*S+h,m=i*O+s*b+d*S+m;return n[0]=r*y+u*p+f*x,n[1]=q,n[2]=_,n[3]=0,n[4]=e,n[5]=t,n[6]=M,n[7]=0,n[8]=w,n[9]=g,n[10]=C,n[11]=0,n[12]=c,n[13]=h,n[14]=m,n[15]=1,n},Q.multiplyByMatrix3=function(e,t,n){var r=e[0],a=e[1],i=e[2],u=e[4],o=e[5],s=e[6],f=e[8],l=e[9],d=e[10],c=t[0],h=t[1],m=t[2],y=t[3],p=t[4],x=t[5],M=t[6],w=t[7],g=t[8],z=a*c+o*h+l*m,v=i*c+s*h+d*m,C=r*y+u*p+f*x,t=a*y+o*p+l*x,p=i*y+s*p+d*x,x=r*M+u*w+f*g,l=a*M+o*w+l*g,g=i*M+s*w+d*g;return n[0]=r*c+u*h+f*m,n[1]=z,n[2]=v,n[3]=0,n[4]=C,n[5]=t,n[6]=p,n[7]=0,n[8]=x,n[9]=l,n[10]=g,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},Q.multiplyByTranslation=function(e,t,n){var r=t.x,a=t.y,i=t.z,u=r*e[0]+a*e[4]+i*e[8]+e[12],t=r*e[1]+a*e[5]+i*e[9]+e[13],i=r*e[2]+a*e[6]+i*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=u,n[13]=t,n[14]=i,n[15]=e[15],n};var re=new S;Q.multiplyByUniformScale=function(e,t,n){return re.x=t,re.y=t,re.z=t,Q.multiplyByScale(e,re,n)},Q.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,t=t.z;return 1===r&&1===a&&1===t?Q.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=a*e[4],n[5]=a*e[5],n[6]=a*e[6],n[7]=0,n[8]=t*e[8],n[9]=t*e[9],n[10]=t*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},Q.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,u=t.w,o=e[0]*r+e[4]*a+e[8]*i+e[12]*u,s=e[1]*r+e[5]*a+e[9]*i+e[13]*u,t=e[2]*r+e[6]*a+e[10]*i+e[14]*u,u=e[3]*r+e[7]*a+e[11]*i+e[15]*u;return n.x=o,n.y=s,n.z=t,n.w=u,n},Q.multiplyByPointAsVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,u=e[0]*r+e[4]*a+e[8]*i,t=e[1]*r+e[5]*a+e[9]*i,i=e[2]*r+e[6]*a+e[10]*i;return n.x=u,n.y=t,n.z=i,n},Q.multiplyByPoint=function(e,t,n){var r=t.x,a=t.y,i=t.z,u=e[0]*r+e[4]*a+e[8]*i+e[12],t=e[1]*r+e[5]*a+e[9]*i+e[13],e=e[2]*r+e[6]*a+e[10]*i+e[14];return n.x=u,n.y=t,n.z=e,n},Q.multiplyByScalar=function(e,t,n){return 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[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},Q.negate=function(e,t){return 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[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},Q.transpose=function(e,t){var n=e[1],r=e[2],a=e[3],i=e[6],u=e[7],o=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=u,t[14]=o,t[15]=e[15],t},Q.abs=function(e,t){return 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[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},Q.equals=function(e,t){return e===t||b.defined(e)&&b.defined(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},Q.equalsEpsilon=function(e,t,n){return n=b.defaultValue(n,0),e===t||b.defined(e)&&b.defined(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&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n},Q.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},Q.getMatrix3=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var ae=new B,ie=new B,ue=new X,oe=new X(0,0,0,1);Q.inverse=function(e,t){var n=e[0],r=e[4],a=e[8],i=e[12],u=e[1],o=e[5],s=e[9],f=e[13],l=e[2],d=e[6],c=e[10],h=e[14],m=e[3],y=e[7],p=e[11],x=e[15],M=c*x,w=h*p,g=d*x,z=h*y,v=d*p,C=c*y,O=l*x,b=h*m,S=l*p,q=c*m,_=l*y,R=d*m,V=M*o+z*s+v*f-(w*o+g*s+C*f),E=w*u+O*s+q*f-(M*u+b*s+S*f),T=g*u+b*o+_*f-(z*u+O*o+R*f),A=C*u+S*o+R*s-(v*u+q*o+_*s),I=w*r+g*a+C*i-(M*r+z*a+v*i),N=M*n+b*a+S*i-(w*n+O*a+q*i),U=z*n+O*r+R*i-(g*n+b*r+_*i),L=v*n+q*r+_*a-(C*n+S*r+R*a),W=(M=a*f)*y+(z=i*o)*p+(v=r*s)*x-((w=i*s)*y+(g=r*f)*p+(C=a*o)*x),s=w*m+(O=n*f)*p+(q=a*u)*x-(M*m+(b=i*u)*p+(S=n*s)*x),x=g*m+b*y+(_=n*o)*x-(z*m+O*y+(R=r*u)*x),y=C*m+S*y+R*p-(v*m+q*y+_*p),p=g*c+C*h+w*d-(v*h+M*d+z*c),w=S*h+M*l+b*c-(O*c+q*h+w*l),b=O*d+R*h+z*l-(_*h+g*l+b*d),l=_*c+v*l+q*d-(S*d+R*c+C*l),i=n*V+r*E+a*T+i*A;if(Math.abs(i)<k.CesiumMath.EPSILON21){if(B.equalsEpsilon(Q.getMatrix3(e,ae),ie,k.CesiumMath.EPSILON7)&&X.equals(Q.getRow(e,3,ue),oe))return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=1,t;throw new P.RuntimeError("matrix is not invertible because its determinate is zero.")}return t[0]=V*(i=1/i),t[1]=E*i,t[2]=T*i,t[3]=A*i,t[4]=I*i,t[5]=N*i,t[6]=U*i,t[7]=L*i,t[8]=W*i,t[9]=s*i,t[10]=x*i,t[11]=y*i,t[12]=p*i,t[13]=w*i,t[14]=b*i,t[15]=l*i,t},Q.inverseTransformation=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[4],u=e[5],o=e[6],s=e[8],f=e[9],l=e[10],d=e[12],c=e[13],h=e[14],m=-n*d-r*c-a*h,e=-i*d-u*c-o*h,h=-s*d-f*c-l*h;return t[0]=n,t[1]=i,t[2]=s,t[3]=0,t[4]=r,t[5]=u,t[6]=f,t[7]=0,t[8]=a,t[9]=o,t[10]=l,t[11]=0,t[12]=m,t[13]=e,t[14]=h,t[15]=1,t};var se=new Q;function fe(e,t,n,r){this.west=b.defaultValue(e,0),this.south=b.defaultValue(t,0),this.east=b.defaultValue(n,0),this.north=b.defaultValue(r,0)}Q.inverseTranspose=function(e,t){return Q.inverse(Q.transpose(e,se),t)},Q.IDENTITY=Object.freeze(new Q(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),Q.ZERO=Object.freeze(new Q(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),Q.COLUMN0ROW0=0,Q.COLUMN0ROW1=1,Q.COLUMN0ROW2=2,Q.COLUMN0ROW3=3,Q.COLUMN1ROW0=4,Q.COLUMN1ROW1=5,Q.COLUMN1ROW2=6,Q.COLUMN1ROW3=7,Q.COLUMN2ROW0=8,Q.COLUMN2ROW1=9,Q.COLUMN2ROW2=10,Q.COLUMN2ROW3=11,Q.COLUMN3ROW0=12,Q.COLUMN3ROW1=13,Q.COLUMN3ROW2=14,Q.COLUMN3ROW3=15,Object.defineProperties(Q.prototype,{length:{get:function(){return Q.packedLength}}}),Q.prototype.clone=function(e){return Q.clone(this,e)},Q.prototype.equals=function(e){return Q.equals(this,e)},Q.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]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},Q.prototype.equalsEpsilon=function(e,t){return Q.equalsEpsilon(this,e,t)},Q.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},Object.defineProperties(fe.prototype,{width:{get:function(){return fe.computeWidth(this)}},height:{get:function(){return fe.computeHeight(this)}}}),fe.packedLength=4,fe.pack=function(e,t,n){return n=b.defaultValue(n,0),t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t},fe.unpack=function(e,t,n){return t=b.defaultValue(t,0),(n=!b.defined(n)?new fe:n).west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n},fe.computeWidth=function(e){var t=e.east,e=e.west;return t<e&&(t+=k.CesiumMath.TWO_PI),t-e},fe.computeHeight=function(e){return e.north-e.south},fe.fromDegrees=function(e,t,n,r,a){return e=k.CesiumMath.toRadians(b.defaultValue(e,0)),t=k.CesiumMath.toRadians(b.defaultValue(t,0)),n=k.CesiumMath.toRadians(b.defaultValue(n,0)),r=k.CesiumMath.toRadians(b.defaultValue(r,0)),b.defined(a)?(a.west=e,a.south=t,a.east=n,a.north=r,a):new fe(e,t,n,r)},fe.fromRadians=function(e,t,n,r,a){return b.defined(a)?(a.west=b.defaultValue(e,0),a.south=b.defaultValue(t,0),a.east=b.defaultValue(n,0),a.north=b.defaultValue(r,0),a):new fe(e,t,n,r)},fe.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,r=-Number.MAX_VALUE,a=Number.MAX_VALUE,i=-Number.MAX_VALUE,u=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=0,f=e.length;s<f;s++)var l=e[s],n=Math.min(n,l.longitude),r=Math.max(r,l.longitude),u=Math.min(u,l.latitude),o=Math.max(o,l.latitude),l=0<=l.longitude?l.longitude:l.longitude+k.CesiumMath.TWO_PI,a=Math.min(a,l),i=Math.max(i,l);return i-a<r-n&&(n=a,(r=i)>k.CesiumMath.PI&&(r-=k.CesiumMath.TWO_PI),n>k.CesiumMath.PI&&(n-=k.CesiumMath.TWO_PI)),b.defined(t)?(t.west=n,t.south=u,t.east=r,t.north=o,t):new fe(n,u,r,o)},fe.fromCartesianArray=function(e,t,n){t=b.defaultValue(t,w.WGS84);for(var r=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,u=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,f=0,l=e.length;f<l;f++)var d=t.cartesianToCartographic(e[f]),r=Math.min(r,d.longitude),a=Math.max(a,d.longitude),o=Math.min(o,d.latitude),s=Math.max(s,d.latitude),d=0<=d.longitude?d.longitude:d.longitude+k.CesiumMath.TWO_PI,i=Math.min(i,d),u=Math.max(u,d);return u-i<a-r&&(r=i,(a=u)>k.CesiumMath.PI&&(a-=k.CesiumMath.TWO_PI),r>k.CesiumMath.PI&&(r-=k.CesiumMath.TWO_PI)),b.defined(n)?(n.west=r,n.south=o,n.east=a,n.north=s,n):new fe(r,o,a,s)},fe.clone=function(e,t){if(b.defined(e))return b.defined(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new fe(e.west,e.south,e.east,e.north)},fe.equalsEpsilon=function(e,t,n){return n=b.defaultValue(n,0),e===t||b.defined(e)&&b.defined(t)&&Math.abs(e.west-t.west)<=n&&Math.abs(e.south-t.south)<=n&&Math.abs(e.east-t.east)<=n&&Math.abs(e.north-t.north)<=n},fe.prototype.clone=function(e){return fe.clone(this,e)},fe.prototype.equals=function(e){return fe.equals(this,e)},fe.equals=function(e,t){return e===t||b.defined(e)&&b.defined(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},fe.prototype.equalsEpsilon=function(e,t){return fe.equalsEpsilon(this,e,t)},fe.validate=function(e){},fe.southwest=function(e,t){return b.defined(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new d(e.west,e.south)},fe.northwest=function(e,t){return b.defined(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new d(e.west,e.north)},fe.northeast=function(e,t){return b.defined(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new d(e.east,e.north)},fe.southeast=function(e,t){return b.defined(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new d(e.east,e.south)},fe.center=function(e,t){var n=e.east,r=e.west;n<r&&(n+=k.CesiumMath.TWO_PI);n=k.CesiumMath.negativePiToPi(.5*(r+n)),e=.5*(e.south+e.north);return b.defined(t)?(t.longitude=n,t.latitude=e,t.height=0,t):new d(n,e)},fe.intersection=function(e,t,n){var r=e.east,a=e.west,i=t.east,u=t.west;r<a&&0<i?r+=k.CesiumMath.TWO_PI:i<u&&0<r&&(i+=k.CesiumMath.TWO_PI),r<a&&u<0?u+=k.CesiumMath.TWO_PI:i<u&&a<0&&(a+=k.CesiumMath.TWO_PI);u=k.CesiumMath.negativePiToPi(Math.max(a,u)),r=k.CesiumMath.negativePiToPi(Math.min(r,i));if(!((e.west<e.east||t.west<t.east)&&r<=u)){i=Math.max(e.south,t.south),t=Math.min(e.north,t.north);if(!(t<=i))return b.defined(n)?(n.west=u,n.south=i,n.east=r,n.north=t,n):new fe(u,i,r,t)}},fe.simpleIntersection=function(e,t,n){var r=Math.max(e.west,t.west),a=Math.max(e.south,t.south),i=Math.min(e.east,t.east),t=Math.min(e.north,t.north);if(!(t<=a||i<=r))return b.defined(n)?(n.west=r,n.south=a,n.east=i,n.north=t,n):new fe(r,a,i,t)},fe.union=function(e,t,n){b.defined(n)||(n=new fe);var r=e.east,a=e.west,i=t.east,u=t.west;r<a&&0<i?r+=k.CesiumMath.TWO_PI:i<u&&0<r&&(i+=k.CesiumMath.TWO_PI),r<a&&u<0?u+=k.CesiumMath.TWO_PI:i<u&&a<0&&(a+=k.CesiumMath.TWO_PI);u=k.CesiumMath.convertLongitudeRange(Math.min(a,u)),i=k.CesiumMath.convertLongitudeRange(Math.max(r,i));return n.west=u,n.south=Math.min(e.south,t.south),n.east=i,n.north=Math.max(e.north,t.north),n},fe.expand=function(e,t,n){return(n=!b.defined(n)?new fe:n).west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},fe.contains=function(e,t){var n=t.longitude,r=t.latitude,a=e.west,t=e.east;return t<a&&(t+=k.CesiumMath.TWO_PI,n<0&&(n+=k.CesiumMath.TWO_PI)),(a<n||k.CesiumMath.equalsEpsilon(n,a,k.CesiumMath.EPSILON14))&&(n<t||k.CesiumMath.equalsEpsilon(n,t,k.CesiumMath.EPSILON14))&&r>=e.south&&r<=e.north};var le=new d;function de(e,t){this.x=b.defaultValue(e,0),this.y=b.defaultValue(t,0)}fe.subsample=function(e,t,n,r){t=b.defaultValue(t,w.WGS84),n=b.defaultValue(n,0),b.defined(r)||(r=[]);var a=0,i=e.north,u=e.south,o=e.east,s=e.west,f=le;f.height=n,f.longitude=s,f.latitude=i,r[a]=t.cartographicToCartesian(f,r[a]),a++,f.longitude=o,r[a]=t.cartographicToCartesian(f,r[a]),a++,f.latitude=u,r[a]=t.cartographicToCartesian(f,r[a]),a++,f.longitude=s,r[a]=t.cartographicToCartesian(f,r[a]),a++,f.latitude=i<0?i:0<u?u:0;for(var l=1;l<8;++l)f.longitude=-Math.PI+l*k.CesiumMath.PI_OVER_TWO,fe.contains(e,f)&&(r[a]=t.cartographicToCartesian(f,r[a]),a++);return 0===f.latitude&&(f.longitude=s,r[a]=t.cartographicToCartesian(f,r[a]),a++,f.longitude=o,r[a]=t.cartographicToCartesian(f,r[a]),a++),r.length=a,r},fe.MAX_VALUE=Object.freeze(new fe(-Math.PI,-k.CesiumMath.PI_OVER_TWO,Math.PI,k.CesiumMath.PI_OVER_TWO)),de.fromElements=function(e,t,n){return b.defined(n)?(n.x=e,n.y=t,n):new de(e,t)},de.fromCartesian3=de.clone=function(e,t){if(b.defined(e))return b.defined(t)?(t.x=e.x,t.y=e.y,t):new de(e.x,e.y)},de.fromCartesian4=de.clone,de.packedLength=2,de.pack=function(e,t,n){return n=b.defaultValue(n,0),t[n++]=e.x,t[n]=e.y,t},de.unpack=function(e,t,n){return t=b.defaultValue(t,0),(n=!b.defined(n)?new de:n).x=e[t++],n.y=e[t],n},de.packArray=function(e,t){var n=e.length,r=2*n;if(b.defined(t)){if(!Array.isArray(t)&&t.length!==r)throw new P.DeveloperError("If result is a typed array, it must have exactly array.length * 2 elements");t.length!==r&&(t.length=r)}else t=new Array(r);for(var a=0;a<n;++a)de.pack(e[a],t,2*a);return t},de.unpackArray=function(e,t){var n=e.length;b.defined(t)?t.length=n/2:t=new Array(n/2);for(var r=0;r<n;r+=2){var a=r/2;t[a]=de.unpack(e,r,t[a])}return t},de.fromArray=de.unpack,de.maximumComponent=function(e){return Math.max(e.x,e.y)},de.minimumComponent=function(e){return Math.min(e.x,e.y)},de.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},de.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},de.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},de.magnitude=function(e){return Math.sqrt(de.magnitudeSquared(e))};var ce=new de;de.distance=function(e,t){return de.subtract(e,t,ce),de.magnitude(ce)},de.distanceSquared=function(e,t){return de.subtract(e,t,ce),de.magnitudeSquared(ce)},de.normalize=function(e,t){var n=de.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},de.dot=function(e,t){return e.x*t.x+e.y*t.y},de.cross=function(e,t){return e.x*t.y-e.y*t.x},de.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},de.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},de.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},de.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},de.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},de.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},de.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},de.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var he=new de;de.lerp=function(e,t,n,r){return de.multiplyByScalar(t,n,he),r=de.multiplyByScalar(e,1-n,r),de.add(he,r,r)};var me=new de,ye=new de;de.angleBetween=function(e,t){return de.normalize(e,me),de.normalize(t,ye),k.CesiumMath.acosClamped(de.dot(me,ye))};var pe=new de;function xe(e,t,n,r){this[0]=b.defaultValue(e,0),this[1]=b.defaultValue(n,0),this[2]=b.defaultValue(t,0),this[3]=b.defaultValue(r,0)}de.mostOrthogonalAxis=function(e,t){e=de.normalize(e,pe);return de.abs(e,e),t=e.x<=e.y?de.clone(de.UNIT_X,t):de.clone(de.UNIT_Y,t)},de.equals=function(e,t){return e===t||b.defined(e)&&b.defined(t)&&e.x===t.x&&e.y===t.y},de.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},de.equalsEpsilon=function(e,t,n,r){return e===t||b.defined(e)&&b.defined(t)&&k.CesiumMath.equalsEpsilon(e.x,t.x,n,r)&&k.CesiumMath.equalsEpsilon(e.y,t.y,n,r)},de.ZERO=Object.freeze(new de(0,0)),de.ONE=Object.freeze(new de(1,1)),de.UNIT_X=Object.freeze(new de(1,0)),de.UNIT_Y=Object.freeze(new de(0,1)),de.prototype.clone=function(e){return de.clone(this,e)},de.prototype.equals=function(e){return de.equals(this,e)},de.prototype.equalsEpsilon=function(e,t,n){return de.equalsEpsilon(this,e,t,n)},de.prototype.toString=function(){return"("+this.x+", "+this.y+")"},xe.packedLength=4,xe.pack=function(e,t,n){return n=b.defaultValue(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t},xe.unpack=function(e,t,n){return t=b.defaultValue(t,0),(n=!b.defined(n)?new xe:n)[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n},xe.clone=function(e,t){if(b.defined(e))return b.defined(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new xe(e[0],e[2],e[1],e[3])},xe.fromArray=function(e,t,n){return t=b.defaultValue(t,0),(n=!b.defined(n)?new xe:n)[0]=e[t],n[1]=e[t+1],n[2]=e[t+2],n[3]=e[t+3],n},xe.fromColumnMajorArray=function(e,t){return xe.clone(e,t)},xe.fromRowMajorArray=function(e,t){return b.defined(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new xe(e[0],e[1],e[2],e[3])},xe.fromScale=function(e,t){return b.defined(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new xe(e.x,0,0,e.y)},xe.fromUniformScale=function(e,t){return b.defined(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new xe(e,0,0,e)},xe.fromRotation=function(e,t){var n=Math.cos(e),e=Math.sin(e);return b.defined(t)?(t[0]=n,t[1]=e,t[2]=-e,t[3]=n,t):new xe(n,-e,e,n)},xe.toArray=function(e,t){return b.defined(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):[e[0],e[1],e[2],e[3]]},xe.getElementIndex=function(e,t){return 2*e+t},xe.getColumn=function(e,t,n){var r=2*t,t=e[r],r=e[1+r];return n.x=t,n.y=r,n},xe.setColumn=function(e,t,n,r){t*=2;return(r=xe.clone(e,r))[t]=n.x,r[1+t]=n.y,r},xe.getRow=function(e,t,n){var r=e[t],t=e[t+2];return n.x=r,n.y=t,n},xe.setRow=function(e,t,n,r){return(r=xe.clone(e,r))[t]=n.x,r[t+2]=n.y,r};var Me=new de;xe.getScale=function(e,t){return t.x=de.magnitude(de.fromElements(e[0],e[1],Me)),t.y=de.magnitude(de.fromElements(e[2],e[3],Me)),t};var we=new de;xe.getMaximumScale=function(e){return xe.getScale(e,we),de.maximumComponent(we)},xe.multiply=function(e,t,n){var r=e[0]*t[0]+e[2]*t[1],a=e[0]*t[2]+e[2]*t[3],i=e[1]*t[0]+e[3]*t[1],t=e[1]*t[2]+e[3]*t[3];return n[0]=r,n[1]=i,n[2]=a,n[3]=t,n},xe.add=function(e,t,n){return 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},xe.subtract=function(e,t,n){return 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},xe.multiplyByVector=function(e,t,n){var r=e[0]*t.x+e[2]*t.y,t=e[1]*t.x+e[3]*t.y;return n.x=r,n.y=t,n},xe.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n},xe.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.y,n[3]=e[3]*t.y,n},xe.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},xe.transpose=function(e,t){var n=e[0],r=e[2],a=e[1],e=e[3];return t[0]=n,t[1]=r,t[2]=a,t[3]=e,t},xe.abs=function(e,t){return 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},xe.equals=function(e,t){return e===t||b.defined(e)&&b.defined(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},xe.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]},xe.equalsEpsilon=function(e,t,n){return n=b.defaultValue(n,0),e===t||b.defined(e)&&b.defined(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},xe.IDENTITY=Object.freeze(new xe(1,0,0,1)),xe.ZERO=Object.freeze(new xe(0,0,0,0)),xe.COLUMN0ROW0=0,xe.COLUMN0ROW1=1,xe.COLUMN1ROW0=2,xe.COLUMN1ROW1=3,Object.defineProperties(xe.prototype,{length:{get:function(){return xe.packedLength}}}),xe.prototype.clone=function(e){return xe.clone(this,e)},xe.prototype.equals=function(e){return xe.equals(this,e)},xe.prototype.equalsEpsilon=function(e,t){return xe.equalsEpsilon(this,e,t)},xe.prototype.toString=function(){return"("+this[0]+", "+this[2]+")\n("+this[1]+", "+this[3]+")"},e.Cartesian2=de,e.Cartesian3=S,e.Cartesian4=X,e.Cartographic=d,e.Ellipsoid=w,e.Matrix2=xe,e.Matrix3=B,e.Matrix4=Q,e.Rectangle=fe});
|