| 1 |
- import{a as q}from"./chunk-CUQT2UK5.js";import{a as p,c as l}from"./chunk-I46SWINN.js";import{a as n}from"./chunk-LNIYJJXS.js";import{a as T}from"./chunk-4D2ERGZX.js";import{a as g}from"./chunk-EDZQSM3T.js";import{a as S}from"./chunk-PJGSCWXZ.js";import{a as M}from"./chunk-NUC3LT2W.js";function y(t,i,h){if(t===0)return i*h;var a=t*t,e=a*a,s=e*a,v=s*a,d=v*a,r=d*a,o=h,_=Math.sin(2*o),c=Math.sin(4*o),f=Math.sin(6*o),u=Math.sin(8*o),E=Math.sin(10*o),m=Math.sin(12*o);return i*((1-a/4-3*e/64-5*s/256-175*v/16384-441*d/65536-4851*r/1048576)*o-(3*a/8+3*e/32+45*s/1024+105*v/4096+2205*d/131072+6237*r/524288)*_+(15*e/256+45*s/1024+525*v/16384+1575*d/65536+155925*r/8388608)*c-(35*s/3072+175*v/12288+3675*d/262144+13475*r/1048576)*f+(315*v/131072+2205*d/524288+43659*r/8388608)*u-(693*d/1310720+6237*r/5242880)*E+1001*r/8388608*m)}function z(t,i,h){var a=t/h;if(i===0)return a;var e=a*a,s=e*a,v=s*a,d=i,r=d*d,o=r*r,_=o*r,c=_*r,f=c*r,u=f*r,E=Math.sin(2*a),m=Math.cos(2*a),I=Math.sin(4*a),V=Math.cos(4*a),C=Math.sin(6*a),N=Math.cos(6*a),x=Math.sin(8*a),b=Math.cos(8*a),R=Math.sin(10*a),U=Math.cos(10*a),H=Math.sin(12*a);return a+a*r/4+7*a*o/64+15*a*_/256+579*a*c/16384+1515*a*f/65536+16837*a*u/1048576+(3*a*o/16+45*a*_/256-a*(32*e-561)*c/4096-a*(232*e-1677)*f/16384+a*(399985-90560*e+512*v)*u/5242880)*m+(21*a*_/256+483*a*c/4096-a*(224*e-1969)*f/16384-a*(33152*e-112599)*u/1048576)*V+(151*a*c/4096+4681*a*f/65536+1479*a*u/16384-453*s*u/32768)*N+(1097*a*f/65536+42783*a*u/1048576)*b+8011*a*u/1048576*U+(3*r/8+3*o/16+213*_/2048-3*e*_/64+255*c/4096-33*e*c/512+20861*f/524288-33*e*f/512+v*f/1024+28273*u/1048576-471*e*u/8192+9*v*u/4096)*E+(21*o/256+21*_/256+533*c/8192-21*e*c/512+197*f/4096-315*e*f/4096+584039*u/16777216-12517*e*u/131072+7*v*u/2048)*I+(151*_/6144+151*c/4096+5019*f/131072-453*e*f/16384+26965*u/786432-8607*e*u/131072)*C+(1097*c/131072+1097*f/65536+225797*u/10485760-1097*e*u/65536)*x+(8011*f/2621440+8011*u/1048576)*R+293393*u/251658240*H}function O(t,i){if(t===0)return Math.log(Math.tan(.5*(n.PI_OVER_TWO+i)));var h=t*Math.sin(i);return Math.log(Math.tan(.5*(n.PI_OVER_TWO+i)))-t/2*Math.log((1+h)/(1-h))}function G(t,i,h,a,e){var s=O(t._ellipticity,h),v=O(t._ellipticity,e);return Math.atan2(n.negativePiToPi(a-i),v-s)}function k(t,i,h,a,e,s,v){var d=t._heading,r=s-a,o=0;if(n.equalsEpsilon(Math.abs(d),n.PI_OVER_TWO,n.EPSILON8))if(i===h)o=i*Math.cos(e)*n.negativePiToPi(r);else{var _=Math.sin(e);o=i*Math.cos(e)*n.negativePiToPi(r)/Math.sqrt(1-t._ellipticitySquared*_*_)}else{var c=y(t._ellipticity,i,e),f=y(t._ellipticity,i,v);o=(f-c)/Math.cos(d)}return Math.abs(o)}var A=new p,w=new p;function D(t,i,h,a){var e=p.normalize(a.cartographicToCartesian(i,w),A),s=p.normalize(a.cartographicToCartesian(h,w),w);g.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(p.angleBetween(e,s))-Math.PI),.0125);var v=a.maximumRadius,d=a.minimumRadius,r=v*v,o=d*d;t._ellipticitySquared=(r-o)/r,t._ellipticity=Math.sqrt(t._ellipticitySquared),t._start=l.clone(i,t._start),t._start.height=0,t._end=l.clone(h,t._end),t._end.height=0,t._heading=G(t,i.longitude,i.latitude,h.longitude,h.latitude),t._distance=k(t,a.maximumRadius,a.minimumRadius,i.longitude,i.latitude,h.longitude,h.latitude)}function W(t,i,h,a,e,s){var v=e*e,d,r,o;if(Math.abs(n.PI_OVER_TWO-Math.abs(i))>n.EPSILON8){var _=y(e,a,t.latitude),c=h*Math.cos(i),f=_+c;r=z(f,e,a);var u=O(e,t.latitude),E=O(e,r);o=Math.tan(i)*(E-u),d=n.negativePiToPi(t.longitude+o)}else{r=t.latitude;var m;if(e===0)m=a*Math.cos(t.latitude);else{var I=Math.sin(t.latitude);m=a*Math.cos(t.latitude)/Math.sqrt(1-v*I*I)}o=h/m,i>0?d=n.negativePiToPi(t.longitude+o):d=n.negativePiToPi(t.longitude-o)}return M(s)?(s.longitude=d,s.latitude=r,s.height=0,s):new l(d,r,0)}function P(t,i,h){var a=T(h,q.WGS84);this._ellipsoid=a,this._start=new l,this._end=new l,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,M(t)&&M(i)&&D(this,t,i,a)}Object.defineProperties(P.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return g.defined("distance",this._distance),this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return g.defined("distance",this._distance),this._heading}}});P.fromStartHeadingDistance=function(t,i,h,a,e){g.defined("start",t),g.defined("heading",i),g.defined("distance",h),g.typeOf.number.greaterThan("distance",h,0);var s=T(a,q.WGS84),v=s.maximumRadius,d=s.minimumRadius,r=v*v,o=d*d,_=Math.sqrt((r-o)/r);i=n.negativePiToPi(i);var c=W(t,i,h,s.maximumRadius,_);return!M(e)||M(a)&&!a.equals(e.ellipsoid)?new P(t,c,s):(e.setEndPoints(t,c),e)};P.prototype.setEndPoints=function(t,i){g.defined("start",t),g.defined("end",i),D(this,t,i,this._ellipsoid)};P.prototype.interpolateUsingFraction=function(t,i){return this.interpolateUsingSurfaceDistance(t*this._distance,i)};P.prototype.interpolateUsingSurfaceDistance=function(t,i){if(g.typeOf.number("distance",t),!M(this._distance)||this._distance===0)throw new S("EllipsoidRhumbLine must have distinct start and end set.");return W(this._start,this._heading,t,this._ellipsoid.maximumRadius,this._ellipticity,i)};P.prototype.findIntersectionWithLongitude=function(t,i){if(g.typeOf.number("intersectionLongitude",t),!M(this._distance)||this._distance===0)throw new S("EllipsoidRhumbLine must have distinct start and end set.");var h=this._ellipticity,a=this._heading,e=Math.abs(a),s=this._start;if(t=n.negativePiToPi(t),n.equalsEpsilon(Math.abs(t),Math.PI,n.EPSILON14)&&(t=n.sign(s.longitude)*Math.PI),M(i)||(i=new l),Math.abs(n.PI_OVER_TWO-e)<=n.EPSILON8)return i.longitude=t,i.latitude=s.latitude,i.height=0,i;if(n.equalsEpsilon(Math.abs(n.PI_OVER_TWO-e),n.PI_OVER_TWO,n.EPSILON8))return n.equalsEpsilon(t,s.longitude,n.EPSILON12)?void 0:(i.longitude=t,i.latitude=n.PI_OVER_TWO*n.sign(n.PI_OVER_TWO-a),i.height=0,i);var v=s.latitude,d=h*Math.sin(v),r=Math.tan(.5*(n.PI_OVER_TWO+v))*Math.exp((t-s.longitude)/Math.tan(a)),o=(1+d)/(1-d),_=s.latitude,c;do{c=_;var f=h*Math.sin(c),u=(1+f)/(1-f);_=2*Math.atan(r*Math.pow(u/o,h/2))-n.PI_OVER_TWO}while(!n.equalsEpsilon(_,c,n.EPSILON12));return i.longitude=t,i.latitude=_,i.height=0,i};P.prototype.findIntersectionWithLatitude=function(t,i){if(g.typeOf.number("intersectionLatitude",t),!M(this._distance)||this._distance===0)throw new S("EllipsoidRhumbLine must have distinct start and end set.");var h=this._ellipticity,a=this._heading,e=this._start;if(!n.equalsEpsilon(Math.abs(a),n.PI_OVER_TWO,n.EPSILON8)){var s=O(h,e.latitude),v=O(h,t),d=Math.tan(a)*(v-s),r=n.negativePiToPi(e.longitude+d);return M(i)?(i.longitude=r,i.latitude=t,i.height=0,i):new l(r,t,0)}};var $=P;export{$ as a};
|