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