define(["exports","./Matrix2-5b4a06aa","./when-e3a49219","./RuntimeError-ffc802eb","./Transforms-c32992f8","./ComponentDatatype-64cf6611"],(function(t,n,a,r,e,o){"use strict";var s=Math.cos,i=Math.sin,g=Math.sqrt,u={computePosition:function(t,n,r,e,o,u,h){var c=n.radiiSquared,C=t.nwCorner,l=t.boundingRectangle,S=C.latitude-t.granYCos*e+o*t.granXSin,w=s(S),d=i(S),M=c.z*d,m=C.longitude+e*t.granYSin+o*t.granXCos,X=w*s(m),Y=w*i(m),f=c.x*X,p=c.y*Y,v=g(f*X+p*Y+M*d);if(u.x=f/v,u.y=p/v,u.z=M/v,r){var x=t.stNwCorner;a.defined(x)?(S=x.latitude-t.stGranYCos*e+o*t.stGranXSin,m=x.longitude+e*t.stGranYSin+o*t.stGranXCos,h.x=(m-t.stWest)*t.lonScalar,h.y=(S-t.stSouth)*t.latScalar):(h.x=(m-l.west)*t.lonScalar,h.y=(S-l.south)*t.latScalar)}}},h=new n.Matrix2,c=new n.Cartesian3,C=new n.Cartographic,l=new n.Cartesian3,S=new e.GeographicProjection;function w(t,a,r,e,o,s,i){var g=Math.cos(a),u=e*g,C=r*g,w=Math.sin(a),d=e*w,M=r*w;c=S.project(t,c),c=n.Cartesian3.subtract(c,l,c);var m=n.Matrix2.fromRotation(a,h);c=n.Matrix2.multiplyByVector(m,c,c),c=n.Cartesian3.add(c,l,c),s-=1,i-=1;var X=(t=S.unproject(c,t)).latitude,Y=X+s*M,f=X-u*i,p=X-u*i+s*M,v=Math.max(X,Y,f,p),x=Math.min(X,Y,f,p),R=t.longitude,G=R+s*C,y=R+i*d,O=R+i*d+s*C;return{north:v,south:x,east:Math.max(R,G,y,O),west:Math.min(R,G,y,O),granYCos:u,granYSin:d,granXCos:C,granXSin:M,nwCorner:t}}u.computeOptions=function(t,a,r,e,s,i,g){var u,h,c,d,M,m=t.east,X=t.west,Y=t.north,f=t.south,p=!1,v=!1;Y===o.CesiumMath.PI_OVER_TWO&&(p=!0),f===-o.CesiumMath.PI_OVER_TWO&&(v=!0);var x=Y-f;c=(M=X>m?o.CesiumMath.TWO_PI-X+m:m-X)/((u=Math.ceil(M/a)+1)-1),d=x/((h=Math.ceil(x/a)+1)-1);var R=n.Rectangle.northwest(t,i),G=n.Rectangle.center(t,C);0===r&&0===e||(G.longitude<R.longitude&&(G.longitude+=o.CesiumMath.TWO_PI),l=S.project(G,l));var y=d,O=c,b=n.Rectangle.clone(t,s),P={granYCos:y,granYSin:0,granXCos:O,granXSin:0,nwCorner:R,boundingRectangle:b,width:u,height:h,northCap:p,southCap:v};if(0!==r){var W=w(R,r,c,d,0,u,h);Y=W.north,f=W.south,m=W.east,X=W.west,P.granYCos=W.granYCos,P.granYSin=W.granYSin,P.granXCos=W.granXCos,P.granXSin=W.granXSin,b.north=Y,b.south=f,b.east=m,b.west=X}if(0!==e){r-=e;var _=n.Rectangle.northwest(b,g),T=w(_,r,c,d,0,u,h);P.stGranYCos=T.granYCos,P.stGranXCos=T.granXCos,P.stGranYSin=T.granYSin,P.stGranXSin=T.granXSin,P.stNwCorner=_,P.stWest=T.west,P.stSouth=T.south}return P},t.RectangleGeometryLibrary=u}));
|