/** * @license * Cesium - https://github.com/CesiumGS/cesium * Version 1.109.1 * * Copyright 2011-2022 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Columbus View (Pat. Pend.) * * Portions licensed separately. * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ import{a as p,b as P,c as q}from"./chunk-WADCMYQO.js";import{a}from"./chunk-2LQD2HPA.js";import{a as T}from"./chunk-3B6S2GOO.js";import{a as S,b as g}from"./chunk-EYEHMX6X.js";import{e as l}from"./chunk-BWKFPVR5.js";function y(t,i,e){if(0===t)return i*e;let a=t*t,n=a*a,s=n*a,l=s*a,h=l*a,o=h*a,u=e,d=Math.sin(2*u),r=Math.sin(4*u),c=Math.sin(6*u),g=Math.sin(8*u),_=Math.sin(10*u),p=Math.sin(12*u);return i*((1-a/4-3*n/64-5*s/256-175*l/16384-441*h/65536-4851*o/1048576)*u-(3*a/8+3*n/32+45*s/1024+105*l/4096+2205*h/131072+6237*o/524288)*d+(15*n/256+45*s/1024+525*l/16384+1575*h/65536+155925*o/8388608)*r-(35*s/3072+175*l/12288+3675*h/262144+13475*o/1048576)*c+(315*l/131072+2205*h/524288+43659*o/8388608)*g-(693*h/1310720+6237*o/5242880)*_+1001*o/8388608*p)}function z(t,i,e){let a=t/e;if(0===i)return a;let n=a*a,s=n*a,l=s*a,h=i,o=h*h,u=o*o,d=u*o,r=d*o,c=r*o,g=c*o,_=Math.sin(2*a),p=Math.cos(2*a),M=Math.sin(4*a),m=Math.cos(4*a),f=Math.sin(6*a),P=Math.cos(6*a),O=Math.sin(8*a),E=Math.cos(8*a),y=Math.sin(10*a),T=Math.cos(10*a),I=Math.sin(12*a);return a+a*o/4+7*a*u/64+15*a*d/256+579*a*r/16384+1515*a*c/65536+16837*a*g/1048576+(3*a*u/16+45*a*d/256-a*(32*n-561)*r/4096-a*(232*n-1677)*c/16384+a*(399985-90560*n+512*l)*g/5242880)*p+(21*a*d/256+483*a*r/4096-a*(224*n-1969)*c/16384-a*(33152*n-112599)*g/1048576)*m+(151*a*r/4096+4681*a*c/65536+1479*a*g/16384-453*s*g/32768)*P+(1097*a*c/65536+42783*a*g/1048576)*E+8011*a*g/1048576*T+(3*o/8+3*u/16+213*d/2048-3*n*d/64+255*r/4096-33*n*r/512+20861*c/524288-33*n*c/512+l*c/1024+28273*g/1048576-471*n*g/8192+9*l*g/4096)*_+(21*u/256+21*d/256+533*r/8192-21*n*r/512+197*c/4096-315*n*c/4096+584039*g/16777216-12517*n*g/131072+7*l*g/2048)*M+(151*d/6144+151*r/4096+5019*c/131072-453*n*c/16384+26965*g/786432-8607*n*g/131072)*f+(1097*r/131072+1097*c/65536+225797*g/10485760-1097*n*g/65536)*O+(8011*c/2621440+8011*g/1048576)*y+293393*g/251658240*I}function O(t,i){if(0===t)return Math.log(Math.tan(.5*(a.PI_OVER_TWO+i)));let e=t*Math.sin(i);return Math.log(Math.tan(.5*(a.PI_OVER_TWO+i)))-t/2*Math.log((1+e)/(1-e))}function G(t,i,e,n,s){let l=O(t._ellipticity,e),h=O(t._ellipticity,s);return Math.atan2(a.negativePiToPi(n-i),h-l)}function k(t,i,e,n,s,l,h){let o=t._heading,u=l-n,d=0;if(a.equalsEpsilon(Math.abs(o),a.PI_OVER_TWO,a.EPSILON8))if(i===e)d=i*Math.cos(s)*a.negativePiToPi(u);else{let e=Math.sin(s);d=i*Math.cos(s)*a.negativePiToPi(u)/Math.sqrt(1-t._ellipticitySquared*e*e)}else{let e=y(t._ellipticity,i,s);d=(y(t._ellipticity,i,h)-e)/Math.cos(o)}return Math.abs(d)}var A=new p,w=new p;function D(t,i,e,a){let n=p.normalize(a.cartographicToCartesian(i,w),A),s=p.normalize(a.cartographicToCartesian(e,w),w);g.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(p.angleBetween(n,s))-Math.PI),.0125);let l=a.maximumRadius,h=a.minimumRadius,o=l*l,u=h*h;t._ellipticitySquared=(o-u)/o,t._ellipticity=Math.sqrt(t._ellipticitySquared),t._start=P.clone(i,t._start),t._start.height=0,t._end=P.clone(e,t._end),t._end.height=0,t._heading=G(t,i.longitude,i.latitude,e.longitude,e.latitude),t._distance=k(t,a.maximumRadius,a.minimumRadius,i.longitude,i.latitude,e.longitude,e.latitude)}function W(t,i,e,n,s,h){if(0===e)return P.clone(t,h);let o,u,d,r=s*s;if(Math.abs(a.PI_OVER_TWO-Math.abs(i))>a.EPSILON8){let l=y(s,n,t.latitude),h=e*Math.cos(i),r=l+h;u=z(r,s,n);let c=O(s,t.latitude),g=O(s,u);d=Math.tan(i)*(g-c),o=a.negativePiToPi(t.longitude+d)}else{let l;if(u=t.latitude,0===s)l=n*Math.cos(t.latitude);else{let i=Math.sin(t.latitude);l=n*Math.cos(t.latitude)/Math.sqrt(1-r*i*i)}d=e/l,o=i>0?a.negativePiToPi(t.longitude+d):a.negativePiToPi(t.longitude-d)}return l(h)?(h.longitude=o,h.latitude=u,h.height=0,h):new P(o,u,0)}function m(t,i,e){let a=T(e,q.WGS84);this._ellipsoid=a,this._start=new P,this._end=new P,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,l(t)&&l(i)&&D(this,t,i,a)}Object.defineProperties(m.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}}}),m.fromStartHeadingDistance=function(t,i,e,n,s){g.defined("start",t),g.defined("heading",i),g.defined("distance",e),g.typeOf.number.greaterThan("distance",e,0);let h=T(n,q.WGS84),o=h.maximumRadius,u=h.minimumRadius,d=o*o,r=u*u,c=Math.sqrt((d-r)/d);i=a.negativePiToPi(i);let _=W(t,i,e,h.maximumRadius,c);return!l(s)||l(n)&&!n.equals(s.ellipsoid)?new m(t,_,h):(s.setEndPoints(t,_),s)},m.prototype.setEndPoints=function(t,i){g.defined("start",t),g.defined("end",i),D(this,t,i,this._ellipsoid)},m.prototype.interpolateUsingFraction=function(t,i){return this.interpolateUsingSurfaceDistance(t*this._distance,i)},m.prototype.interpolateUsingSurfaceDistance=function(t,i){if(g.typeOf.number("distance",t),!l(this._distance)||0===this._distance)throw new S("EllipsoidRhumbLine must have distinct start and end set.");return W(this._start,this._heading,t,this._ellipsoid.maximumRadius,this._ellipticity,i)},m.prototype.findIntersectionWithLongitude=function(t,i){if(g.typeOf.number("intersectionLongitude",t),!l(this._distance)||0===this._distance)throw new S("EllipsoidRhumbLine must have distinct start and end set.");let e=this._ellipticity,n=this._heading,s=Math.abs(n),h=this._start;if(t=a.negativePiToPi(t),a.equalsEpsilon(Math.abs(t),Math.PI,a.EPSILON14)&&(t=a.sign(h.longitude)*Math.PI),l(i)||(i=new P),Math.abs(a.PI_OVER_TWO-s)<=a.EPSILON8)return i.longitude=t,i.latitude=h.latitude,i.height=0,i;if(a.equalsEpsilon(Math.abs(a.PI_OVER_TWO-s),a.PI_OVER_TWO,a.EPSILON8))return a.equalsEpsilon(t,h.longitude,a.EPSILON12)?void 0:(i.longitude=t,i.latitude=a.PI_OVER_TWO*a.sign(a.PI_OVER_TWO-n),i.height=0,i);let o,u=h.latitude,d=e*Math.sin(u),r=Math.tan(.5*(a.PI_OVER_TWO+u))*Math.exp((t-h.longitude)/Math.tan(n)),c=(1+d)/(1-d),_=h.latitude;do{o=_;let t=e*Math.sin(o),i=(1+t)/(1-t);_=2*Math.atan(r*Math.pow(i/c,e/2))-a.PI_OVER_TWO}while(!a.equalsEpsilon(_,o,a.EPSILON12));return i.longitude=t,i.latitude=_,i.height=0,i},m.prototype.findIntersectionWithLatitude=function(t,i){if(g.typeOf.number("intersectionLatitude",t),!l(this._distance)||0===this._distance)throw new S("EllipsoidRhumbLine must have distinct start and end set.");let e=this._ellipticity,n=this._heading,s=this._start;if(a.equalsEpsilon(Math.abs(n),a.PI_OVER_TWO,a.EPSILON8))return;let h=O(e,s.latitude),o=O(e,t),u=Math.tan(n)*(o-h),d=a.negativePiToPi(s.longitude+u);return l(i)?(i.longitude=d,i.latitude=t,i.height=0,i):new P(d,t,0)};var $=m;export{$ as a};