ootk 1.0.3 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -26
- package/LICENSE.MD +21 -21
- package/README.md +128 -128
- package/asc/asconfig.json +22 -0
- package/asc/assembly/index.ts +1143 -0
- package/asc/ex/asconfig.json +22 -0
- package/asc/ex/assembly/index.ts +5 -0
- package/asc/ex/index.html +10 -0
- package/asc/ex/package.json +19 -0
- package/asc/ex/tests/index.js +4 -0
- package/asc/package.json +19 -0
- package/asc/tests/index.js +4 -0
- package/codecov.yml +21 -0
- package/{lib/ootk.es.d.ts → dist/ootk.d.ts} +3 -4
- package/dist/ootk.js +1 -3850
- package/{lib/ootk-sgp4.es.d.ts → dist/sgp4.d.ts} +6 -140
- package/dist/transforms.d.ts +58 -0
- package/dist/utils.d.ts +33 -0
- package/lib/{ootk.es.js → ootk.d.ts} +3 -4
- package/lib/{ootk-utils.es.d.ts → ootk.js} +6 -11
- package/lib/ootk.js.map +1 -0
- package/lib/sgp4.d.ts +89 -0
- package/lib/{ootk-sgp4.es.js → sgp4.js} +545 -528
- package/lib/sgp4.js.map +1 -0
- package/lib/transforms.d.ts +58 -0
- package/lib/{ootk-transforms.es.js → transforms.js} +3 -3
- package/lib/transforms.js.map +1 -0
- package/lib/utils/constants.d.ts +30 -0
- package/lib/utils/constants.js +31 -0
- package/lib/utils/constants.js.map +1 -0
- package/lib/utils/types.d.ts +164 -0
- package/lib/utils/types.js +2 -0
- package/lib/utils/types.js.map +1 -0
- package/lib/utils.d.ts +33 -0
- package/lib/{ootk-utils.es.js → utils.js} +12 -5
- package/lib/utils.js.map +1 -0
- package/package.json +17 -17
- package/sandbox.html +8 -0
- package/dist/ootk-sgp4.js +0 -3471
- package/dist/ootk-sgp4.min.js +0 -34
- package/dist/ootk-transforms.js +0 -340
- package/dist/ootk-transforms.min.js +0 -1
- package/dist/ootk-utils.js +0 -149
- package/dist/ootk-utils.min.js +0 -1
- package/dist/ootk.min.js +0 -60
- package/lib/ootk-transforms.es.d.ts +0 -141
package/dist/ootk.min.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
!function(t,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define([],o):"object"==typeof exports?exports.Ootk=o():t.Ootk=o()}(this,(function(){return(()=>{"use strict";var t={392:(t,o,s)=>{s.d(o,{Sgp4:()=>Oe});
|
|
2
|
-
/**
|
|
3
|
-
* @author Theodore Kruczek.
|
|
4
|
-
* @description Orbital Object ToolKit (OOTK) is a collection of tools for working
|
|
5
|
-
* with satellites and other orbital objects.
|
|
6
|
-
*
|
|
7
|
-
* @file The Sgp4 module contains a TypeScript port of the 2020 version of
|
|
8
|
-
* sgp4unit.cpp from "Fundamentals of Astrodynamics and Applications" by David
|
|
9
|
-
* Vallado. All of the original comments and notes are inserted in the code below
|
|
10
|
-
* in order provide context to the functions and clarify any adjustments made for
|
|
11
|
-
* TypeScript/JavaScript compatibility.
|
|
12
|
-
*
|
|
13
|
-
* @copyright MIT License.
|
|
14
|
-
* Copyright (c) 2020-2021 Theodore Kruczek
|
|
15
|
-
*
|
|
16
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
17
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
18
|
-
* in the Software without restriction, including without limitation the rights
|
|
19
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
20
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
21
|
-
* furnished to do so, subject to the following conditions:
|
|
22
|
-
*
|
|
23
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
24
|
-
* copies or substantial portions of the Software.
|
|
25
|
-
*
|
|
26
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
27
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
28
|
-
* FIT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Da,Na,_a,Aa,Ba,Ga,Ha,Ja,Ka,Qa,Va,Wa,Xa,Ya,Za,$a,te,oe,se,ae,ee,ne,de,re,ie,ce,he,me,le=Math.PI,pe=2*le,Me=le/180,xe=2/3,ge=1440/(2*le),ue=.01675,fe=.0549,ze=.0043752690880113,ye=.00015835218,be=119459e-10,ve=15e-13,we=.13130908,qe=2.8843198,je=.37448087,ke=5.7686396,Pe=.95240898,Ie=1.8014998,Fe=1.050833,Se=4.4108898,Le=259200,Oe=function(){function t(){}return t.dpper=function(t,o){var s=t.e3,a=t.ee2,e=t.peo,n=t.pgho,d=t.pho,r=t.PInco,i=t.plo,c=t.se2,h=t.se3,m=t.sgh2,p=t.sgh3,M=t.sgh4,x=t.sh2,g=t.sh3,u=t.si2,f=t.si3,z=t.sl2,y=t.sl3,b=t.sl4,q=t.t,j=t.xgh2,k=t.xgh3,P=t.xgh4,I=t.xh2,F=t.xh3,S=t.xi2,L=t.xi3,O=t.xl2,E=t.xl3,R=t.xl4,T=t.zmol,U=t.zmos,C=o.ep,D=o.inclp,N=o.nodep,_=o.argpp,A=o.mp,B=o.opsmode,G=void 0===B?Hs:B,H=o.init;return Ua=U+be*q,"y"===H&&(Ua=U),Ta=Ua+2*ue*Math.sin(Ua),Oa=Math.sin(Ta),ka=.5*Oa*Oa-.25,Pa=-.5*Oa*Math.cos(Ta),Zs=c*ka+h*Pa,$s=u*ka+f*Pa,ta=z*ka+y*Pa+b*Oa,oa=m*ka+p*Pa+M*Oa,sa=x*ka+g*Pa,Ua=T+ye*q,"y"===H&&(Ua=T),Ta=Ua+2*fe*Math.sin(Ua),Oa=Math.sin(Ta),ka=.5*Oa*Oa-.25,Pa=-.5*Oa*Math.cos(Ta),Ia=Zs+(a*ka+s*Pa),La=$s+(S*ka+L*Pa),l=ta+(O*ka+E*Pa+R*Oa),Fa=oa+(j*ka+k*Pa+P*Oa),Sa=sa+(I*ka+F*Pa),"n"===H&&(l-=i,Fa-=n,Sa-=d,D+=La-=r,C+=Ia-=e,w=Math.sin(D),v=Math.cos(D),D>=.2?(_+=Fa-=v*(Sa/=w),N+=Sa,A+=l):(ja=Math.sin(N),qa=Math.cos(N),va=w*ja,wa=w*qa,va+=Sa*qa+La*v*ja,wa+=-Sa*ja+La*v*qa,(N%=pe)<0&&"a"===G&&(N+=pe),Ea=A+_+v*N,Ea+=l+Fa-La*N*w,Ra=N,(N=Math.atan2(va,wa))<0&&"a"===G&&(N+=pe),Math.abs(Ra-N)>le&&(N<Ra?N+=pe:N-=pe),_=Ea-(A+=l)-v*N)),{ep:C,inclp:D,nodep:N,argpp:_,mp:A}},t.dscom=function(t){var o=t.epoch,s=t.ep,a=t.argpp,e=t.tc,n=t.inclp,d=t.nodep,r=t.np;A=r,Z=s,bt=Math.sin(d),vt=Math.cos(d),wt=Math.sin(a),qt=Math.cos(a),et=Math.sin(n),at=Math.cos(n),jt=1-(Ga=Z*Z),kt=Math.sqrt(jt),0,0,0,0,0,fa=(4.523602-.00092422029*(qs=o+18261.5+e/1440))%pe,ha=Math.sin(fa),ra=Math.cos(fa),ia=.91375164-.03568096*ra,la=Math.sqrt(1-ia*ia),ca=.089683511*ha/la,xa=Math.sqrt(1-ca*ca),pa=5.8351514+.001944368*qs;var i=.39785416*ha/la;for(Ma=xa*ra+.91744867*ca*ha,i=Math.atan2(i,Ma),i+=pa-fa,ua=Math.cos(i),ma=Math.sin(i),Kt=.1945905,Qt=-.98088458,Xt=.91744867,Yt=.39785416,Vt=vt,Wt=bt,Ct=29864797e-13,ga=1/A,ae=1;ae<=2;ae++)Io=-6*(Pt=Kt*Vt+Qt*Xt*Wt)*(Lt=-et*(Et=-Kt*Wt+Qt*Xt*Vt)+at*(Rt=Qt*Yt))+Ga*(-24*(Dt=Pt*qt+(It=at*Et+et*Rt)*wt)*(Ht=Lt*qt)-6*(_t=-Pt*wt+It*qt)*(Bt=Lt*wt)),Fo=-6*(Pt*(Ot=-et*(Tt=Qt*Wt+Kt*Xt*Vt)+at*(Ut=Kt*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2*to*ro,sl3:-2*to*(io-no),sl4:-2*to*(-21-9*Ga)*ue,s1:fo,s2:zo,s3:yo,s4:bo,s5:vo,s6:wo,s7:qo,ss1:Zt,ss2:$t,ss3:to,ss4:oo,ss5:so,ss6:ao,ss7:eo,sz1:no,sz2:ro,sz3:io,sz11:co,sz12:ho,sz13:mo,sz21:lo,sz22:po,sz23:Mo,sz31:xo,sz32:go,sz33:uo,xgh2:2*bo*To,xgh3:2*bo*(Uo-Ro),xgh4:-18*bo*fe,xh2:-2*zo*Oo,xh3:-2*zo*(Eo-Lo),xi2:2*zo*Fo,xi3:2*zo*(So-Io),xl2:-2*yo*ko,xl3:-2*yo*(Po-jo),xl4:-2*yo*(-21-9*Ga)*fe,nm:A,z1:jo,z2:ko,z3:Po,z11:Io,z12:Fo,z13:So,z21:Lo,z22:Oo,z23:Eo,z31:Ro,z32:To,z33:Uo,zmol:(.2299715*qs-pa+4.7199672)%pe,zmos:(6.2565837+.017201977*qs)%pe}},t.dsinit=function(t){var o=t.xke,s=t.cosim,a=t.argpo,e=t.s1,n=t.s2,d=t.s3,r=t.s4,i=t.s5,c=t.sinim,h=t.ss1,m=t.ss2,l=t.ss3,p=t.ss4,M=t.ss5,x=t.sz1,g=t.sz3,u=t.sz11,f=t.sz13,z=t.sz21,y=t.sz23,b=t.sz31,v=t.sz33,w=t.t,j=t.tc,k=t.gsto,P=t.mo,I=t.mdot,F=t.no,S=t.nodeo,L=t.nodedot,O=t.xPIdot,E=t.z1,R=t.z3,U=t.z11,C=t.z13,D=t.z21,N=t.z23,_=t.z31,A=t.z33,B=t.ecco,G=t.eccsq,H=t.emsq,J=t.em,K=t.argpm,Q=t.inclm,V=t.mm,W=t.nm,X=t.nodem,Y=t.irez,Z=t.atime,$=t.d2201,tt=t.d2211,ot=t.d3210,st=t.d3222,at=t.d4410,et=t.d4422,nt=t.d5220,dt=t.d5232,rt=t.d5421,it=t.d5433,ct=t.dedt,mt=t.didt,lt=t.dmdt,pt=t.dnodt,Mt=t.domdt,xt=t.del1,gt=t.del2,ut=t.del3,ft=t.xfact,yt=t.xlamo,bt=t.xli,vt=t.xni;Y=0,W<.0052359877&&W>.0034906585&&(Y=1),W>=.00826&&W<=.00924&&J>=.5&&(Y=2);var wt=-be*m*(z+y);(Q<.052359877||Q>le-.052359877)&&(wt=0),0!==c&&(wt/=c);var qt=-ye*n*(D+N);return(Q<.052359877||Q>le-.052359877)&&(qt=0),Mt=(oa=p*be*(b+v-6))-s*wt+r*ye*(_+A-6),pt=wt,0!==c&&(Mt-=s/c*qt,pt+=qt/c),ht=0,zt=(k+j*ze)%pe,J+=(ct=(Zs=h*be*M)+e*ye*i)*w,Q+=(mt=($s=m*be*(u+f))+n*ye*(U+C))*w,K+=Mt*w,X+=pt*w,V+=(lt=(ta=-be*l*(x+g-14-6*H))-ye*d*(E+R-14-6*H))*w,0!==Y&&(Xo=Math.pow(W/o,xe),2===Y&&(za=J,ya=H,ba=(J=B)*(H=G),J<=.65?(No=3.616-13.247*J+16.29*H,_o=117.39*J-19.302-228.419*H+156.591*ba,Ao=109.7927*J-18.9068-214.6334*H+146.5816*ba,Bo=242.694*J-41.122-471.094*H+313.953*ba,Go=841.88*J-146.407-1629.014*H+1083.435*ba,Ho=3017.977*J-532.114-5740.032*H+3708.276*ba):(No=331.819*J-72.099-508.738*H+266.724*ba,_o=1582.851*J-346.844-2415.925*H+1246.113*ba,Ao=1554.908*J-342.585-2366.899*H+1215.972*ba,Bo=4758.686*J-1052.797-7193.992*H+3651.957*ba,Go=16178.11*J-3581.69-24462.77*H+12422.52*ba,Ho=J>.715?29936.92*J-5149.66-54087.36*H+31324.56*ba:1464.74-4664.75*J+3763.64*H),J<.7?(Qo=4988.61*J-919.2277-9064.77*H+5542.21*ba,Jo=4568.6173*J-822.71072-8491.4146*H+5337.524*ba,Ko=4690.25*J-853.666-8624.77*H+5341.4*ba):(Qo=161616.52*J-37995.78-229838.2*H+109377.94*ba,Jo=218913.95*J-51752.104-309468.16*H+146349.42*ba,Ko=170470.89*J-40023.88-242699.48*H+115605.82*ba),$=(T=17891679e-13*(Wo=3*(W*W)*(Xo*Xo)))*(Co=.75*(1+2*s+(q=s*s)))*(-.306-.44*(J-.64)),tt=T*(1.5*(Vo=c*c))*No,ot=(T=3.7393792e-7*(Wo*=Xo))*(1.875*c*(1-2*s-3*q))*_o,st=T*(-1.875*c*(1+2*s-3*q))*Ao,at=(T=2*(Wo*=Xo)*7.3636953e-9)*(35*Vo*Co)*Bo,et=T*(39.375*Vo*Vo)*Go,nt=(T=1.1428639e-7*(Wo*=Xo))*(9.84375*c*(Vo*(1-2*s-5*q)+.33333333*(4*s-2+6*q)))*Ho,dt=T*(c*(4.92187512*Vo*(-2-4*s+10*q)+6.56250012*(1+2*s-3*q)))*Ko,rt=(T=2*Wo*2.1765803e-9)*(29.53125*c*(2-8*s+q*(8*s-12+10*q)))*Jo,it=T*(29.53125*c*(-2-8*s+q*(12+8*s-10*q)))*Qo,yt=(P+S+S-(zt+zt))%pe,ft=I+lt+2*(L+pt-ze)-F,J=za,H=ya),1===Y&&(Do=1+s,gt=2*(xt=3*W*W*Xo*Xo)*(Co=.75*(1+s)*(1+s))*(1+H*(.8125*H-2.5))*17891679e-13,ut=3*xt*(Do*=1.875*Do*Do)*(1+H*(6.60937*H-6))*2.2123015e-7*Xo,xt=xt*(.9375*c*c*(1+3*s)-.75*(1+s))*(_o=1+2*H)*21460748e-13*Xo,yt=(P+S+a-zt)%pe,ft=I+O+lt+Mt+pt-(F+ze)),bt=yt,vt=F,Z=0,W=F+ht),{em:J,argpm:K,inclm:Q,mm:V,nm:W,nodem:X,irez:Y,atime:Z,d2201:$,d2211:tt,d3210:ot,d3222:st,d4410:at,d4422:et,d5220:nt,d5232:dt,d5421:rt,d5433:it,dedt:ct,didt:mt,dmdt:lt,dndt:ht,dnodt:pt,domdt:Mt,del1:xt,del2:gt,del3:ut,xfact:ft,xlamo:yt,xli:bt,xni:vt}},t.dspace=function(t){var o=t.irez,s=t.d2201,a=t.d2211,e=t.d3210,d=t.d3222,r=t.d4410,i=t.d4422,c=t.d5220,h=t.d5232,m=t.d5421,l=t.d5433,p=t.dedt,M=t.del1,x=t.del2,g=t.del3,u=t.didt,f=t.dmdt,z=t.dnodt,y=t.domdt,b=t.argpo,v=t.argpdot,w=t.t,q=t.tc,j=t.gsto,k=t.xfact,P=t.xlamo,I=t.no,F=t.atime,S=t.em,L=t.argpm,O=t.inclm,E=t.xli,R=t.mm,T=t.xni,U=t.nodem,C=t.nm;if(ht=0,zt=(j+q*ze)%pe,S+=p*w,O+=u*w,L+=y*w,U+=z*w,R+=f*w,0!==o){(0===F||w*F<=0||Math.abs(w)<Math.abs(F))&&(F=0,T=I,E=P),lt=w>0?720:-720;for(var D=381;381===D;)2!==o?(pt=M*Math.sin(E-we)+x*Math.sin(2*(E-qe))+g*Math.sin(3*(E-je)),Mt=T+k,xt=M*Math.cos(E-we)+2*x*Math.cos(2*(E-qe))+3*g*Math.cos(3*(E-je)),xt*=Mt):(gt=(ut=b+v*F)+ut,ft=E+E,pt=s*Math.sin(gt+E-ke)+a*Math.sin(E-ke)+e*Math.sin(ut+E-Pe)+d*Math.sin(-ut+E-Pe)+r*Math.sin(gt+ft-Ie)+i*Math.sin(ft-Ie)+c*Math.sin(ut+E-Fe)+h*Math.sin(-ut+E-Fe)+m*Math.sin(ut+ft-Se)+l*Math.sin(-ut+ft-Se),Mt=T+k,xt=s*Math.cos(gt+E-ke)+a*Math.cos(E-ke)+e*Math.cos(ut+E-Pe)+d*Math.cos(-ut+E-Pe)+c*Math.cos(ut+E-Fe)+h*Math.cos(-ut+E-Fe)+2*r*Math.cos(gt+ft-Ie)+i*Math.cos(ft-Ie)+m*Math.cos(ut+ft-Se)+l*Math.cos(-ut+ft-Se),xt*=Mt),Math.abs(w-F)>=720?D=381:(mt=w-F,D=0),381===D&&(E+=Mt*lt+pt*Le,T+=pt*lt+xt*Le,F+=lt);C=T+pt*mt+xt*mt*mt*.5,n=E+Mt*mt+pt*mt*mt*.5,1!==o?(R=n-2*U+2*zt,ht=C-I):(R=n-U-L+zt,ht=C-I),C=I+ht}return{atime:F,em:S,argpm:L,inclm:O,xli:E,mm:R,xni:T,nodem:U,dndt:ht,nm:C}},t.initl=function(o){var s=o.opsmode,a=o.ecco,e=o.epoch,n=o.inclo,d=o.xke,r=o.j2,i=o.no;Ks=1-(Js=a*a),Qs=Math.sqrt(Ks),Os=Math.cos(n),_s=Os*Os,Vs=Math.pow(d/i,xe);var c=(Ws=.75*r*(3*_s-1)/(Qs*Ks))/(Vs*Vs);return i/=1+(c=Ws/((Xs=Vs*(1-c*c-c*(1/3+134*c*c/81)))*Xs)),vs=Math.pow(d/i,xe),Cs=Math.sin(n),aa=-(Ns=1-5*_s)-_s-_s,ea=1/vs,na=(Ys=vs*Ks)*Ys,da=vs*(1-a),"n","a"==s?(rt=e-7305,it=Math.floor(rt+1e-8),1.7321343856509375,5075514194322695e-30,(se=(1.7321343856509375+(ct=.017202791694070362)*it+(ct+pe)*(rt-it)+rt*rt*5075514194322695e-30)%pe)<0&&(se+=pe)):se=t.gstime(e+2433281.5),{no:i,method:"n",ainv:ea,ao:vs,con41:aa,con42:Ns,cosio:Os,cosio2:_s,eccsq:Js,omeosq:Ks,posq:na,rp:da,rteosq:Qs,sinio:Cs,gsto:se}},t.sgp4init=function(o,s){var a=s.whichconst,e=void 0===a?"wgs72":a,n=s.opsmode,d=void 0===n?Hs:n,r=s.satn,i=void 0===r?o.satnum:r,c=s.epoch,h=s.xbstar,m=s.xecco,l=s.xargpo,p=s.xinclo,M=s.xndot,x=s.xnddot,g=s.xmo,u=s.xno,f=s.xnodeo;o.isimp=0,o.method="n",o.aycof=0,o.con41=0,o.cc1=0,o.cc4=0,o.cc5=0,o.d2=0,o.d3=0,o.d4=0,o.delmo=0,o.eta=0,o.argpdot=0,o.omgcof=0,o.sinmao=0,o.t=0,o.t2cof=0,o.t3cof=0,o.t4cof=0,o.t5cof=0,o.x1mth2=0,o.x7thm1=0,o.mdot=0,o.nodedot=0,o.xlcof=0,o.xmcof=0,o.nodecf=0,o.irez=0,o.d2201=0,o.d2211=0,o.d3210=0,o.d3222=0,o.d4410=0,o.d4422=0,o.d5220=0,o.d5232=0,o.d5421=0,o.d5433=0,o.dedt=0,o.del1=0,o.del2=0,o.del3=0,o.didt=0,o.dmdt=0,o.dnodt=0,o.domdt=0,o.e3=0,o.ee2=0,o.peo=0,o.pgho=0,o.pho=0,o.PInco=0,o.plo=0,o.se2=0,o.se3=0,o.sgh2=0,o.sgh3=0,o.sgh4=0,o.sh2=0,o.sh3=0,o.si2=0,o.si3=0,o.sl2=0,o.sl3=0,o.sl4=0,o.gsto=0,o.xfact=0,o.xgh2=0,o.xgh3=0,o.xgh4=0,o.xh2=0,o.xh3=0,o.xi2=0,o.xi3=0,o.xl2=0,o.xl3=0,o.xl4=0,o.xlamo=0,o.zmol=0,o.zmos=0,o.atime=0,o.xli=0,o.xni=0;var z=t.getgravconst(e);o.tumin=z.tumin,o.mus=z.mus,o.radiusearthkm=z.radiusearthkm,o.xke=z.xke,o.j2=z.j2,o.j3=z.j3,o.j4=z.j4,o.j3oj2=z.j3oj2,o.error=0,o.operationmode=d,oe=i.split("")[0].toLowerCase(),isNaN(oe)?o.satnum=parseInt(oe.charCodeAt(0)-96+9+o.satnum.slice(1,5)).toString():o.satnum=i,o.bstar=h,o.ndot=M,o.nddot=x,o.ecco=m,o.argpo=l,o.inclo=p,o.mo=g,o.no=u,o.nodeo=f,Ps=78/o.radiusearthkm+1,Fs=42/o.radiusearthkm,Ds=Fs*Fs*Fs*Fs,o.init="y",o.t=0,Ss={ecco:o.ecco,epoch:c,inclo:o.inclo,no:o.no,method:o.method,opsmode:o.operationmode,xke:o.xke,j2:o.j2};var y=(Ls=t.initl(Ss)).ao,b=Ls.con42,v=Ls.cosio,w=Ls.cosio2,q=Ls.eccsq,j=Ls.omeosq,k=Ls.posq,P=Ls.rp,F=Ls.rteosq,S=Ls.sinio;if(o.no=Ls.no,o.con41=Ls.con41,o.gsto=Ls.gsto,o.a=Math.pow(o.no*o.tumin,-2/3),o.alta=o.a*(1+o.ecco)-1,o.altp=o.a*(1-o.ecco)-1,o.error=0,j>=0||o.no>=0){if(o.isimp=0,P<220/o.radiusearthkm+1&&(o.isimp=1),Xa=Ps,Wa=Ds,(Ka=(P-1)*o.radiusearthkm)<156&&(Xa=Ka-78,Ka<98&&(Xa=20),Is=(120-Xa)/o.radiusearthkm,Wa=Is*Is*Is*Is,Xa=Xa/o.radiusearthkm+1),Qa=1/k,Za=1/(y-Xa),o.eta=y*o.ecco*Za,Ja=o.eta*o.eta,Ha=o.ecco*o.eta,Va=Math.abs(1-Ja),_a=Wa*Math.pow(Za,4),Aa=_a/Math.pow(Va,3.5),Da=Aa*o.no*(y*(1+1.5*Ja+Ha*(4+Ja))+.375*ee*Za/Va*o.con41*(8+3*Ja*(8+Ja))),o.cc1=o.bstar*Da,Na=0,o.ecco>1e-4&&(Na=-2*_a*Za*de*o.no*S/o.ecco),o.x1mth2=1-w,o.cc4=2*o.no*Aa*y*j*(o.eta*(2+.5*Ja)+o.ecco*(.5+2*Ja)-ee*Za/(y*Va)*(-3*o.con41*(1-2*Ha+Ja*(1.5-.5*Ha))+.75*o.x1mth2*(2*Ja-Ha*(1+Ja))*Math.cos(2*o.argpo))),o.cc5=2*Aa*y*j*(1+2.75*(Ja+Ha)+Ha*Ja),Ba=w*w,Wo=1.5*ee*Qa*o.no,$o=.5*Wo*ee*Qa,Ya=-.46875*re*Qa*Qa*o.no,o.mdot=o.no+.5*Wo*F*o.con41+.0625*$o*F*(13-78*w+137*Ba),o.argpdot=-.5*Wo*b+.0625*$o*(7-114*w+395*Ba)+Ya*(3-36*w+49*Ba),te=-Wo*v,o.nodedot=te+(.5*$o*(4-19*w)+2*Ya*(3-7*w))*v,$a=o.argpdot+o.nodedot,o.omgcof=o.bstar*Na*Math.cos(o.argpo),o.xmcof=0,o.ecco>1e-4&&(o.xmcof=-xe*_a*o.bstar/Ha),o.nod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11,tt=Ts.sz13,ot=Ts.sz21,st=Ts.sz23,at=Ts.sz31,et=Ts.sz33;o.xgh2=Ts.xgh2,o.xgh3=Ts.xgh3,o.xgh4=Ts.xgh4,o.xh2=Ts.xh2,o.xh3=Ts.xh3,o.xi2=Ts.xi2,o.xi3=Ts.xi3,o.xl2=Ts.xl2,o.xl3=Ts.xl3,o.xl4=Ts.xl4,o.zmol=Ts.zmol,o.zmos=Ts.zmos,A=Ts.nm,jo=Ts.z1,Po=Ts.z3,Io=Ts.z11,So=Ts.z13,Lo=Ts.z21,Eo=Ts.z23,Ro=Ts.z31,Uo=Ts.z33,Us={inclo:N,init:o.init,ep:o.ecco,inclp:o.inclo,nodep:o.nodeo,argpp:o.argpo,mp:o.mo,opsmode:o.operationmode},nt=t.dpper(o,Us),o.ecco=nt.ep,o.inclo=nt.inclp,o.nodeo=nt.nodep,o.argpo=nt.argpp,o.mo=nt.mp,I=0,B=0,_=0,bs={xke:ie,cosim:O,emsq:U,argpo:o.argpo,s1:C,s2:D,s3:G,s4:H,s5:J,sinim:L,ss1:K,ss2:Q,ss3:V,ss4:W,ss5:X,sz1:Y,sz3:Z,sz11:$,sz13:tt,sz21:ot,sz23:st,sz31:at,sz33:et,t:o.t,tc:E,gsto:o.gsto,mo:o.mo,mdot:o.mdot,no:o.no,nodeo:o.nodeo,nodedot:o.nodedot,xPIdot:$a,z1:jo,z3:Po,z11:Io,z13:So,z21:Lo,z23:Eo,z31:Ro,z33:Uo,ecco:o.ecco,eccsq:q,em:R,argpm:I,inclm:N,mm:_,nm:A,nodem:B,irez:o.irez,atime:o.atime,d2201:o.d2201,d2211:o.d2211,d3210:o.d3210,d3222:o.d3222,d4410:o.d4410,d4422:o.d4422,d5220:o.d5220,d5232:o.d5232,d5421:o.d5421,d5433:o.d5433,dedt:o.dedt,didt:o.didt,dmdt:o.dmdt,dnodt:o.dnodt,domdt:o.domdt,del1:o.del1,del2:o.del2,del3:o.del3,xfact:o.xfact,xlamo:o.xlamo,xli:o.xli,xni:o.xni},ys=t.dsinit(bs),o.irez=ys.irez,o.atime=ys.atime,o.d2201=ys.d2201,o.d2211=ys.d2211,o.d3210=ys.d3210,o.d3222=ys.d3222,o.d4410=ys.d4410,o.d4422=ys.d4422,o.d5220=ys.d5220,o.d5232=ys.d5232,o.d5421=ys.d5421,o.d5433=ys.d5433,o.dedt=ys.dedt,o.didt=ys.didt,o.dmdt=ys.dmdt,o.dnodt=ys.dnodt,o.domdt=ys.domdt,o.del1=ys.del1,o.del2=ys.del2,o.del3=ys.del3,o.xfact=ys.xfact,o.xlamo=ys.xlamo,o.xli=ys.xli,o.xni=ys.xni}1!==o.isimp&&(Ca=o.cc1*o.cc1,o.d2=4*y*Za*Ca,T=o.d2*Za*o.cc1/3,o.d3=(17*y+Xa)*T,o.d4=.5*T*y*Za*(221*y+31*Xa)*o.cc1,o.t3cof=o.d2+2*Ca,o.t4cof=.25*(3*o.d3+o.cc1*(12*o.d2+10*Ca)),o.t5cof=.2*(3*o.d4+12*o.cc1*o.d3+6*o.d2*o.d2+15*Ca*(2*o.d2+Ca)))}t.propagate(o,0),o.init="n"},t.propagate=function(o,s){if(i=o.radiusearthkm*o.xke/60,o.t=s,o.error=0,Q=o.mo+o.mdot*o.t,V=o.argpo+o.argpdot*o.t,W=o.nodeo+o.nodedot*o.t,I=V,_=Q,X=o.t*o.t,B=W+o.nodecf*X,U=1-o.cc1*o.t,C=o.bstar*o.cc4*o.t,D=o.t2cof*X,1!==o.isimp&&(k=o.omgcof*o.t,Y=1+o.eta*Math.cos(Q),j=o.xmcof*(Y*Y*Y-o.delmo),_=Q+(T=k+j),I=V-T,L=X*o.t,O=L*o.t,U=U-o.d2*X-o.d3*L-o.d4*O,C+=o.bstar*o.cc5*(Math.sin(_)-o.sinmao),D=D+o.t3cof*L+O*(o.t4cof+o.t*o.t5cof)),A=o.no,Z=o.ecco,N=o.inclo,"d"===o.method&&(E=o.t,$={irez:o.irez,d2201:o.d2201,d2211:o.d2211,d3210:o.d3210,d3222:o.d3222,d4410:o.d4410,d4422:o.d4422,d5220:o.d5220,d5232:o.d5232,d5421:o.d5421,d5433:o.d5433,dedt:o.dedt,del1:o.del1,del2:o.del2,del3:o.del3,didt:o.didt,dmdt:o.dmdt,dnodt:o.dnodt,domdt:o.domdt,argpo:o.argpo,argpdot:o.argpdot,t:o.t,tc:E,gsto:o.gsto,xfact:o.xfact,xlamo:o.xlamo,no:o.no,atime:o.atime,em:Z,argpm:I,inclm:N,xli:o.xli,mm:_,xni:o.xni,nodem:B,nm:A},tt=t.dspace($),Z=tt.em,I=tt.argpm,N=tt.inclm,_=tt.mm,B=tt.nodem,A=tt.nm),A<=0)return o.error=2,{position:!1,velocity:!1};if(ot=Math.pow(ie/A,xe)*U*U,A=ie/Math.pow(ot,1.5),(Z-=C)>=1||Z<-.001)return o.error=1,{position:!1,velocity:!1};if(Z<1e-6&&(Z=1e-6),_+=o.no*D,H=_+I+B,_=((H%=pe)-(I%=pe)-(B%=pe))%pe,o.am=ot,o.em=Z,o.im=N,o.Om=B,o.om=I,o.mm=_,o.nm=A,et=Math.sin(N),at=Math.cos(N),st=Z,G=N,F=I,K=B,J=_,w=et,v=at,"d"===o.method&&(dt={inclo:o.inclo,init:"n",ep:st,inclp:G,nodep:K,argpp:F,mp:J,opsmode:o.operationmode},nt=t.dpper(o,dt),st=nt.ep,K=nt.nodep,F=nt.argpp,J=nt.mp,(G=nt.inclp)<0&&(G=-G,K+=le,F-=le),st<0||st>1))return o.error=3,{position:!1,velocity:!1};for("d"===o.method&&(w=Math.sin(G),v=Math.cos(G),o.aycof=-.5*de*w,Math.abs(v+1)>15e-13?o.xlcof=-.25*de*w*(3+5*v)/(1+v):o.xlcof=-.25*de*w*(3+5*v)/ve),a=st*Math.cos(F),T=1/(ot*(1-st*st)),e=st*Math.sin(F)+T*o.aycof,n=J+F+K+T*o.xlcof*a,P=d=(n-K)%pe,R=9999.9,r=1;Math.abs(R)>=1e-12&&r<=10;)b=Math.sin(P),y=Math.cos(P),R=(d-e*y+a*b-P)/(R=1-y*a-b*e),Math.abs(R)>=.95&&(R=R>0?.95:-.95),P+=R,r+=1;return c=a*y+e*b,h=a*b-e*y,(l=ot*(1-(m=a*a+e*e)))<0?(o.error=4,{position:!1,velocity:!1}):(p=ot*(1-c),M=Math.sqrt(ot)*h/p,x=Math.sqrt(l)/p,g=Math.sqrt(1-m),u=ot/p*(b-e-a*(T=h/(1+g))),f=ot/p*(y-a+e*T),S=Math.atan2(u,f),z=(f+f)*u,Yo=1-2*u*u,$o=(Wo=.5*ee*(T=1/l))*T,"d"===o.method&&(q=v*v,o.con41=3*q-1,o.x1mth2=1-q,o.x7thm1=7*q-1),(Zo=p*(1-1.5*$o*g*o.con41)+.5*Wo*o.x1mth2*Yo)<1?(o.error=6,{position:!1,velocity:!1}):(S-=.25*$o*o.x7thm1*z,ts=K+1.5*$o*v*z,os=G+1.5*$o*v*w*Yo,ss=M-A*Wo*o.x1mth2*z/ie,as=x+A*Wo*(o.x1mth2*Yo+1.5*o.con41)/ie,es=Math.sin(S),ns=Math.cos(S),ds=Math.sin(ts),rs=Math.cos(ts),cs=Math.sin(os),is=Math.cos(os),ps=(ms=rs*is)*es+ds*ns,Ms=cs*es,xs=(hs=-ds*is)*ns-rs*es,gs=ms*ns-ds*es,us=cs*ns,{position:{x:Zo*(ls=hs*es+rs*ns)*o.radiusearthkm,y:Zo*ps*o.radiusearthkm,z:Zo*Ms*o.radiusearthkm},velocity:{x:(ss*ls+as*xs)*i,y:(ss*ps+as*gs)*i,z:(ss*Ms+as*us)*i}}))},t.getgravconst=function(t){switch(t){case"wgs72old":ce=398600.79964,he=6378.135,me=1/(ie=.0743669161),re=-165597e-11,de=(ne=-253881e-11)/(ee=.001082616);break;case"wgs72":ce=398600.8,he=6378.135,ie=60/Math.sqrt(he*he*he/ce),me=1/ie,re=-165597e-11,de=(ne=-253881e-11)/(ee=.001082616);break;case"wgs84":ce=398600.5,he=6378.137,ie=60/Math.sqrt(he*he*he/ce),me=1/ie,re=-161098761e-14,de=(ne=-253215306e-14)/(ee=.00108262998905);break;default:throw new Error("unknown gravity option "+t)}return{tumin:me,mus:ce,radiusearthkm:he,xke:ie,j2:ee,j3:ne,j4:re,j3oj2:de}},t.createSatrec=function(o,s,a,e){void 0===a&&(a="wgs72"),void 0===e&&(e="i"),fs=0,(zs={}).error=0,zs.satnum=o.substring(2,7),zs.epochyr=parseInt(o.substring(18,20)),zs.epochdays=parseFloat(o.substring(20,32)),zs.ndot=parseFloat(o.substring(33,43)),zs.nddot=parseFloat(o.substring(44,45)+"."+o.substring(45,50)+"E"+o.substring(50,52)),zs.bstar=parseFloat(o.substring(53,54)+"."+o.substring(54,59)+"E"+o.substring(59,61)),zs.inclo=parseFloat(s.substring(8,16)),zs.nodeo=parseFloat(s.substring(17,25)),zs.ecco=parseFloat("."+s.substring(26,33)),zs.argpo=parseFloat(s.substring(34,42)),zs.mo=parseFloat(s.substring(43,51)),zs.no=parseFloat(s.substring(52,63)),zs.no/=ge,zs.inclo*=Me,zs.nodeo*=Me,zs.argpo*=Me,zs.mo*=Me,fs=zs.epochyr<57?zs.epochyr+2e3:zs.epochyr+1900;var n=t.days2mdhms(fs,zs.epochdays),d=n.mon,r=n.day,i=n.hr,c=n.minute,h=n.sec,m=t.jday(fs,d,r,i,c,h);return zs.jdsatepoch=m.jd+m.jdFrac,t.sgp4init(zs,{whichconst:a,opsmode:e,satn:zs.satnum,epoch:zs.jdsatepoch-2433281.5,xbstar:zs.bstar,xecco:zs.ecco,xargpo:zs.argpo,xinclo:zs.inclo,xndot:zs.ndot,xnddot:zs.nddot,xmo:zs.mo,xno:zs.no,xnodeo:zs.nodeo}),zs},t.gstime=function(t){var o=-62e-7*(yt=(t-2451545)/36525)*yt*yt+.093104*yt*yt+3164400184.812866*yt+67310.54841;return(o=o*Me/240%pe)<0&&(o+=pe),o},t.sgn=function(t){return t<0?-1:1},t.mag=function(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2])},t.cross=function(t,o){var s=[0,0,0];return s[0]=t[1]*o[2]-t[2]*o[1],s[1]=t[2]*o[0]-t[0]*o[2],s[2]=t[0]*o[1]-t[1]*o[0],s},t.dot=function(t,o){return t[0]*o[0]+t[1]*o[1]+t[2]*o[2]},t.angle=function(o,s){var a=t.mag(o),e=t.mag(s);return a*e>1e-8*1e-8?(T=t.dot(o,s)/(a*e),Math.abs(T)>1&&(T=1*t.sgn(T)),Math.acos(T)):999999.1},t.asinh=function(t){return Math.log(t+Math.sqrt(t*t+1))},t.newtonnu=function(o,s){var a=999999.9,e=999999.9,n=1e-8;if(Math.abs(o)<n)e=s,a=s;else if(o<1-n){var d=Math.sqrt(1-o*o)*Math.sin(s)/(1+o*Math.cos(s)),r=(o+Math.cos(s))/(1+o*Math.cos(s));e=(a=Math.atan2(d,r))-o*Math.sin(a)}else if(o>1+n){if(o>1&&Math.abs(s)+1e-5<le-Math.acos(1/o)){d=Math.sqrt(o*o-1)*Math.sin(s)/(1+o*Math.cos(s));a=t.asinh(d),e=o*t.sinh(a)-a}}else Math.abs(s)<168*le/180&&(e=(a=Math.tan(.5*s))+a*a*a/3);return o<1&&((e%=2*le)<0&&(e+=2*le),a%=2*le),{e0:a,m:e}},t.sinh=function(t){return(Math.exp(t)-Math.exp(-t))/2},t.rv2coe=function(o,s,a){var e,n,d,r,i,c,h,m,l,p,M,x,g,u,f,z,y,b=[0,0,0],v=[0,0,0],w=.5*le,q=1e-8,j=999999.1,k=t.mag(o),P=t.mag(s),I=t.cross(o,s),F=t.mag(I);if(F>q){for(b[0]=-I[1],b[1]=I[0],b[2]=0,g=t.mag(b),ct=P*P-a/k,x=t.dot(o,s),z=0;z<=2;z++)v[z]=(ct*o[z]-x*s[z])/a;d=t.mag(v),f=P*P*.5-a/k,n=Math.abs(f)>q?-a/(2*f):999999.9,e=F*F/a,u=I[2]/F,r=Math.acos(u),y=1,d<q?y=r<q||Math.abs(r-le)<q?2:3:(r<q||Math.abs(r-le)<q)&&(y=4),g>q?(T=b[0]/g,Math.abs(T)>1&&(T=t.sgn(T)),i=Math.acos(T),b[1]<0&&(i=pe-i)):i=j,1==y?(c=t.angle(b,v),v[2]<0&&(c=pe-c)):c=j,1==y||4==y?(h=t.angle(v,o),x<0&&(h=pe-h)):h=j,3==y?(l=t.angle(b,o),o[2]<0&&(l=pe-l),m=l):l=j,d>q&&4==y?(T=v[0]/d,Math.abs(T)>1&&(T=t.sgn(T)),M=Math.acos(T),v[1]<0&&(M=pe-M),r>w&&(M=pe-M)):M=j,k>q&&2==y?(T=o[0]/k,Math.abs(T)>1&&(T=t.sgn(T)),p=Math.acos(T),o[1]<0&&(p=pe-p),r>w&&(p=pe-p),m=p):p=j,1!=y&&4!=y||(m=t.newtonnu(d,h).m)}else e=j,n=j,d=j,r=j,i=j,c=j,h=j,m=j,l=j,p=j,M=j;return{p:e,a:n,ecc:d,incl:r,omega:i,argp:c,nu:h,m,arglat:l,truelon:p,lonper:M}},t.jday=function(t,o,s,a,e,n){var d=367*t-Math.floor(7*(t+Math.floor((o+9)/12))*.25)+Math.floor(275*o/9)+s+1721013.5,r=(n+60*e+3600*a)/86400;if(Math.abs(r)>1){var i=Math.floor(r);d+=i,r-=i}return{jd:d,jdFrac:r}},t.days2mdhms=function(t,o){for(As=[31,t%4==0?29:28,31,30,31,30,31,31,30,31,30,31],Bs=Math.floor(o),Hs=1,Gs=0;Bs>Gs+As[Hs-1]&&Hs<12;)Gs+=As[Hs-1],Hs+=1;return ws=Hs,qs=Bs-Gs,T=24*(o-Bs),js=Math.floor(T),T=60*(T-js),ks=Math.floor(T),{mon:ws,day:qs,hr:js,minute:ks,sec:60*(T-ks)}},t.invjday=function(o,s){var a,e;Math.abs(s)>=1&&(o+=Math.floor(s),s-=Math.floor(s));var n=o-Math.floor(o)-.5;Math.abs(n)>1e-8&&(o-=n,s+=n);var d=o-2415019.5,r=d/365.25;fs=1900+Math.floor(r),a=Math.floor(.25*(fs-1901)),(e=Math.floor(d-(365*(fs-1900)+a)))+s<1&&(fs-=1,a=Math.floor(.25*(fs-1901)),e=Math.floor(d-(365*(fs-1900)+a)));var i=t.days2mdhms(fs,e+s),c=i.mon,h=i.day,m=i.hr,l=i.minute,p=i.sec;return{year:fs,mon:c,day:h,hr:m,minute:l,sec:p}},t}()},900:(t,o,s)=>{s.d(o,{Transforms:()=>n});var a=Math.PI,e=2*a,n=function(){function t(){}return t.getDegLat=function(o){if(o<-a/2||o>a/2)throw new RangeError("Latitude radians must be in range [-PI/2; PI/2].");return t.rad2deg(o)},t.getDegLon=function(o){if(o<-a||o>a)throw new RangeError("Longitude radians must be in range [-PI; PI].");return t.rad2deg(o)},t.getRadLat=function(o){if(o<-90||o>90)throw new RangeError("Latitude degrees must be in range [-90; 90].");return t.deg2rad(o)},t.getRadLon=function(o){if(o<-180||o>180)throw new RangeError("Longitude degrees must be in range [-180; 180].");return t.deg2rad(o)},t.rad2deg=function(t){return 180*t/a},t.deg2rad=function(t){return t*a/180},t.ecf2eci=function(t,o){return{x:t.x*Math.cos(o)-t.y*Math.sin(o),y:t.x*Math.sin(o)+t.y*Math.cos(o),z:t.z}},t.ecf2rae=function(o,s){var a=t.lla2sez(o,s);return t.sez2rae(a)},t.eci2lla=function(t,o){for(var s=6378.137,n=Math.sqrt(t.x*t.x+t.y*t.y),d=(s-6356.7523142)/s,r=2*d-d*d,i=Math.atan2(t.y,t.x)-o;i<-a;)i+=e;for(;i>a;)i-=e;for(var c,h=0,m=Math.atan2(t.z,Math.sqrt(t.x*t.x+t.y*t.y));h<20;)c=1/Math.sqrt(1-r*(Math.sin(m)*Math.sin(m))),m=Math.atan2(t.z+s*c*r*Math.sin(m),n),h+=1;return{lon:i,lat:m,alt:n/Math.cos(m)-s*c}},t.eci2ecf=function(t,o){return{x:t.x*Math.cos(o)+t.y*Math.sin(o),y:t.x*-Math.sin(o)+t.y*Math.cos(o),z:t.z}},t.lla2ecf=function(t){var o=t.lon,s=t.lat,a=t.alt,e=6378.137,n=(e-6356.7523142)/e,d=2*n-n*n,r=e/Math.sqrt(1-d*(Math.sin(s)*Math.sin(s)));return{x:(r+a)*Math.cos(s)*Math.cos(o),y:(r+a)*Math.cos(s)*Math.sin(o),z:(r*(1-d)+a)*Math.sin(s)}},t.lla2sez=function(o,s){var a=o.lon,e=o.lat,n=t.lla2ecf(o),d=s.x-n.x,r=s.y-n.y,i=s.z-n.z;return{s:Math.sin(e)*Math.cos(a)*d+Math.sin(e)*Math.sin(a)*r-Math.cos(e)*i,e:-Math.sin(a)*d+Math.cos(a)*r,z:Math.cos(e)*Math.cos(a)*d+Math.cos(e)*Math.sin(a)*r+Math.sin(e)*i}},t.rae2sez=function(t){return{s:-t.rng*Math.cos(t.el)*Math.cos(t.az),e:t.rng*Math.cos(t.el)*Math.sin(t.az),z:t.rng*Math.sin(t.el)}},t.rae2ecf=function(o,s){var a=t.lla2ecf(s),e=t.rae2sez(o),n=Math.sin(s.lat),d=Math.sin(s.lon),r=Math.cos(s.lat),i=Math.cos(s.lon);return{x:n*i*e.s+-d*e.e+r*i*e.z+a.x,y:n*d*e.s+i*e.e+r*d*e.z+a.y,z:-r*e.s+n*e.z+a.z}},t.sez2rae=function(t){var o=Math.sqrt(t.s*t.s+t.e*t.e+t.z*t.z),s=Math.asin(t.z/o);return{rng:o,az:Math.atan2(-t.e,t.s)+a,el:s}},t}()},762:(t,o,s)=>{s.d(o,{Utils:()=>a});var a=function(){function t(){}return t.distance=function(t,o){return Math.sqrt(Math.pow(t.x-o.x,2)+Math.pow(t.y-o.y,2)+Math.pow(t.z-o.z,2))},t.dopplerFactor=function(t,o,s){var a=7292115e-11,e={x:o.x-t.x,y:o.y-t.y,z:o.z-t.z,w:0};e.w=Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2)+Math.pow(e.z,2));var n=s.x+a*t.y,d=s.y-a*t.x,r=s.z,i=(e.x*n+e.y*d+e.z*r)/e.w;return 1+i/299792.458*(i>=0?1:-1)},t}()},348:(t,o,s)=>{s.r(o),s.d(o,{Sgp4:()=>a.Sgp4,Transforms:()=>e.Transforms,Utils:()=>n.Utils});var a=s(392),e=s(900),n=s(762)}
|
|
35
|
-
/**
|
|
36
|
-
* @author Theodore Kruczek.
|
|
37
|
-
* @description Orbital Object ToolKit (OOTK) is a collection of tools for working
|
|
38
|
-
* with satellites and other orbital objects.
|
|
39
|
-
*
|
|
40
|
-
* @copyright MIT License.
|
|
41
|
-
* Copyright (c) 2020-2021 Theodore Kruczek
|
|
42
|
-
*
|
|
43
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
44
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
45
|
-
* in the Software without restriction, including without limitation the rights
|
|
46
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
47
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
48
|
-
* furnished to do so, subject to the following conditions:
|
|
49
|
-
*
|
|
50
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
51
|
-
* copies or substantial portions of the Software.
|
|
52
|
-
*
|
|
53
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
54
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
55
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
56
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
57
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
58
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
59
|
-
* SOFTWARE.
|
|
60
|
-
*/},o={};function s(a){if(o[a])return o[a].exports;var e=o[a]={exports:{}};return t[a](e,e.exports,s),e.exports}return s.d=(t,o)=>{for(var a in o)s.o(o,a)&&!s.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:o[a]})},s.o=(t,o)=>Object.prototype.hasOwnProperty.call(t,o),s.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s(348)})()}));
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author Theodore Kruczek.
|
|
3
|
-
* @description Orbital Object ToolKit (OOTK) is a collection of tools for working
|
|
4
|
-
* with satellites and other orbital objects.
|
|
5
|
-
*
|
|
6
|
-
* @file The Transforms module contains a collection of conversions not contained
|
|
7
|
-
* in the original SGP4 library such as ECI to ECF and ECF to RAE. This was based
|
|
8
|
-
* on some of the functions in satellite.js.
|
|
9
|
-
*
|
|
10
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
12
|
-
* in the Software without restriction, including without limitation the rights
|
|
13
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
15
|
-
* furnished to do so, subject to the following conditions:
|
|
16
|
-
*
|
|
17
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
18
|
-
* copies or substantial portions of the Software.
|
|
19
|
-
*
|
|
20
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
-
* SOFTWARE.
|
|
27
|
-
*/
|
|
28
|
-
declare class Transforms {
|
|
29
|
-
static getDegLat(radians: number): number;
|
|
30
|
-
static getDegLon(radians: number): number;
|
|
31
|
-
static getRadLat(degrees: number): number;
|
|
32
|
-
static getRadLon(degrees: number): number;
|
|
33
|
-
static rad2deg(radians: number): number;
|
|
34
|
-
static deg2rad(degrees: number): number;
|
|
35
|
-
static ecf2eci(ecf: {
|
|
36
|
-
x: number;
|
|
37
|
-
y: number;
|
|
38
|
-
z: number;
|
|
39
|
-
}, gmst: number): {
|
|
40
|
-
x: number;
|
|
41
|
-
y: number;
|
|
42
|
-
z: number;
|
|
43
|
-
};
|
|
44
|
-
static ecf2rae(lla: {
|
|
45
|
-
lon: number;
|
|
46
|
-
lat: number;
|
|
47
|
-
alt: number;
|
|
48
|
-
}, ecf: {
|
|
49
|
-
x: number;
|
|
50
|
-
y: number;
|
|
51
|
-
z: number;
|
|
52
|
-
}): {
|
|
53
|
-
rng: number;
|
|
54
|
-
az: number;
|
|
55
|
-
el: number;
|
|
56
|
-
};
|
|
57
|
-
/** eciToGeodetic converts eci coordinates to lla coordinates
|
|
58
|
-
* @param {{array}} eci takes xyz coordinates
|
|
59
|
-
* @param {number} gmst takes a number in gmst time
|
|
60
|
-
* @returns {array} array containing lla coordinates
|
|
61
|
-
*/
|
|
62
|
-
static eci2lla(eci: {
|
|
63
|
-
x: number;
|
|
64
|
-
y: number;
|
|
65
|
-
z: number;
|
|
66
|
-
}, gmst: number): {
|
|
67
|
-
lat: number;
|
|
68
|
-
lon: number;
|
|
69
|
-
alt: number;
|
|
70
|
-
};
|
|
71
|
-
static eci2ecf(eci: {
|
|
72
|
-
x: number;
|
|
73
|
-
y: number;
|
|
74
|
-
z: number;
|
|
75
|
-
}, gmst: number): {
|
|
76
|
-
x: number;
|
|
77
|
-
y: number;
|
|
78
|
-
z: number;
|
|
79
|
-
};
|
|
80
|
-
static lla2ecf(lla: {
|
|
81
|
-
lat: number;
|
|
82
|
-
lon: number;
|
|
83
|
-
alt: number;
|
|
84
|
-
}): {
|
|
85
|
-
x: number;
|
|
86
|
-
y: number;
|
|
87
|
-
z: number;
|
|
88
|
-
};
|
|
89
|
-
static lla2sez(lla: {
|
|
90
|
-
lat: number;
|
|
91
|
-
lon: number;
|
|
92
|
-
alt: number;
|
|
93
|
-
}, ecf: {
|
|
94
|
-
x: number;
|
|
95
|
-
y: number;
|
|
96
|
-
z: number;
|
|
97
|
-
}): {
|
|
98
|
-
s: number;
|
|
99
|
-
e: number;
|
|
100
|
-
z: number;
|
|
101
|
-
};
|
|
102
|
-
static rae2sez(rae: {
|
|
103
|
-
rng: number;
|
|
104
|
-
az: number;
|
|
105
|
-
el: number;
|
|
106
|
-
}): {
|
|
107
|
-
s: number;
|
|
108
|
-
e: number;
|
|
109
|
-
z: number;
|
|
110
|
-
};
|
|
111
|
-
static rae2ecf(rae: {
|
|
112
|
-
rng: number;
|
|
113
|
-
az: number;
|
|
114
|
-
el: number;
|
|
115
|
-
}, lla: {
|
|
116
|
-
lat: number;
|
|
117
|
-
lon: number;
|
|
118
|
-
alt: number;
|
|
119
|
-
}): {
|
|
120
|
-
x: number;
|
|
121
|
-
y: number;
|
|
122
|
-
z: number;
|
|
123
|
-
};
|
|
124
|
-
/**
|
|
125
|
-
* @param {Object} sez Containing SEZ coordinates
|
|
126
|
-
* @param {Number} sez.s Positive horizontal vector S due south.
|
|
127
|
-
* @param {Number} sez.e Positive horizontal vector E due east.
|
|
128
|
-
* @param {Number} sez.z Vector Z normal to the surface of the earth (up).
|
|
129
|
-
* @returns {Object} Rng, Az, El array
|
|
130
|
-
*/
|
|
131
|
-
static sez2rae(sez: {
|
|
132
|
-
s: number;
|
|
133
|
-
e: number;
|
|
134
|
-
z: number;
|
|
135
|
-
}): {
|
|
136
|
-
rng: number;
|
|
137
|
-
az: number;
|
|
138
|
-
el: number;
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
export { Transforms };
|