define(["exports","./Cartographic-1d953166","./Math-7f5f2992","./FeatureDetection-4281d393","./GeometryAttribute-95780fd1"],(function(t,e,r,a,i){"use strict";var n={},o=new e.t,l=new e.t,y=new i.n,s=new a.p;function c(t,r,n,c,u,x,f,h,m,z){var d=t+r;e.t.multiplyByScalar(c,Math.cos(d),o),e.t.multiplyByScalar(n,Math.sin(d),l),e.t.add(o,l,o);var p=Math.cos(t);p*=p;var _=Math.sin(t);_*=_;var v=x/Math.sqrt(f*p+u*_)/h;return i.n.fromAxisAngle(o,v,y),a.p.fromQuaternion(y,s),a.p.multiplyByVector(s,m,z),e.t.normalize(z,z),e.t.multiplyByScalar(z,h,z),z}var u=new e.t,x=new e.t,f=new e.t,h=new e.t;n.raisePositionsToHeight=function(t,r,a){for(var i=r.ellipsoid,n=r.height,o=r.extrudedHeight,l=a?t.length/3*2:t.length/3,y=new Float64Array(3*l),s=t.length,c=a?s:0,m=0;m<s;m+=3){var z=m+1,d=m+2,p=e.t.fromArray(t,m,u);i.scaleToGeodeticSurface(p,p);var _=e.t.clone(p,x),v=i.geodeticSurfaceNormal(p,h),O=e.t.multiplyByScalar(v,n,f);e.t.add(p,O,p),a&&(e.t.multiplyByScalar(v,o,O),e.t.add(_,O,_),y[m+c]=_.x,y[z+c]=_.y,y[d+c]=_.z),y[m]=p.x,y[z]=p.y,y[d]=p.z}return y};var m=new e.t,z=new e.t,d=new e.t;n.computeEllipsePositions=function(t,a,i){var n=t.semiMinorAxis,o=t.semiMajorAxis,l=t.rotation,y=t.center,s=8*t.granularity,h=n*n,p=o*o,_=o*n,v=e.t.magnitude(y),O=e.t.normalize(y,m),w=e.t.cross(e.t.UNIT_Z,y,z);w=e.t.normalize(w,w);var P=e.t.cross(O,w,d),M=1+Math.ceil(r.e.PI_OVER_TWO/s),g=r.e.PI_OVER_TWO/(M-1),I=r.e.PI_OVER_TWO-M*g;I<0&&(M-=Math.ceil(Math.abs(I)/g));var T,A,E,V,R,W=a?new Array(3*(M*(M+2)*2)):void 0,S=0,B=u,b=x,C=4*M*3,F=C-1,G=0,H=i?new Array(C):void 0;for(B=c(I=r.e.PI_OVER_TWO,l,P,w,h,_,p,v,O,B),a&&(W[S++]=B.x,W[S++]=B.y,W[S++]=B.z),i&&(H[F--]=B.z,H[F--]=B.y,H[F--]=B.x),I=r.e.PI_OVER_TWO-g,T=1;T<M+1;++T){if(B=c(I,l,P,w,h,_,p,v,O,B),b=c(Math.PI-I,l,P,w,h,_,p,v,O,b),a){for(W[S++]=B.x,W[S++]=B.y,W[S++]=B.z,E=2*T+2,A=1;A<E-1;++A)V=A/(E-1),R=e.t.lerp(B,b,V,f),W[S++]=R.x,W[S++]=R.y,W[S++]=R.z;W[S++]=b.x,W[S++]=b.y,W[S++]=b.z}i&&(H[F--]=B.z,H[F--]=B.y,H[F--]=B.x,H[G++]=b.x,H[G++]=b.y,H[G++]=b.z),I=r.e.PI_OVER_TWO-(T+1)*g}for(T=M;T>1;--T){if(B=c(-(I=r.e.PI_OVER_TWO-(T-1)*g),l,P,w,h,_,p,v,O,B),b=c(I+Math.PI,l,P,w,h,_,p,v,O,b),a){for(W[S++]=B.x,W[S++]=B.y,W[S++]=B.z,E=2*(T-1)+2,A=1;A<E-1;++A)V=A/(E-1),R=e.t.lerp(B,b,V,f),W[S++]=R.x,W[S++]=R.y,W[S++]=R.z;W[S++]=b.x,W[S++]=b.y,W[S++]=b.z}i&&(H[F--]=B.z,H[F--]=B.y,H[F--]=B.x,H[G++]=b.x,H[G++]=b.y,H[G++]=b.z)}B=c(-(I=r.e.PI_OVER_TWO),l,P,w,h,_,p,v,O,B);var N={};return a&&(W[S++]=B.x,W[S++]=B.y,W[S++]=B.z,N.positions=W,N.numPts=M),i&&(H[F--]=B.z,H[F--]=B.y,H[F--]=B.x,N.outerPositions=H),N},t.C=n}));
