

-----------------------------------

Doru Dragan

23 Apr 2007 10:20



-----------------------------------

Un program care calculeaza fazele Lunii pentru mii de ani :) Este in BASIC dar cred ca se poate usor converti in orice alt limbaj. Este gratuit dar mi-ar place sa fiu citat daca si unde e folosit. Eventuale explicatii.

 10 PI=4*ATN(1):R=PI/180:INPUT "Anul:";Y:C=INT((Y-1900)*12.3685):G=1:IF Y<1583 THEN G=0
 20 DEF FNF(X)=X-INT(X):T=(Y-1899.5)/100:V=T*T:W=V*T
 30 E=.75933-.000837*T-.0002172*V-.000000155*W+.53058868*C
 40 I=2415020+29*C+INT(E):E=FNF(E)
 50 L=C*.080848211:L=360*FNF(L)+359.2242-.0000333*V-.00000347*W
 60 M1=C*.071713661:M1=360*FNF(M1)+306.0253+.0107306*V+.00001236*W
 70 B=C*.085195851:B=360*FNF(B)+21.2964-.0016528*V-.00000239*W
 80 PRINT "ANUL ";Y:FOR Q=0 TO 28:J=I+14*Q:K=Q/2
 90 N=(L+K*29.1053561)*R:O=(M1+K*385.816918)*R:S=(B+K*390.670506)*R
100 F=E+.765294*Q-.4068*SIN(O)+(.1734-.000393*T)*SIN(N)+.0161*SIN(2*O)
110 F=F+.0104*SIN(2*S)-.0074*SIN(N-O)-.0051*SIN(N+O)+.0021*SIN(2*N)
120 F=F+.001*SIN(2*S-O)+.5/1440+.5
130 J=J+INT(F):F=FNF(F)
140 A$="LUNA PLINA":IF K=INT(K) THEN A$="LUNA NOUA "
150 GOSUB 950:PRINT D1;M;H1;":";M9;A$:F=F-.0208*SIN(2*S)
200 IF K=INT(K) OR ABS(SIN(S))>.36 THEN 295
202 S1=5.19595-.0048*COS(N)+.002*COS(2*N)-.3283*COS(O)-.006*COS(N+O)+.0041*COS(N-O)
204 C1=.207*SIN(N)+.0024*SIN(2*N)-.039*SIN(O)+.0115*SIN(2*O) -.0073*SIN(N+O)-.0067*SIN(N-O)+.0117*SIN(2*S)
206 D9=ABS(S1*SIN(S)+C1*COS(S))
208 U=.0059+.0046*COS(N)-.0182*COS(O)+.0004*COS(2*O)-.0005*COS(N+O)
210 RP=1.2847+U:RU=.7404-U:MP=(1.5572+U-D9)/.545
295 F=F+.0208*SIN(2*S):NEXT Q:END
950 A=J+1524:IF G=1 THEN A1=INT(J/36524.25-51.12264):A=A+1+A1-INT(A1/4)
960 X=INT(A/365.25-.3343):D=INT(365.25*X)
970 Z=INT((A-D)/30.61):D=A-D-INT(30.61*Z)+F:M=Z-1:Y=X-4716
980 IF M>12 THEN M=M-12
990 IF M<3 THEN Y=Y+1
992 D1=INT(D):H=24*(D-D1):H1=INT(H):M9=INT(60*(H-H1))
995 RETURN

