LUNE:
REM F5AYE 10 90
REM L ACTUALISATION DE LA POSITION DES ANTENNES EST INDIQUEE PAR UN BEEP TOUTES LES 15 MN
LOCAL O,N,S,B,D,M,Y,P5,D5,R5,L5,U5,L6,U6,LA1,MA1,LO1,MO1,I6,Y1,I1,D1,G1,G2,G3,G4,A,A1,A2,R1,L,L1,G,H,E,E2,E3,F,Z1,Z2,C1,J1,J2,C2,J,T1,T,T5,K1,K2,K3,K4,K5,L8,K6,L7,A%,P$(1)
AB:: PRINT "CHOISIR: PREVISION (P) OU CALCUL EN TEMPS REEL (T)"
INPUT P$ :IF P$="P" :GOTO AA:: :ENDIF :CLS
PRINT"CALCUL DE LA ......POSITION DE LA LUNE EN TEMPS REEL" :A%=CLOCK(1)
X:: :B=(HOUR)*100+MINUTE
M=MONTH
N=MINUTE
D=DAY
Y=YEAR
S=SECOND
AC:: :IF N=16 OR N=31 OR N=46 OR N=1 :O=0 :ENDIF
IF O=1 :GOTO Z:: :ENDIF
IF N=15 OR N=30 OR N=45 OR N=0 :BEEP 300,500 :O=1 :ENDIF
REM INITIALISATION
Z:: :P5=2.0000000000*3.1415926535
D5=360.0000000000/P5
R5=P5/360.0000000000
L5=46 :U5=17 :L6=6 :U6=19
LA1=L5 :MA1=U5 :LO1=L6 :MO1=U6
L5=(L5+U5/60)*R5
L6=(L6+U6/60)*R5
L6=L6*-1 :REM CORRECTION POUR LONG.EST
I6=100
Y1=Y-(INT(Y/100)*100)
I1=2
REM CALCUL DE LA DATE JULIENNE
IF M>=3 :GOTO A:: :ENDIF
IF INT ((Y-1853)/4)<11 :GOTO B:: :ENDIF
C1=-1
GOTO C::
B:: :C1=0
C:: :J1=365*(Y-1853)+D+30*(M+9)+INT((M+10)/2)
J2=INT((Y-1853)/4)+1+C1
GOTO D::
A:: :IF INT((Y-1582)/4)<11 :GOTO E:: :ENDIF
C1=-1
GOTO F::
E:: :C1=0
F:: :IF M=9 :GOTO G:: :ENDIF
IF M=11 :GOTO G:: :ENDIF
C2=0
GOTO H::
G:: :C2=1
H:: :J1=365*(Y-1852)+D+30*(M-3)+INT((M-2)/2)
J2=INT((Y-1852)/4)+C1+C2
D:: :J=J1+J2
REM DATE JULIENNE-2397547.5 POUR 0 HEURE GMT
T1=J-17472.5
REM CALCUL DE LA LATITUDE ET LONGITUDE DU SATELLITE
T=(B-INT(B/100)*100)/1440+INT(B/100)/24.0+S/86400
T5=T1+T
K1=((0.751213+0.036601102*T5)-INT(0.751213+0.036601102*T5))*P5
K2=((0.822513+0.0362916457*T5)-INT(0.822513+0.0362916457*T5))*P5
K3=((0.995766+0.00273777852*T5)-INT(0.995766+0.00273777852*T5))*P5
K4=((0.974271+0.0338631922*T5)-INT(0.974271+0.0338631922*T5))*P5
K5=((0.0312525+0.0367481957*T5)-INT(0.0312525+0.0367481957*T5))*P5
L8=K1+0.658*R5*SIN(2*K4)+6.289*R5*SIN(K2)
L8=L8-1.274*R5*SIN(K2-2*K4)-0.186*R5*SIN(K3)
L8=L8+0.214*R5*SIN(2*K2)-0.114*R5*SIN(2*K5)
L8=L8-0.059*R5*SIN(2*K2-2*K4)-0.057*R5*SIN(K2+K3-2*K4)
K6=K5+0.6593*R5*SIN(2*K4)+6.2303*R5*SIN(K2)-1.272*R5*SIN(K2-2*K4)
L7=5.144*R5*SIN(K6)-0.146*R5*SIN(K5-2*K4)
REM CALCUL DE L ASCENTION DROITE (A=R1) ET DE LA DECLINAISON
D1=COS(L7)*SIN(L8)*0.397821+SIN(L7)*0.917463
D1=ATAN(D1/(SQR(1-D1*D1)))
G1=50+0.5-((D1)/(0.792))*D5
G2=80+((D1)/(0.808))*D5
G3=141.5-((D1)*(0.738)*D5)
G4=170.5-((D1)*(0.857)*D5)
A2=COS(L7)*COS(L8)/COS(D1)
A1=(COS(L7)*SIN(L8)*0.917463-SIN(L7)*0.397821)/COS(D1)
A=ATAN(A1/A2)
REM SUPRESSION DES AMBIGUITES DUES A LA FONCTION ATN
IF A=0 :GOTO I:: :ENDIF
GOTO J::
I:: :IF A2<0 :GOTO L:: :ENDIF
GOTO K::
L:: :A=P5/2
GOTO K::
J:: :IF A>0 :GOTO M:: :ENDIF
IF A2<0 :GOTO N:: :ENDIF
A=P5+A
GOTO K::
N:: :A=P5+(A-P5/2)
GOTO K::
M:: :IF A2>=0 :GOTO K:: :ENDIF
A=A+P5/2
K:: :R1=A
L1=0.065709822*T1
L=T*24*1.002738+6.646055+(L1-INT(L1/24)*24)
L=(L-INT(L/24)*24)
REM CALCUL DE L ANGLE HORAIRE DE GREENWICH,DU TEMPS SIDERAL LOCAL
G=(L/24)*P5-R1
IF G<P5 :GOTO O:: :ENDIF
G=G-P5
GOTO Q::
O:: :IF G<0 :GOTO P:: :ENDIF
GOTO Q::
P:: :G=G+P5
REM CALCUL DE L ANGLE HORAIRE LOCAL H PAR RAPPORT A GHA
Q:: :H=L6-G
REM CALCUL DE L ELEVATION DE L OBJET E
E3=COS(L5)*COS(H)*COS(D1)+SIN(D1)*SIN(L5)
E2=SQR(1-(E3*E3))
E=ATAN((E3/E2)-(1/(61.33*E2)))
F=ATAN(E3/E2)
REM CALCUL DEL AZIMUT A DE L OBJET
A2=SIN(D1)/(COS(L5)*COS(F))
A2=A2-(SIN(L5)/COS(L5))*(SIN(F)/COS(F))
A1=SIN(L5)*SIN(D1)+COS(L5)*COS(D1)*COS(H)
A1=(SIN(H)*COS(D1))/(SQR(1-A1*A1))
A=ATAN(A1/A2)
REM SUPRESSION DES AMBIGUITES DUES A LA FONCTION ATN
IF A=0 :GOTO R:: :ENDIF
GOTO S::
R:: :IF A2<0 :GOTO T:: :ENDIF
GOTO U::
T:: :A=P5/2
GOTO U::
S:: :IF A>0 :GOTO V:: :ENDIF
IF A2<0 :GOTO W:: :ENDIF
A=P5+A
GOTO U::
W:: :A=P5+(A-P5/2)
GOTO U::
V:: :IF A2>=0 :GOTO U:: :ENDIF
A=A+P5/2
U:: :Z1=INTF(A*D5*100+5)/100
Z2=INT(E*D5*100+5)/100.00 :CLS :IF P$<>"P" :PRINT "POSITION TU ACTUELLE DE LA LUNE" :A%=CLOCK(1) :ENDIF
IF P$="P" :PRINT"POSITION DE LA LUNE LE",D,M,Y,"A",B :ENDIF
PRINT "AZIMUT ",Z1
PRINT "ELEVATION",Z2
IF P$="P" :GOTO AD:: :ENDIF
GOTO X::
AA:: :CLS :PRINT "ANNEE(****)" :INPUT Y
PRINT"MOIS(**)" :INPUT M
PRINT"JOUR(**)" :INPUT D :B=100 :CLS :PRINT"JE CALCULE"
GOTO AC::
AD:: :B=B+100 :IF B=2500 :PAUSE 100 :CLS :GOTO AB:: :ENDIF :GOTO AC::