hp41programs

Illuminated Frac Moon

Illuminated Fraction of the Moon's Disk for the HP-41


Overview
 

-Given a date and a time expressed in TT, this short program returns the illuminated fraction of the Moon at that instant.
-The results - though not extremely accurate - are valid over the time span [1000,3000]
 

Data Registers:  R00 = T in millennia since 2000/01/01 0h
                             R01 = D , R02 = M' then M' - 2D
Flags: /
Subroutine:   "J0"  ( cf "Julian & Gregorian Calendars for the HP-41" )  or "J1" or "J2"
 
 

01  LBL "IFMD"
02  DEG
03  HR
04  24
05  /
06  X<>Y
07  XEQ "J0"
08  +
09  365250
10  /
11  STO 00
12  4452671.11
13  RCL 00
14  .19
15  *
16  -
17  *
18  68.25
19  -
20  STO 01
21  SIN
22  55
23  *
24  X<>Y
25  .87
26  *
27  4771988.68
28  +
29  R^
30  *
31  128.43
32  +
33  STO 02
34  ST+ X
35  SIN
36  107
37  *
38  +
39  RCL 02       
40  SIN
41  3144
42  *
43  +
44  RCL 01
45  ST+ X
46  ST- 02
47  SIN
48  329
49  *
50  +
51  RCL 02
52  SIN
53  637
54  *
55  -
56  359990.5
57  RCL 00       
58  65
59  /
60  -
61  RCL 00
62  *
63  2.96
64  -
65  SIN
66  1050
67  *
68  -
69   E3
70  /
71  RCL 01        
72  2
73  /
74  +
75  SIN
76  X^2
77  END

 
   ( 154 bytes / SIZE 003 )
 
 

      STACK        INPUTS      OUTPUTS
           Y  YYYY.MNDD             /
           X     HH.MNSS             f

  where  f  = illuminated fraction of the Moon's disk  ( 0 < f < 1 )        ---Execution time = 11s---

Examples:

   2008.0827   ENTER^
       20.0607   XEQ "IFMD"  >>>>   f = 0.1121                  So,  f = 11%

   3000.0404   ENTER^
          0              R/S              >>>>    f = 0.4942                         f = 49%

   1001.0708   ENTER^
         8.3916      R/S              >>>>    f = 1.0000                      f = 100%   ( almost )
 

->   1001/07/08  Julian Calendar correponds to 1001/07/14  Gregorian

Reference:

[1]  Jean Meeus - "Astronomical Algorithms" - Willmann-Bell  -  ISBN 0-943396-61-1