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