Moonphase to julian
10-04-2019, 03:13 AM
Post: #1
 Fikri bahr Junior Member Posts: 3 Joined: Oct 2019
Moonphase to julian
Examples of looking for occur new months in kind julianday

[Acs(angka)
BEGIN
local mm;
if abs(angka)=1 Then mm:= (2 * atan(1))* abs(1-angka);
else mm:= Atan(-angka / SQRt(-angka * angka + 1))+2*atan(1);
END;
end;

BEGIN
local mm;
mm:= deg * (atan(1)/45);
END;

ModFDiv( Dividend , Divisor )
BEGIN
LOCAL COBA;
COBA := Dividend - Divisor * FLOOR(Dividend / Divisor);
End ;

EXPORT MoonPhases(k ,Phase)
BEGIN

LOCAL T, JDE, E, M, MS, F, Omega;
LOCAL A1, A2, A3, A4, A5, A6, A7;
LOCAL A8, A9, A10, A11, A12, A13, A14;
LOCAL PT, W, PK;
LOCAL y,Phases;

k := k + Phase * 0.25;

T := k / 1236.85;
JDE := 2451550.09765 + 29.530588853 * k + 0.0001337 * T ^ 2 - 0.00000015 * T ^ 3 + 0.00000000073 * T ^ 4;
E := 1 - 0.002516 * T - 0.0000074 * T ^ 2;
M := 2.5534 + 29.10535669 * k - 0.0000218 * T ^ 2 - 0.00000011 * T ^ 3;
MS := 201.5643 + 385.81693528 * k + 0.0107438 * T ^ 2 + 0.00001239 * T ^ 3 - 0.000000058 * T ^ 4;
F := 160.7108 + 390.67050274 * k - 0.0016341 * T ^ 2 - 0.00000227 * T ^ 3 + 0.000000011 * T ^ 4;
Omega := 124.7746 - 1.5637558 * k + 0.0020691 * T ^ 2 + 0.00000215 * T ^ 3;

A1 := Rad(ModFDiv(299.77 + 0.107408 * k - 0.009173 * T ^ 2, 360));
A2 := Rad(ModFDiv(251.88 + 0.016321 * k, 360));
A3 := Rad(ModFDiv(251.83 + 26.651886 * k, 360));
A4 := Rad(ModFDiv(349.42 + 36.412478 * k, 360));
A5 := Rad(ModFDiv(84.66 + 18.206239 * k, 360));
A6 := Rad(ModFDiv(141.74 + 53.303771 * k, 360));
A7 := Rad(ModFDiv(207.14 + 2.453732 * k, 360));
A8 := Rad(ModFDiv(154.84 + 7.30686 * k, 360));
A9 := Rad(ModFDiv(34.52 + 27.261239 * k, 360));
A10 := Rad(ModFDiv(207.19 + 0.121824 * k, 360));
A11 := Rad(ModFDiv(291.34 + 1.844379 * k, 360));
A12 := Rad(ModFDiv(161.72 + 24.198154 * k, 360));
A13 := Rad(ModFDiv(239.56 + 25.513099 * k, 360));
A14 := Rad(ModFDiv(331.55 + 3.592518 * k, 360));

If Phase = 0 Then
PT := -0.4072 * Sin(MS) + 0.17241 * E * Sin(M) + 0.01608 * Sin(2 * MS)
+ 0.01039 * Sin(2 * F) + 0.00739 * E * Sin(MS - M) - 0.00514 * E * Sin(MS + M)
+ 0.00208 * E ^ 2 * Sin(2 * M) - 0.00111 * Sin(MS - 2 * F) - 0.00057 * Sin(MS + 2 * F)
+ 0.00056 * E * Sin(2 * MS + M) - 0.00042 * Sin(3 * MS) + 0.00042 * E * Sin(M + 2 * F)
+ 0.00038 * E * Sin(M - 2 * F) - 0.00024 * E * Sin(2 * MS - M)
- 0.00017 * Sin(Omega) - 0.00007 * Sin(MS + 2 * M) + 0.00004 * Sin(2 * MS - 2 * F)
+ 0.00004 * Sin(3 * M) + 0.00003 * Sin(MS + M - 2 * F) + 0.00003 * Sin(2 * MS + 2 * F)
- 0.00003 * Sin(MS + M + 2 * F) + 0.00003 * Sin(MS - M + 2 * F) - 0.00002 * Sin(MS - M - 2 * F)
- 0.00002 * Sin(3 * MS + M) + 0.00002 * Sin(4 * MS)
End;

If Phase = 2 Then
PT := -0.40614 * Sin(MS) + 0.17302 * E * Sin(M) + 0.01614 * Sin(2 * MS)
+ 0.01043 * Sin(2 * F) + 0.00734 * E * Sin(MS - M) - 0.00515 * E * Sin(MS + M)
+ 0.00209 * E ^ 2 * Sin(2 * M) - 0.00111 * Sin(MS - 2 * F) - 0.00057 * Sin(MS + 2 * F)
+ 0.00056 * E * Sin(2 * MS + M) - 0.00042 * Sin(3 * MS) + 0.00042 * E * Sin(M + 2 * F)
+ 0.00038 * E * Sin(M - 2 * F) - 0.00024 * E * Sin(2 * MS - M)
- 0.00017 * Sin(Omega) - 0.00007 * Sin(MS + 2 * M) + 0.00004 * Sin(2 * MS - 2 * F)
+ 0.00004 * Sin(3 * M) + 0.00003 * Sin(MS + M - 2 * F) + 0.00003 * Sin(2 * MS + 2 * F)
- 0.00003 * Sin(MS + M + 2 * F) + 0.00003 * Sin(MS - M + 2 * F) - 0.00002 * Sin(MS - M - 2 * F)
- 0.00002 * Sin(3 * MS + M) + 0.00002 * Sin(4 * MS)
End;

If Phase = 1 Or Phase = 3 Then
PT := -0.62801 * Sin(MS) + 0.17172 * E * Sin(M) - 0.01183 * E * Sin(MS + M)
+ 0.00862 * Sin(2 * MS) + 0.00804 * Sin(2 * F) + 0.00454 * E * Sin(MS - M)
+ 0.00204 * E ^ 2 * Sin(2 * M) - 0.0018 * Sin(MS - 2 * F) - 0.0007 * Sin(MS + 2 * F)
- 0.0004 * Sin(3 * MS) - 0.00034 * E * Sin(2 * MS - M) + 0.00032 * E * Sin(M + 2 * F)
+ 0.00032 * E * Sin(M - 2 * F) - 0.00028 * E ^ 2 * Sin(MS + 2 * M) + 0.00027 * E * Sin(2 * MS + M)
- 0.00017 * Sin(Omega) - 0.00005 * Sin(MS - M - 2 * F) + 0.00004 * Sin(2 * MS + 2 * F)
- 0.00004 * Sin(MS + M + 2 * F) + 0.00004 * Sin(MS - 2 * M) + 0.00003 * Sin(MS + M - 2 * F)
+ 0.00003 * Sin(3 * M) + 0.00002 * Sin(2 * MS - 2 * F) + 0.00002 * Sin(MS - M + 2 * F)
- 0.00002 * Sin(3 * MS + M);
W := 0.00306 - 0.00038 * E * Cos(M) + 0.00026 * Cos(MS)
- 0.00002 * Cos(MS - M) + 0.00002 * Cos(MS + M) + 0.00002 * Cos(2 * F);
If Phase = 3 Then W := -W
End ; END;

PK := 0.000325 * Sin(A1) + 0.000165 * Sin(A2) + 0.000164 * Sin(A3)
+ 0.000126 * Sin(A4) + 0.00011 * Sin(A5) + 0.000062 * Sin(A6)
+ 0.00006 * Sin(A7) + 0.000056 * Sin(A8) + 0.000047 * Sin(A9)
+ 0.000042 * Sin(A10) + 0.00004 * Sin(A11) + 0.000037 * Sin(A12)
+ 0.000035 * Sin(A13) + 0.000023 * Sin(A14);
Phases := JDE + PK + PT + W;
END;[/code][/php]]
 « Next Oldest | Next Newest »

User(s) browsing this thread: 1 Guest(s)