define(["exports","./RuntimeError-ffc802eb","./when-e3a49219","./ComponentDatatype-64cf6611","./PixelFormat-83d70a69","./WebGLConstants-1c8239cc"],(function(e,t,n,i,r,a){"use strict";function u(e,t){if(null===e||"object"!=typeof e)return e;t=n.defaultValue(t,!1);var i=new e.constructor;for(var r in e)if(e.hasOwnProperty(r)){var a=e[r];t&&(a=u(a,t)),i[r]=a}return i}function o(e,t){this.x=n.defaultValue(e,0),this.y=n.defaultValue(t,0)}o.fromElements=function(e,t,i){return n.defined(i)?(i.x=e,i.y=t,i):new o(e,t)},o.clone=function(e,t){if(n.defined(e))return n.defined(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,t,i){return i=n.defaultValue(i,0),t[i++]=e.x,t[i]=e.y,t},o.unpack=function(e,t,i){return t=n.defaultValue(t,0),n.defined(i)||(i=new o),i.x=e[t++],i.y=e[t],i},o.packArray=function(e,i){var r=e.length,a=2*r;if(n.defined(i)){if(!Array.isArray(i)&&i.length!==a)throw new t.DeveloperError("If result is a typed array, it must have exactly array.length * 2 elements");i.length!==a&&(i.length=a)}else i=new Array(a);for(var u=0;u0;s--){var l=e[s].color.replace("#",""),f=e[s-1].color.replace("#",""),d=parseInt(l,16),h=parseInt(f,16),c=e[s].val,m=e[s-1].val,p=Math.floor((c-u)*o+.5),x=Math.floor((m-u)*o+.5),y=x-p;if(0!=y)for(var g=(16711680&d)>>16<<16,w=(65280&d)>>8<<16,T=(255&d)<<16,z=(16711680&h)>>16<<16,C=(65280&h)>>8<<16,S=(255&h)<<16,R=Math.floor((z-g)/y),O=Math.floor((C-w)/y),P=Math.floor((S-T)/y),b=p;b>16,n[4*b+1]=w>>16,n[4*b+2]=T>>16,n[4*b+3]=255}var I=function(e,t){return new A({context:t.context,pixelFormat:r.PixelFormat.RGBA,pixelDatatype:r.PixelDatatype.UNSIGNED_BYTE,source:{width:1,height:1024,arrayBufferView:e},sampler:new v({wrapS:E.CLAMP_TO_EDGE,wrapT:E.CLAMP_TO_EDGE,minificationFilter:M.LINEAR,magnificationFilter:_.LINEAR})})}(n,t);return this._slopeTex=I,this.slopeMapTexture=this._slopeTex,I},setSlopeMapPallete:function(e){var t=[];(e=Object.entries(e)).length>0&&e.forEach((function(e){2==e.length&&e[0]>=0&&e[0]<=90&&t.push({val:100*Math.cos(Cesium.Math.toRadians(e[0])),color:e[1]})})),0!==t.length?(t.sort((function(e,t){return e.vali.CesiumMath.EPSILON12);return n.defined(u)?(u.x=o*A,u.y=s*T,u.z=l*C,u):new z(o*A,s*T,l*C)}function q(e,t,i){this.longitude=n.defaultValue(e,0),this.latitude=n.defaultValue(t,0),this.height=n.defaultValue(i,0)}q.fromRadians=function(e,t,i,r){return i=n.defaultValue(i,0),n.defined(r)?(r.longitude=e,r.latitude=t,r.height=i,r):new q(e,t,i)},q.fromDegrees=function(e,t,n,r){return e=i.CesiumMath.toRadians(e),t=i.CesiumMath.toRadians(t),q.fromRadians(e,t,n,r)};var F=new z,W=new z,B=new z,D=new z(1/T.Ellipsoid.x,1/T.Ellipsoid.y,1/T.Ellipsoid.z),G=new z(1/(T.Ellipsoid.x*T.Ellipsoid.x),1/(T.Ellipsoid.y*T.Ellipsoid.y),1/(T.Ellipsoid.z*T.Ellipsoid.z)),k=i.CesiumMath.EPSILON1;function j(e,t,r,a){t=n.defaultValue(t,0),r=n.defaultValue(r,0),a=n.defaultValue(a,0),e._radii=new z(t,r,a),e._radiiSquared=new z(t*t,r*r,a*a),e._radiiToTheFourth=new z(t*t*t*t,r*r*r*r,a*a*a*a),e._oneOverRadii=new z(0===t?0:1/t,0===r?0:1/r,0===a?0:1/a),e._oneOverRadiiSquared=new z(0===t?0:1/(t*t),0===r?0:1/(r*r),0===a?0:1/(a*a)),e._minimumRadius=Math.min(t,r,a),e._maximumRadius=Math.max(t,r,a),e._centerToleranceSquared=i.CesiumMath.EPSILON1,0!==e._radiiSquared.z&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function Y(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,j(this,e,t,n)}q.fromCartesian=function(e,t,r){var a=n.defined(t)?t.oneOverRadii:D,u=n.defined(t)?t.oneOverRadiiSquared:G,o=U(e,a,u,n.defined(t)?t._centerToleranceSquared:k,W);if(n.defined(o)){var s=z.multiplyComponents(o,u,F);s=z.normalize(s,s);var l=z.subtract(e,o,B),f=Math.atan2(s.y,s.x),d=Math.asin(s.z),h=i.CesiumMath.sign(z.dot(l,e))*z.magnitude(l);return n.defined(r)?(r.longitude=f,r.latitude=d,r.height=h,r):new q(f,d,h)}},q.toCartesian=function(e,t,n){return z.fromRadians(e.longitude,e.latitude,e.height,t,n)},q.clone=function(e,t){if(n.defined(e))return n.defined(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new q(e.longitude,e.latitude,e.height)},q.equals=function(e,t){return e===t||n.defined(e)&&n.defined(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},q.equalsEpsilon=function(e,t,i){return i=n.defaultValue(i,0),e===t||n.defined(e)&&n.defined(t)&&Math.abs(e.longitude-t.longitude)<=i&&Math.abs(e.latitude-t.latitude)<=i&&Math.abs(e.height-t.height)<=i},q.ZERO=Object.freeze(new q(0,0,0)),q.prototype.clone=function(e){return q.clone(this,e)},q.prototype.equals=function(e){return q.equals(this,e)},q.prototype.equalsEpsilon=function(e,t){return q.equalsEpsilon(this,e,t)},q.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},Object.defineProperties(Y.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}}}),Y.clone=function(e,t){if(n.defined(e)){var i=e._radii;return n.defined(t)?(z.clone(i,t._radii),z.clone(e._radiiSquared,t._radiiSquared),z.clone(e._radiiToTheFourth,t._radiiToTheFourth),z.clone(e._oneOverRadii,t._oneOverRadii),z.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new Y(i.x,i.y,i.z)}},Y.fromCartesian3=function(e,t){return n.defined(t)||(t=new Y),n.defined(e)?(j(t,e.x,e.y,e.z),t):t},Y.WGS84=Object.freeze(new Y(T.Ellipsoid.x,T.Ellipsoid.y,T.Ellipsoid.z)),Y.UNIT_SPHERE=Object.freeze(new Y(1,1,1)),Y.MOON=Object.freeze(new Y(i.CesiumMath.LUNAR_RADIUS,i.CesiumMath.LUNAR_RADIUS,i.CesiumMath.LUNAR_RADIUS)),Y.prototype.clone=function(e){return Y.clone(this,e)},Y.packedLength=z.packedLength,Y.pack=function(e,t,i){return i=n.defaultValue(i,0),z.pack(e._radii,t,i),t},Y.unpack=function(e,t,i){t=n.defaultValue(t,0);var r=z.unpack(e,t);return Y.fromCartesian3(r,i)},Y.prototype.geocentricSurfaceNormal=z.normalize,Y.prototype.geodeticSurfaceNormalCartographic=function(e,t){var i=e.longitude,r=e.latitude,a=Math.cos(r),u=a*Math.cos(i),o=a*Math.sin(i),s=Math.sin(r);return n.defined(t)||(t=new z),t.x=u,t.y=o,t.z=s,z.normalize(t,t)},Y.prototype.geodeticSurfaceNormal=function(e,t){if(!z.equalsEpsilon(e,z.ZERO,i.CesiumMath.EPSILON14))return n.defined(t)||(t=new z),t=z.multiplyComponents(e,this._oneOverRadiiSquared,t),z.normalize(t,t)};var X=new z,H=new z;Y.prototype.cartographicToCartesian=function(e,t){var i=X,r=H;this.geodeticSurfaceNormalCartographic(e,i),z.multiplyComponents(this._radiiSquared,i,r);var a=Math.sqrt(z.dot(i,r));return z.divideByScalar(r,a,r),z.multiplyByScalar(i,e.height,i),n.defined(t)||(t=new z),z.add(r,i,t)},Y.prototype.cartographicArrayToCartesianArray=function(e,t){var i=e.length;n.defined(t)?t.length=i:t=new Array(i);for(var r=0;r=this._radii.z-t))return i};var Q=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],$=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function ee(e,t,n){for(var i=.5*(t+e),r=.5*(t-e),a=0,u=0;u<5;u++){var o=r*Q[u];a+=$[u]*(n(i+o)+n(i-o))}return a*=r}function te(e,t,i,r,a,u,o,s,l){this[0]=n.defaultValue(e,0),this[1]=n.defaultValue(r,0),this[2]=n.defaultValue(o,0),this[3]=n.defaultValue(t,0),this[4]=n.defaultValue(a,0),this[5]=n.defaultValue(s,0),this[6]=n.defaultValue(i,0),this[7]=n.defaultValue(u,0),this[8]=n.defaultValue(l,0)}Y.prototype.surfaceArea=function(e){for(var t=e.west,n=e.east,r=e.south,a=e.north;nr&&(a=u,r=o)}var s=1,l=0,f=ae[a],d=ue[a];if(Math.abs(e[te.getElementIndex(d,f)])>n){var h,c=(e[te.getElementIndex(d,d)]-e[te.getElementIndex(f,f)])/2/e[te.getElementIndex(d,f)];l=(h=c<0?-1/(-c+Math.sqrt(1+c*c)):1/(c+Math.sqrt(1+c*c)))*(s=1/Math.sqrt(1+h*h))}return(t=te.clone(te.IDENTITY,t))[te.getElementIndex(f,f)]=t[te.getElementIndex(d,d)]=s,t[te.getElementIndex(d,f)]=l,t[te.getElementIndex(f,d)]=-l,t}var le=new te,fe=new te;te.computeEigenDecomposition=function(e,t){var r=i.CesiumMath.EPSILON20,a=0,u=0;n.defined(t)||(t={});for(var o=t.unitary=te.clone(te.IDENTITY,t.unitary),s=t.diagonal=te.clone(e,t.diagonal),l=r*function(e){for(var t=0,n=0;n<9;++n){var i=e[n];t+=i*i}return Math.sqrt(t)}(s);u<10&&oe(s)>l;)se(s,le),te.transpose(le,fe),te.multiply(s,le,s),te.multiply(fe,s,s),te.multiply(o,le,o),++a>2&&(++u,a=0);return t},te.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},te.determinant=function(e){var t=e[0],n=e[3],i=e[6],r=e[1],a=e[4],u=e[7],o=e[2],s=e[5],l=e[8];return t*(a*l-s*u)+r*(s*i-n*l)+o*(n*u-a*i)},te.inverse=function(e,t){var n=e[0],i=e[1],r=e[2],a=e[3],u=e[4],o=e[5],s=e[6],l=e[7],f=e[8],d=te.determinant(e);t[0]=u*f-l*o,t[1]=l*r-i*f,t[2]=i*o-u*r,t[3]=s*o-a*f,t[4]=n*f-s*r,t[5]=a*r-n*o,t[6]=a*l-s*u,t[7]=s*i-n*l,t[8]=n*u-a*i;var h=1/d;return te.multiplyByScalar(t,h,t)};var de=new te;function he(e,t,i,r){this.x=n.defaultValue(e,0),this.y=n.defaultValue(t,0),this.z=n.defaultValue(i,0),this.w=n.defaultValue(r,0)}te.inverseTranspose=function(e,t){return te.inverse(te.transpose(e,de),t)},te.equals=function(e,t){return e===t||n.defined(e)&&n.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]},te.equalsEpsilon=function(e,t,i){return i=n.defaultValue(i,0),e===t||n.defined(e)&&n.defined(t)&&Math.abs(e[0]-t[0])<=i&&Math.abs(e[1]-t[1])<=i&&Math.abs(e[2]-t[2])<=i&&Math.abs(e[3]-t[3])<=i&&Math.abs(e[4]-t[4])<=i&&Math.abs(e[5]-t[5])<=i&&Math.abs(e[6]-t[6])<=i&&Math.abs(e[7]-t[7])<=i&&Math.abs(e[8]-t[8])<=i},te.IDENTITY=Object.freeze(new te(1,0,0,0,1,0,0,0,1)),te.ZERO=Object.freeze(new te(0,0,0,0,0,0,0,0,0)),te.COLUMN0ROW0=0,te.COLUMN0ROW1=1,te.COLUMN0ROW2=2,te.COLUMN1ROW0=3,te.COLUMN1ROW1=4,te.COLUMN1ROW2=5,te.COLUMN2ROW0=6,te.COLUMN2ROW1=7,te.COLUMN2ROW2=8,Object.defineProperties(te.prototype,{length:{get:function(){return te.packedLength}}}),te.prototype.clone=function(e){return te.clone(this,e)},te.prototype.equals=function(e){return te.equals(this,e)},te.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]},te.prototype.equalsEpsilon=function(e,t){return te.equalsEpsilon(this,e,t)},te.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},he.fromElements=function(e,t,i,r,a){return n.defined(a)?(a.x=e,a.y=t,a.z=i,a.w=r,a):new he(e,t,i,r)},he.fromColor=function(e,t){return n.defined(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new he(e.red,e.green,e.blue,e.alpha)},he.clone=function(e,t){if(n.defined(e))return n.defined(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new he(e.x,e.y,e.z,e.w)},he.packedLength=4,he.pack=function(e,t,i){return i=n.defaultValue(i,0),t[i++]=e.x,t[i++]=e.y,t[i++]=e.z,t[i]=e.w,t},he.unpack=function(e,t,i){return t=n.defaultValue(t,0),n.defined(i)||(i=new he),i.x=e[t++],i.y=e[t++],i.z=e[t++],i.w=e[t],i},he.packArray=function(e,i){var r=e.length,a=4*r;if(n.defined(i)){if(!Array.isArray(i)&&i.length!==a)throw new t.DeveloperError("If result is a typed array, it must have exactly array.length * 4 elements");i.length!==a&&(i.length=a)}else i=new Array(a);for(var u=0;u=0?h.longitude:h.longitude+i.CesiumMath.TWO_PI;u=Math.min(u,c),o=Math.max(o,c)}return a-r>o-u&&(r=u,(a=o)>i.CesiumMath.PI&&(a-=i.CesiumMath.TWO_PI),r>i.CesiumMath.PI&&(r-=i.CesiumMath.TWO_PI)),n.defined(t)?(t.west=r,t.south=s,t.east=a,t.north=l,t):new Ie(r,s,a,l)},Ie.fromCartesianArray=function(e,t,r){t=n.defaultValue(t,Y.WGS84);for(var a=Number.MAX_VALUE,u=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,d=0,h=e.length;d=0?c.longitude:c.longitude+i.CesiumMath.TWO_PI;o=Math.min(o,m),s=Math.max(s,m)}return u-a>s-o&&(a=o,(u=s)>i.CesiumMath.PI&&(u-=i.CesiumMath.TWO_PI),a>i.CesiumMath.PI&&(a-=i.CesiumMath.TWO_PI)),n.defined(r)?(r.west=a,r.south=l,r.east=u,r.north=f,r):new Ie(a,l,u,f)},Ie.clone=function(e,t){if(n.defined(e))return n.defined(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new Ie(e.west,e.south,e.east,e.north)},Ie.equalsEpsilon=function(e,t,i){return i=n.defaultValue(i,0),e===t||n.defined(e)&&n.defined(t)&&Math.abs(e.west-t.west)<=i&&Math.abs(e.south-t.south)<=i&&Math.abs(e.east-t.east)<=i&&Math.abs(e.north-t.north)<=i},Ie.prototype.clone=function(e){return Ie.clone(this,e)},Ie.prototype.equals=function(e){return Ie.equals(this,e)},Ie.equals=function(e,t){return e===t||n.defined(e)&&n.defined(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},Ie.prototype.equalsEpsilon=function(e,t){return Ie.equalsEpsilon(this,e,t)},Ie.validate=function(e){},Ie.southwest=function(e,t){return n.defined(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new q(e.west,e.south)},Ie.northwest=function(e,t){return n.defined(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new q(e.west,e.north)},Ie.northeast=function(e,t){return n.defined(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new q(e.east,e.north)},Ie.southeast=function(e,t){return n.defined(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new q(e.east,e.south)},Ie.center=function(e,t){var r=e.east,a=e.west;r0?a+=i.CesiumMath.TWO_PI:o0&&(o+=i.CesiumMath.TWO_PI),a=h))return n.defined(r)?(r.west=l,r.south=d,r.east=f,r.north=h,r):new Ie(l,d,f,h)}},Ie.simpleIntersection=function(e,t,i){var r=Math.max(e.west,t.west),a=Math.max(e.south,t.south),u=Math.min(e.east,t.east),o=Math.min(e.north,t.north);if(!(a>=o||r>=u))return n.defined(i)?(i.west=r,i.south=a,i.east=u,i.north=o,i):new Ie(r,a,u,o)},Ie.union=function(e,t,r){n.defined(r)||(r=new Ie);var a=e.east,u=e.west,o=t.east,s=t.west;a0?a+=i.CesiumMath.TWO_PI:o0&&(o+=i.CesiumMath.TWO_PI),aa||i.CesiumMath.equalsEpsilon(n,a,i.CesiumMath.EPSILON14))&&(n=e.south&&r<=e.north};var Le=new q;function Ne(e,t,i,r){this[0]=n.defaultValue(e,0),this[1]=n.defaultValue(i,0),this[2]=n.defaultValue(t,0),this[3]=n.defaultValue(r,0)}Ie.subsample=function(e,t,r,a){t=n.defaultValue(t,Y.WGS84),r=n.defaultValue(r,0),n.defined(a)||(a=[]);var u=0,o=e.north,s=e.south,l=e.east,f=e.west,d=Le;d.height=r,d.longitude=f,d.latitude=o,a[u]=t.cartographicToCartesian(d,a[u]),u++,d.longitude=l,a[u]=t.cartographicToCartesian(d,a[u]),u++,d.latitude=s,a[u]=t.cartographicToCartesian(d,a[u]),u++,d.longitude=f,a[u]=t.cartographicToCartesian(d,a[u]),u++,d.latitude=o<0?o:s>0?s:0;for(var h=1;h<8;++h)d.longitude=-Math.PI+h*i.CesiumMath.PI_OVER_TWO,Ie.contains(e,d)&&(a[u]=t.cartographicToCartesian(d,a[u]),u++);return 0===d.latitude&&(d.longitude=f,a[u]=t.cartographicToCartesian(d,a[u]),u++,d.longitude=l,a[u]=t.cartographicToCartesian(d,a[u]),u++),a.length=u,a},Ie.MAX_VALUE=Object.freeze(new Ie(-Math.PI,-i.CesiumMath.PI_OVER_TWO,Math.PI,i.CesiumMath.PI_OVER_TWO)),Ne.packedLength=4,Ne.pack=function(e,t,i){return i=n.defaultValue(i,0),t[i++]=e[0],t[i++]=e[1],t[i++]=e[2],t[i++]=e[3],t},Ne.unpack=function(e,t,i){return t=n.defaultValue(t,0),n.defined(i)||(i=new Ne),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i},Ne.clone=function(e,t){if(n.defined(e))return n.defined(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new Ne(e[0],e[2],e[1],e[3])},Ne.fromArray=function(e,t,i){return t=n.defaultValue(t,0),n.defined(i)||(i=new Ne),i[0]=e[t],i[1]=e[t+1],i[2]=e[t+2],i[3]=e[t+3],i},Ne.fromColumnMajorArray=function(e,t){return Ne.clone(e,t)},Ne.fromRowMajorArray=function(e,t){return n.defined(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new Ne(e[0],e[1],e[2],e[3])},Ne.fromScale=function(e,t){return n.defined(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new Ne(e.x,0,0,e.y)},Ne.fromUniformScale=function(e,t){return n.defined(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new Ne(e,0,0,e)},Ne.fromRotation=function(e,t){var i=Math.cos(e),r=Math.sin(e);return n.defined(t)?(t[0]=i,t[1]=r,t[2]=-r,t[3]=i,t):new Ne(i,-r,r,i)},Ne.toArray=function(e,t){return n.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]]},Ne.getElementIndex=function(e,t){return 2*e+t},Ne.getColumn=function(e,t,n){var i=2*t,r=e[i],a=e[i+1];return n.x=r,n.y=a,n},Ne.setColumn=function(e,t,n,i){var r=2*t;return(i=Ne.clone(e,i))[r]=n.x,i[r+1]=n.y,i},Ne.getRow=function(e,t,n){var i=e[t],r=e[t+2];return n.x=i,n.y=r,n},Ne.setRow=function(e,t,n,i){return(i=Ne.clone(e,i))[t]=n.x,i[t+2]=n.y,i};var Ve=new o;Ne.getScale=function(e,t){return t.x=o.magnitude(o.fromElements(e[0],e[1],Ve)),t.y=o.magnitude(o.fromElements(e[2],e[3],Ve)),t};var Ue=new o;Ne.getMaximumScale=function(e){return Ne.getScale(e,Ue),o.maximumComponent(Ue)},Ne.multiply=function(e,t,n){var i=e[0]*t[0]+e[2]*t[1],r=e[0]*t[2]+e[2]*t[3],a=e[1]*t[0]+e[3]*t[1],u=e[1]*t[2]+e[3]*t[3];return n[0]=i,n[1]=a,n[2]=r,n[3]=u,n},Ne.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},Ne.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},Ne.multiplyByVector=function(e,t,n){var i=e[0]*t.x+e[2]*t.y,r=e[1]*t.x+e[3]*t.y;return n.x=i,n.y=r,n},Ne.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},Ne.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},Ne.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},Ne.transpose=function(e,t){var n=e[0],i=e[2],r=e[1],a=e[3];return t[0]=n,t[1]=i,t[2]=r,t[3]=a,t},Ne.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},Ne.equals=function(e,t){return e===t||n.defined(e)&&n.defined(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},Ne.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]},Ne.equalsEpsilon=function(e,t,i){return i=n.defaultValue(i,0),e===t||n.defined(e)&&n.defined(t)&&Math.abs(e[0]-t[0])<=i&&Math.abs(e[1]-t[1])<=i&&Math.abs(e[2]-t[2])<=i&&Math.abs(e[3]-t[3])<=i},Ne.IDENTITY=Object.freeze(new Ne(1,0,0,1)),Ne.ZERO=Object.freeze(new Ne(0,0,0,0)),Ne.COLUMN0ROW0=0,Ne.COLUMN0ROW1=1,Ne.COLUMN1ROW0=2,Ne.COLUMN1ROW1=3,Object.defineProperties(Ne.prototype,{length:{get:function(){return Ne.packedLength}}}),Ne.prototype.clone=function(e){return Ne.clone(this,e)},Ne.prototype.equals=function(e){return Ne.equals(this,e)},Ne.prototype.equalsEpsilon=function(e,t){return Ne.equalsEpsilon(this,e,t)},Ne.prototype.toString=function(){return"("+this[0]+", "+this[2]+")\n("+this[1]+", "+this[3]+")"},e.Cartesian2=o,e.Cartesian3=z,e.Cartesian4=he,e.Cartographic=q,e.Ellipsoid=Y,e.Matrix2=Ne,e.Matrix3=te,e.Matrix4=Me,e.Rectangle=Ie,e.clone=u}));