/** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * * Copyright 2011-2016 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/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md for full licensing details. */ /** @license mersenne-twister.js - https://gist.github.com/banksean/300494 Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The names of its contributors may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ !function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/Check",["./defaultValue","./defined","./DeveloperError","./isArray"],function(e,t,n,r){"use strict";function i(e){return e+" was required but undefined."}function a(e,t,n){return"Expected "+n+" to be typeof "+t+", got "+e}var o={};return o.typeOf={},o.numeric={},o.defined=function(e,r){if(!t(e))throw new n(i(r))},o.numeric.maximum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e>t)throw new n("Expected "+e+" to be at most "+t)},o.numeric.minimum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e>>0,this.mti=1;this.mti>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n>>1^t[1&e];for(;n>>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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(e){return e>0?1:e<0?-1:0},i.signNotZero=function(e){return e<0?-1:1},i.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*i.clamp(e,-1,1)+.5)*n)},i.fromSNorm=function(e,n){return n=t(n,255),i.clamp(e,0,n)/n*2-1},i.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},i.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},i.lerp=function(e,t,n){return(1-n)*e+n*t},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(e){return e*i.RADIANS_PER_DEGREE},i.toDegrees=function(e){return e*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(e){var t=i.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},i.clampToLatitudeRange=function(e){return i.clamp(e,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(e){return i.zeroToTwoPi(e+i.PI)-i.PI},i.zeroToTwoPi=function(e){var t=i.mod(e,i.TWO_PI);return Math.abs(t)i.EPSILON14?i.TWO_PI:t},i.mod=function(e,t){return(e%t+t)%t},i.equalsEpsilon=function(e,n,r,i){i=t(i,r);var a=Math.abs(e-n);return a<=i||a<=r*Math.max(Math.abs(e),Math.abs(n))};var a=[1];i.factorial=function(e){var t=a.length;if(e>=t)for(var n=a[t-1],r=t;r<=e;r++)a.push(n*r);return a[e]},i.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},i.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},i.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},i.clamp=function(e,t,n){return en?n:e};var o=new e;return i.setRandomNumberSeed=function(t){o=new e(t)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(e){return Math.acos(i.clamp(e,-1,1))},i.asinClamped=function(e){return Math.asin(i.clamp(e,-1,1))},i.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},i.logBase=function(e,t){return Math.log(e)/Math.log(t)},i.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var i=e.clock,a=e.cone,u=t(e.magnitude,1),E=u*Math.sin(a);return r.x=E*Math.cos(i),r.y=E*Math.sin(i),r.z=u*Math.cos(a),r},o.fromElements=function(e,t,r,i){return n(i)?(i.x=e,i.y=t,i.z=r,i):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var i=0;ir.EPSILON12);return t(s)?(s.x=c*U,s.y=_*L,s.z=l*g,s):new e(c*U,_*L,l*g)}var a=new e,o=new e;return i}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,i,a){return i=t(i,0),n(a)?(a.longitude=e,a.latitude=r,a.height=i,a):new u(e,r,i)},u.fromDegrees=function(e,t,n,r){return e=a.toRadians(e),t=a.toRadians(t),u.fromRadians(e,t,n,r)};var E=new e,s=new e,c=new e,_=new e(1/6378137,1/6378137,1/6356752.314245179),l=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),T=a.EPSILON1;return u.fromCartesian=function(t,r,i){var R=n(r)?r.oneOverRadii:_,f=n(r)?r.oneOverRadiiSquared:l,A=n(r)?r._centerToleranceSquared:T,h=o(t,R,f,A,s);if(n(h)){var d=e.multiplyComponents(h,f,E);d=e.normalize(d,d);var N=e.subtract(t,h,c),I=Math.atan2(d.y,d.x),S=Math.asin(d.z),M=a.sign(e.dot(N,t))*e.magnitude(N);return n(i)?(i.longitude=I,i.latitude=S,i.height=M,i):new u(I,S,M)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=i(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o,u,E){"use strict";function s(t,r,i,a){r=n(r,0),i=n(i,0),a=n(a,0),t._radii=new e(r,i,a),t._radiiSquared=new e(r*r,i*i,a*a),t._radiiToTheFourth=new e(r*r*r*r,i*i*i*i,a*a*a*a),t._oneOverRadii=new e(0===r?0:1/r,0===i?0:1/i,0===a?0:1/a),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===i?0:1/(i*i),0===a?0:1/(a*a)),t._minimumRadius=Math.min(r,i,a),t._maximumRadius=Math.max(r,i,a),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function c(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._sqauredXOverSquaredZ=void 0,s(this,e,t,n)}i(c.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}}}),c.clone=function(t,n){if(r(t)){var i=t._radii;return r(n)?(e.clone(i,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new c(i.x,i.y,i.z)}},c.fromCartesian3=function(e,t){return r(t)||(t=new c),r(e)?(s(t,e.x,e.y,e.z),t):t},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(e){return c.clone(this,e)},c.packedLength=e.packedLength,c.pack=function(t,r,i){return i=n(i,0),e.pack(t._radii,r,i),r},c.unpack=function(t,r,i){r=n(r,0);var a=e.unpack(t,r);return c.fromCartesian3(a,i)},c.prototype.geocentricSurfaceNormal=e.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(t,n){var i=t.longitude,a=t.latitude,o=Math.cos(a),u=o*Math.cos(i),E=o*Math.sin(i),s=Math.sin(a);return r(n)||(n=new e),n.x=u,n.y=E,n.z=s,e.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var _=new e,l=new e;c.prototype.cartographicToCartesian=function(t,n){var i=_,a=l;this.geodeticSurfaceNormalCartographic(t,i),e.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(e.dot(i,a));return e.divideByScalar(a,o,a),e.multiplyByScalar(i,t.height,i),r(n)||(n=new e),e.add(a,i,n)},c.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i=this._radii.z-i))return a},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,i,a,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var i=this._semimajorAxis,a=t.longitude*i,o=t.latitude*i,u=t.height;return r(n)?(n.x=a,n.y=o,n.z=u,n):new e(a,o,u)},u.prototype.unproject=function(e,n){var i=this._oneOverSemimajorAxis,a=e.x*i,o=e.y*i,u=e.z;return r(n)?(n.longitude=a,n.latitude=o,n.height=u,n):new t(a,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a,o){"use strict";function u(e,n,r,i,a,o,u,E,s){this[0]=t(e,0),this[1]=t(i,0),this[2]=t(u,0),this[3]=t(n,0),this[4]=t(a,0),this[5]=t(E,0),this[6]=t(r,0),this[7]=t(o,0),this[8]=t(s,0)}function E(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function s(e){for(var t=0,n=0;n<3;++n){var r=e[u.getElementIndex(R[n],T[n])];t+=2*r*r}return Math.sqrt(t)}function c(e,t){for(var n=o.EPSILON15,r=0,i=1,a=0;a<3;++a){var E=Math.abs(e[u.getElementIndex(R[a],T[a])]);E>r&&(i=a,r=E)}var s=1,c=0,_=T[i],l=R[i];if(Math.abs(e[u.getElementIndex(l,_)])>n){var f,A=e[u.getElementIndex(l,l)],h=e[u.getElementIndex(_,_)],d=e[u.getElementIndex(l,_)],N=(A-h)/2/d;f=N<0?-1/(-N+Math.sqrt(1+N*N)):1/(N+Math.sqrt(1+N*N)),s=1/Math.sqrt(1+f*f),c=f*s}return t=u.clone(u.IDENTITY,t),t[u.getElementIndex(_,_)]=t[u.getElementIndex(l,l)]=s,t[u.getElementIndex(l,_)]=c,t[u.getElementIndex(_,l)]=-c,t}u.packedLength=9,u.pack=function(e,n,r){return r=t(r,0),n[r++]=e[0],n[r++]=e[1],n[r++]=e[2],n[r++]=e[3],n[r++]=e[4],n[r++]=e[5],n[r++]=e[6],n[r++]=e[7],n[r++]=e[8],n},u.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new u),i[0]=e[r++],i[1]=e[r++],i[2]=e[r++],i[3]=e[r++],i[4]=e[r++],i[5]=e[r++],i[6]=e[r++],i[7]=e[r++],i[8]=e[r++],i},u.clone=function(e,t){if(n(e))return n(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 u(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},u.fromArray=function(e,r,i){return r=t(r,0),n(i)||(i=new u),i[0]=e[r],i[1]=e[r+1],i[2]=e[r+2],i[3]=e[r+3],i[4]=e[r+4],i[5]=e[r+5],i[6]=e[r+6],i[7]=e[r+7],i[8]=e[r+8],i},u.fromColumnMajorArray=function(e,t){return u.clone(e,t)},u.fromRowMajorArray=function(e,t){return n(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 u(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},u.fromQuaternion=function(e,t){var r=e.x*e.x,i=e.x*e.y,a=e.x*e.z,o=e.x*e.w,E=e.y*e.y,s=e.y*e.z,c=e.y*e.w,_=e.z*e.z,l=e.z*e.w,T=e.w*e.w,R=r-E-_+T,f=2*(i-l),A=2*(a+c),h=2*(i+l),d=-r+E-_+T,N=2*(s-o),I=2*(a-c),S=2*(s+o),M=-r-E+_+T;return n(t)?(t[0]=R,t[1]=h,t[2]=I,t[3]=f,t[4]=d,t[5]=S,t[6]=A,t[7]=N,t[8]=M,t):new u(R,f,A,h,d,N,I,S,M)},u.fromHeadingPitchRoll=function(e,t){var r=Math.cos(-e.pitch),i=Math.cos(-e.heading),a=Math.cos(e.roll),o=Math.sin(-e.pitch),E=Math.sin(-e.heading),s=Math.sin(e.roll),c=r*i,_=-a*E+s*o*i,l=s*E+a*o*i,T=r*E,R=a*i+s*o*E,f=-o*a+a*o*E,A=-o,h=s*r,d=a*r;return n(t)?(t[0]=c,t[1]=T,t[2]=A,t[3]=_,t[4]=R,t[5]=h,t[6]=l,t[7]=f,t[8]=d,t):new u(c,_,l,T,R,f,A,h,d)},u.fromScale=function(e,t){return n(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 u(e.x,0,0,0,e.y,0,0,0,e.z)},u.fromUniformScale=function(e,t){return n(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 u(e,0,0,0,e,0,0,0,e)},u.fromCrossProduct=function(e,t){return n(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 u(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},u.fromRotationX=function(e,t){var r=Math.cos(e),i=Math.sin(e);return n(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=r,t[5]=i,t[6]=0,t[7]=-i,t[8]=r,t):new u(1,0,0,0,r,-i,0,i,r)},u.fromRotationY=function(e,t){var r=Math.cos(e),i=Math.sin(e);return n(t)?(t[0]=r,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=r,t):new u(r,0,i,0,1,0,-i,0,r)},u.fromRotationZ=function(e,t){var r=Math.cos(e),i=Math.sin(e);return n(t)?(t[0]=r,t[1]=i,t[2]=0,t[3]=-i,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new u(r,-i,0,i,r,0,0,0,1)},u.toArray=function(e,t){return n(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]]},u.getElementIndex=function(e,t){return 3*e+t},u.getColumn=function(e,t,n){var r=3*t,i=e[r],a=e[r+1],o=e[r+2];return n.x=i,n.y=a,n.z=o,n},u.setColumn=function(e,t,n,r){r=u.clone(e,r);var i=3*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},u.getRow=function(e,t,n){var r=e[t],i=e[t+3],a=e[t+6];return n.x=r,n.y=i,n.z=a,n},u.setRow=function(e,t,n,r){return r=u.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var _=new e;u.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],_)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],_)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],_)),n};var l=new e;u.getMaximumScale=function(t){return u.getScale(t,l),e.maximumComponent(l)},u.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],i=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],a=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],E=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],s=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],c=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],_=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=E,n[6]=s,n[7]=c,n[8]=_,n},u.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},u.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},u.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[3]*i+e[6]*a,u=e[1]*r+e[4]*i+e[7]*a,E=e[2]*r+e[5]*i+e[8]*a;return n.x=o,n.y=u,n.z=E,n},u.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},u.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},u.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},u.transpose=function(e,t){var n=e[0],r=e[3],i=e[6],a=e[1],o=e[4],u=e[7],E=e[2],s=e[5],c=e[8];return t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=u,t[6]=E,t[7]=s,t[8]=c,t};var T=[1,0,0],R=[2,2,1],f=new u,A=new u;return u.computeEigenDecomposition=function(e,t){var r=o.EPSILON20,i=10,a=0,_=0;n(t)||(t={});for(var l=t.unitary=u.clone(u.IDENTITY,t.unitary),T=t.diagonal=u.clone(e,t.diagonal),R=r*E(T);_R;)c(T,f),u.transpose(f,A),u.multiply(T,f,T),u.multiply(A,T,T),u.multiply(l,f,l),++a>2&&(++_,a=0);return t},u.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},u.determinant=function(e){var t=e[0],n=e[3],r=e[6],i=e[1],a=e[4],o=e[7],u=e[2],E=e[5],s=e[8];return t*(a*s-E*o)+i*(E*r-n*s)+u*(n*o-a*r)},u.inverse=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],E=e[5],s=e[6],c=e[7],_=e[8],l=u.determinant(e);t[0]=o*_-c*E,t[1]=c*i-r*_,t[2]=r*E-o*i,t[3]=s*E-a*_,t[4]=n*_-s*i,t[5]=a*i-n*E,t[6]=a*c-s*o,t[7]=s*r-n*c,t[8]=n*o-a*r;var T=1/l;return u.multiplyByScalar(t,T,t)},u.equals=function(e,t){return e===t||n(e)&&n(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]},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r},u.IDENTITY=a(new u(1,0,0,0,1,0,0,0,1)),u.ZERO=a(new u(0,0,0,0,0,0,0,0,0)),u.COLUMN0ROW0=0,u.COLUMN0ROW1=1,u.COLUMN0ROW2=2,u.COLUMN1ROW0=3,u.COLUMN1ROW1=4,u.COLUMN1ROW2=5,u.COLUMN2ROW0=6,u.COLUMN2ROW1=7,u.COLUMN2ROW2=8,r(u.prototype,{length:{get:function(){return u.packedLength}}}),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.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]},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},u}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i){"use strict";function a(t,n,r,i){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0),this.w=e(i,0)}a.fromElements=function(e,n,r,i,o){return t(o)?(o.x=e,o.y=n,o.z=r,o.w=i,o):new a(e,n,r,i)},a.fromColor=function(e,n){return t(n)?(n.x=e.red,n.y=e.green,n.z=e.blue,n.w=e.alpha,n):new a(e.red,e.green,e.blue,e.alpha)},a.clone=function(e,n){if(t(e))return t(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n.w=e.w,n):new a(e.x,e.y,e.z,e.w)},a.packedLength=4,a.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w,n},a.unpack=function(n,r,i){return r=e(r,0),t(i)||(i=new a),i.x=n[r++],i.y=n[r++],i.z=n[r++],i.w=n[r],i},a.packArray=function(e,n){var r=e.length;t(n)?n.length=4*r:n=new Array(4*r);for(var i=0;i=0?T.longitude:T.longitude+u.TWO_PI;a=Math.min(a,R),o=Math.max(o,R)}return i-r>o-a&&(r=a,i=o,i>u.PI&&(i-=u.TWO_PI),r>u.PI&&(r-=u.TWO_PI)),n(t)?(t.west=r,t.south=s,t.east=i,t.north=c,t):new E(r,s,i,c)},E.fromCartesianArray=function(e,t,r){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,l=0,T=e.length;l=0?R.longitude:R.longitude+u.TWO_PI;o=Math.min(o,f),s=Math.max(s,f)}return a-i>s-o&&(i=o,a=s,a>u.PI&&(a-=u.TWO_PI),i>u.PI&&(i-=u.TWO_PI)),n(r)?(r.west=i,r.south=c,r.east=a,r.north=_,r):new E(i,c,a,_)},E.clone=function(e,t){if(n(e))return n(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new E(e.west,e.south,e.east,e.north)},E.prototype.clone=function(e){return E.clone(this,e)},E.prototype.equals=function(e){return E.equals(this,e)},E.equals=function(e,t){return e===t||n(e)&&n(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},E.prototype.equalsEpsilon=function(e,t){return n(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},E.validate=function(e){},E.southwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.south,r.height=0,r):new e(t.west,t.south)},E.northwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.north,r.height=0,r):new e(t.west,t.north)},E.northeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.north,r.height=0,r):new e(t.east,t.north)},E.southeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.south,r.height=0,r):new e(t.east,t.south)},E.center=function(t,r){var i=t.east,a=t.west;i0?i+=u.TWO_PI:o0&&(o+=u.TWO_PI),i=T))return n(r)?(r.west=c,r.south=l,r.east=_,r.north=T,r):new E(c,l,_,T)}},E.simpleIntersection=function(e,t,r){var i=Math.max(e.west,t.west),a=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(a>=u||i>=o))return n(r)?(r.west=i,r.south=a,r.east=o,r.north=u,r):new E(i,a,o,u)},E.union=function(e,t,r){n(r)||(r=new E);var i=e.east,a=e.west,o=t.east,s=t.west;i0?i+=u.TWO_PI:o0&&(o+=u.TWO_PI),ii||u.equalsEpsilon(n,i,u.EPSILON14))&&(n=e.south&&r<=e.north};var s=new e;return E.subsample=function(e,r,i,o){r=t(r,a.WGS84),i=t(i,0),n(o)||(o=[]);var c=0,_=e.north,l=e.south,T=e.east,R=e.west,f=s;f.height=i,f.longitude=R,f.latitude=_,o[c]=r.cartographicToCartesian(f,o[c]),c++,f.longitude=T,o[c]=r.cartographicToCartesian(f,o[c]),c++,f.latitude=l,o[c]=r.cartographicToCartesian(f,o[c]),c++,f.longitude=R,o[c]=r.cartographicToCartesian(f,o[c]),c++,_<0?f.latitude=_:l>0?f.latitude=l:f.latitude=0;for(var A=1;A<8;++A)f.longitude=-Math.PI+A*u.PI_OVER_TWO,E.contains(e,f)&&(o[c]=r.cartographicToCartesian(f,o[c]),c++);return 0===f.latitude&&(f.longitude=R,o[c]=r.cartographicToCartesian(f,o[c]),c++,f.longitude=T,o[c]=r.cartographicToCartesian(f,o[c]),c++),o.length=c,o},E.MAX_VALUE=o(new E(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),E}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,i,a,o,u,E,s,c,_){"use strict";function l(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var T=new e,R=new e,f=new e,A=new e,h=new e,d=new e,N=new e,I=new e,S=new e,M=new e,y=new e,m=new e;l.fromPoints=function(t,n){if(r(n)||(n=new l),!r(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var i=e.clone(t[0],N),a=e.clone(i,T),o=e.clone(i,R),u=e.clone(i,f),E=e.clone(i,A),s=e.clone(i,h),c=e.clone(i,d),_=t.length,O=1;O<_;O++){e.clone(t[O],i);var p=i.x,C=i.y,U=i.z;pE.x&&e.clone(i,E),Cs.y&&e.clone(i,s),Uc.z&&e.clone(i,c)}var L=e.magnitudeSquared(e.subtract(E,a,I)),g=e.magnitudeSquared(e.subtract(s,o,I)),w=e.magnitudeSquared(e.subtract(c,u,I)),x=a,v=E,F=L;g>F&&(F=g,x=o,v=s),w>F&&(F=w,x=u,v=c);var P=S;P.x=.5*(x.x+v.x),P.y=.5*(x.y+v.y),P.z=.5*(x.z+v.z);var B=e.magnitudeSquared(e.subtract(v,P,I)),D=Math.sqrt(B),z=M;z.x=a.x,z.y=o.y,z.z=u.z;var G=y;G.x=E.x,G.y=s.y,G.z=c.z;var b=e.multiplyByScalar(e.add(z,G,I),.5,m),V=0;for(O=0;O<_;O++){e.clone(t[O],i);var X=e.magnitude(e.subtract(i,b,I));X>V&&(V=X);var H=e.magnitudeSquared(e.subtract(i,P,I));if(H>B){var W=Math.sqrt(H);D=.5*(D+W),B=D*D;var q=W-D;P.x=(D*P.x+q*i.x)/W,P.y=(D*P.y+q*i.y)/W,P.z=(D*P.z+q*i.z)/W}}return D_.x&&e.clone(u,_),gO.y&&e.clone(u,O),wp.z&&e.clone(u,p)}var x=e.magnitudeSquared(e.subtract(_,E,I)),v=e.magnitudeSquared(e.subtract(O,s,I)),F=e.magnitudeSquared(e.subtract(p,c,I)),P=E,B=_,D=x;v>D&&(D=v,P=s,B=O),F>D&&(D=F,P=c,B=p);var z=S;z.x=.5*(P.x+B.x),z.y=.5*(P.y+B.y),z.z=.5*(P.z+B.z);var G=e.magnitudeSquared(e.subtract(B,z,I)),b=Math.sqrt(G),V=M;V.x=E.x,V.y=s.y,V.z=c.z;var X=y;X.x=_.x,X.y=O.y,X.z=p.z;var H=e.multiplyByScalar(e.add(V,X,I),.5,m),W=0;for(U=0;UW&&(W=q);var Y=e.magnitudeSquared(e.subtract(u,z,I));if(Y>G){var k=Math.sqrt(Y);b=.5*(b+k),G=b*b;var K=k-b;z.x=(b*z.x+K*u.x)/k,z.y=(b*z.y+K*u.y)/k,z.z=(b*z.z+K*u.z)/k}}return bs.x&&e.clone(a,s),Uc.y&&e.clone(a,c),L_.z&&e.clone(a,_)}var g=e.magnitudeSquared(e.subtract(s,o,I)),w=e.magnitudeSquared(e.subtract(c,u,I)),x=e.magnitudeSquared(e.subtract(_,E,I)),v=o,F=s,P=g;w>P&&(P=w,v=u,F=c),x>P&&(P=x,v=E,F=_);var B=S;B.x=.5*(v.x+F.x),B.y=.5*(v.y+F.y),B.z=.5*(v.z+F.z);var D=e.magnitudeSquared(e.subtract(F,B,I)),z=Math.sqrt(D),G=M;G.x=o.x,G.y=u.y,G.z=E.z;var b=y;b.x=s.x,b.y=c.y,b.z=_.z;var V=e.multiplyByScalar(e.add(G,b,I),.5,m),X=0;for(p=0;pX&&(X=H);var W=e.magnitudeSquared(e.subtract(a,B,I));if(W>D){var q=Math.sqrt(W);z=.5*(z+q),D=z*z;var Y=q-z;B.x=(z*B.x+Y*a.x)/q,B.y=(z*B.y+Y*a.y)/q,B.z=(z*B.z+Y*a.z)/q}}return z=c+E)return t.clone(i),i;if(E>=c+o)return n.clone(i),i;var _=.5*(o+c+E),T=e.multiplyByScalar(s,(-o+_)/c,B);return e.add(T,a,T),e.clone(T,i.center),i.radius=_,i};var D=new e;l.expand=function(t,n,r){r=l.clone(t,r);var i=e.magnitude(e.subtract(n,r.center,D));return i>r.radius&&(r.radius=i),r},l.intersectPlane=function(t,n){var r=t.center,i=t.radius,a=n.normal,o=e.dot(a,r)+n.distance;return o<-i?u.OUTSIDE:o0)r=Math.sqrt(f+1),s=.5*r,r=.5/r,i=(e[u.COLUMN1ROW2]-e[u.COLUMN2ROW1])*r,a=(e[u.COLUMN2ROW0]-e[u.COLUMN0ROW2])*r,o=(e[u.COLUMN0ROW1]-e[u.COLUMN1ROW0])*r;else{var A=c,h=0;T>l&&(h=1),R>l&&R>T&&(h=2);var d=A[h],N=A[d];r=Math.sqrt(e[u.getElementIndex(h,h)]-e[u.getElementIndex(d,d)]-e[u.getElementIndex(N,N)]+1);var I=_;I[h]=.5*r,r=.5/r,s=(e[u.getElementIndex(N,d)]-e[u.getElementIndex(d,N)])*r,I[d]=(e[u.getElementIndex(d,h)]+e[u.getElementIndex(h,d)])*r,I[N]=(e[u.getElementIndex(N,h)]+e[u.getElementIndex(h,N)])*r,i=-I[0],a=-I[1],o=-I[2]}return n(t)?(t.x=i,t.y=a,t.z=o,t.w=s,t):new E(i,a,o,s)};var l=new E;E.fromHeadingPitchRoll=function(t,n,r,i){var a=E.fromAxisAngle(e.UNIT_X,r,l),o=E.fromAxisAngle(e.UNIT_Y,-n,i);i=E.multiply(o,a,o);var u=E.fromAxisAngle(e.UNIT_Z,-t,l);return E.multiply(u,i,i)};var T=new e,R=new e,f=new E,A=new E,h=new E;E.packedLength=4,E.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},E.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new E),i.x=e[r],i.y=e[r+1],i.z=e[r+2],i.w=e[r+3],i},E.packedInterpolationLength=3,E.convertPackedArrayForInterpolation=function(e,t,n,r){E.unpack(e,4*n,h),E.conjugate(h,h);for(var i=0,a=n-t+1;i=0?i=1:(i=-1,a=-a);for(var o=a-1,u=1-n,s=n*n,c=u*u,_=7;_>=0;--_)g[_]=(U[_]*s-L[_])*o,w[_]=(U[_]*c-L[_])*o;var l=i*n*(1+g[0]*(1+g[1]*(1+g[2]*(1+g[3]*(1+g[4]*(1+g[5]*(1+g[6]*(1+g[7])))))))),T=u*(1+w[0]*(1+w[1]*(1+w[2]*(1+w[3]*(1+w[4]*(1+w[5]*(1+w[6]*(1+w[7])))))))),R=E.multiplyByScalar(e,T,p);return E.multiplyByScalar(t,l,r),E.add(R,r,r)},E.fastSquad=function(e,t,n,r,i,a){var o=E.fastSlerp(e,t,i,m),u=E.fastSlerp(n,r,i,O);return E.fastSlerp(o,u,2*i*(1-i),a)},E.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},E.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.x-t.x)<=r&&Math.abs(e.y-t.y)<=r&&Math.abs(e.z-t.z)<=r&&Math.abs(e.w-t.w)<=r},E.ZERO=a(new E(0,0,0,0)),E.IDENTITY=a(new E(0,0,0,1)),E.prototype.clone=function(e){return E.clone(this,e)},E.prototype.equals=function(e){return E.equals(this,e)},E.prototype.equalsEpsilon=function(e,t){return E.equalsEpsilon(this,e,t)},E.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},E}),define("Core/EllipseGeometryLibrary",["./Cartesian3","./Math","./Matrix3","./Quaternion"],function(e,t,n,r){"use strict";function i(t,i,a,c,_,l,T,R,f,A){var h=t+i;e.multiplyByScalar(c,Math.cos(h),o),e.multiplyByScalar(a,Math.sin(h),u),e.add(o,u,o);var d=Math.cos(t);d*=d;var N=Math.sin(t);N*=N;var I=l/Math.sqrt(T*d+_*N),S=I/R;return r.fromAxisAngle(o,S,E),n.fromQuaternion(E,s),n.multiplyByVector(s,f,A),e.normalize(A,A),e.multiplyByScalar(A,R,A),A}var a={},o=new e,u=new e,E=new r,s=new n,c=new e,_=new e,l=new e,T=new e;a.raisePositionsToHeight=function(t,n,r){for(var i=n.ellipsoid,a=n.height,o=n.extrudedHeight,u=r?t.length/3*2:t.length/3,E=new Float64Array(3*u),s=t.length,R=r?s:0,f=0;f1;--C){if(p=t.PI_OVER_TWO-(C-1)*O,P=i(-p,E,y,M,h,N,d,I,S,P),B=i(p+Math.PI,E,y,M,h,N,d,I,S,B),r){for(v[F++]=P.x,v[F++]=P.y,v[F++]=P.z,L=2*(C-1)+2,U=1;U=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},a.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)},n(a)}),define("Core/EllipseOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType"],function(e,t,n,r,i,a,o,u,E,s,c,_,l,T){"use strict";function R(r){var i=r.center;d=t.multiplyByScalar(r.ellipsoid.geodeticSurfaceNormal(i,d),r.height,d),d=t.add(i,d,d);for(var a=new e(d,r.semiMajorAxis),u=o.computeEllipsePositions(r,!1,!0).outerPositions,E=new c({position:new s({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:o.raisePositionsToHeight(u,r,!1)})}),l=u.length/3,T=_.createTypedArray(l,2*l),R=0,f=0;f0){var p=Math.min(S,d);O=Math.round(d/p);var C=Math.min(O*S,d);for(y=0;y1;this._center=t.clone(n),this._semiMajorAxis=o,this._semiMinorAxis=E,this._ellipsoid=u.clone(a),this._rotation=r(e.rotation,0),this._height=c,this._granularity=s,this._extrudedHeight=_,this._extrude=T,this._numberOfVerticalLines=Math.max(r(e.numberOfVerticalLines,16),0),this._workerName="createEllipseOutlineGeometry"}var h=new t,d=new t,N=new e,I=new e;A.packedLength=t.packedLength+u.packedLength+9,A.pack=function(e,n,a){return a=r(a,0),t.pack(e._center,n,a),a+=t.packedLength,u.pack(e._ellipsoid,n,a),a+=u.packedLength,n[a++]=e._semiMajorAxis,n[a++]=e._semiMinorAxis,n[a++]=e._rotation,n[a++]=e._height,n[a++]=e._granularity,n[a++]=i(e._extrudedHeight)?1:0,n[a++]=r(e._extrudedHeight,0),n[a++]=e._extrude?1:0,n[a]=e._numberOfVerticalLines,n};var S=new t,M=new u,y={center:S,ellipsoid:M,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0};return A.unpack=function(e,n,a){n=r(n,0);var o=t.unpack(e,n,S);n+=t.packedLength;var E=u.unpack(e,n,M);n+=u.packedLength;var s=e[n++],c=e[n++],_=e[n++],l=e[n++],T=e[n++],R=e[n++],f=e[n++],h=1===e[n++],d=e[n];return i(a)?(a._center=t.clone(o,a._center),a._ellipsoid=u.clone(E,a._ellipsoid),a._semiMajorAxis=s,a._semiMinorAxis=c,a._rotation=_,a._height=l,a._granularity=T,a._extrudedHeight=R?f:void 0,a._extrude=h,a._numberOfVerticalLines=d,a):(y.height=l,y.extrudedHeight=R?f:void 0,y.granularity=T,y.rotation=_,y.semiMajorAxis=s,y.semiMinorAxis=c,y.numberOfVerticalLines=d,new A(y))},A.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var t,n={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:e._height,extrudedHeight:e._extrudedHeight,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines};return e._extrude?(n.extrudedHeight=Math.min(e._extrudedHeight,e._height),n.height=Math.max(e._extrudedHeight,e._height),t=f(n)):t=R(n),new E({attributes:t.attributes,indices:t.indices,primitiveType:T.LINES,boundingSphere:t.boundingSphere})}},A}),define("Workers/createEllipseOutlineGeometry",["../Core/Cartesian3","../Core/defined","../Core/EllipseOutlineGeometry","../Core/Ellipsoid"],function(e,t,n,r){"use strict";function i(i,a){return t(a)&&(i=n.unpack(i,a)),i._center=e.clone(i._center),i._ellipsoid=r.clone(i._ellipsoid),n.createGeometry(i)}return i})}();