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