Source Code

These source-code files were transcribed from a printout in Don Eyles's personal collection, scanned by archive.org, and financially sponsored by Linden Sims. A team of volunteers performed the transcription and proof-reading. The scanned page images are available at the Virtual AGC Project website, as well as higher-quality (but much larger) images at the Virtual AGC Project's collection in the Internet Archive. Report any problems by creating "issues" at the Virtual AGC Project's GitHub Repository.

Notations on the program listing read, in part:

	GAP:  ASSEMBLE REVISION 56 OF AGC PROGRAM ZERLINA BY ZOROASTER
	9:12 OCT. 21,1970
Note that the date is the date of the printout, not the date of the program revision.

043577,000002:                                                                                                  ## Copyright:   Public domain.
043578,000003:                                                                                                  ## Filename:    LUNAR_AND_SOLAR_EPHEMERIDES_SUBROUTINES.agc
043579,000004:                                                                                                  ## Purpose:     A log section of Zerlina 56, the final revision of
043580,000005:                                                                                                  ##              Don Eyles's offline development program for the variable 
043581,000006:                                                                                                  ##              guidance period servicer. It also includes a new P66 with LPD 
043582,000007:                                                                                                  ##              (Landing Point Designator) capability, based on an idea of John 
043583,000008:                                                                                                  ##              Young's. Neither of these advanced features were actually flown,
043584,000009:                                                                                                  ##              but Zerlina was also the birthplace of other big improvements to
043585,000010:                                                                                                  ##              Luminary including the terrain model and new (Luminary 1E)
043586,000011:                                                                                                  ##              analog display programs. Zerlina was branched off of Luminary 145,
043587,000012:                                                                                                  ##              and revision 56 includes all changes up to and including Luminary
043588,000013:                                                                                                  ##              183. It is therefore quite close to the Apollo 14 program,
043589,000014:                                                                                                  ##              Luminary 178, where not modified with new features.
043590,000015:                                                                                                  ## Reference:   pp. 975-978
043591,000016:                                                                                                  ## Assembler:   yaYUL
043592,000017:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
043593,000018:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
043594,000019:                                                                                                  ## Mod history: 2017-07-28 MAS  Created from Luminary 210.
043595,000020:                                                                                                  ##              2017-08-26 MAS  Updated for Zerlina 56.
043596,000021: 

Page 975

043598,000023:                                                                                                  #  NAME - LSPOS  - LOCATE SUN AND MOON                                                      DATE - 25 OCT 67
043599,000024:                                                                                                  #  MOD NO.1
043600,000025:                                                                                                  #  MOD BY NEVILLE                                                                           ASSEMBLY SUNDANCE
043601,000026: 
043602,000027:                                                                                                  #  FUNCTIONAL DESCRIPTION
043603,000028: 
043604,000029:                                                                                                  #         COMPUTES UNIT POSITION VECTOR OF THE SUN AND MOON IN THE BASIC REFERENCE SYSTEM. THE SUN VECTOR S IS
043605,000030:                                                                                                  #  LOCATED VIA TWO ANGLES. THE FIRST ANGLE(OBLIQUITY) IS THE ANGLE BETWEEN THE EARTH EQUATOR AND THE ECLIPTIC. THE
043606,000031:                                                                                                  #  SECOND ANGLE IS THE LONGITUDE OF THE SUN MEASURED IN THE ECLIPTIC.
043607,000032:                                                                                                  #  THE POSITION VECTOR OF THE SUN IS
043608,000033:                                                                                                  #         -
043609,000034:                                                                                                  #         S=(COS(LOS), COS(OBL)*SIN(LOS), SIN(OBL)*SIN(LOS)), WHERE
043610,000035: 
043611,000036:                                                                                                  #       LOS=LOS +LOS *T-(C *SIN(2PI*T)/365.24 +C *COS(2PI*T)/365.24)
043612,000037:                                                                                                  #              0    R     0                     1
043613,000038:                                                                                                  #       LOS  (RAD) IS THE LONGITUDE OF THE SUN FOR MIDNIGHT JUNE 30TH OF THE PARTICULAR YEAR.
043614,000039:                                                                                                  #          0
043615,000040:                                                                                                  #       LOS  (RAD/DAY) IS THE MEAN RATE FOR THE PARTICULAR YEAR.
043616,000041:                                                                                                  #          R
043617,000042:                                                                                                  #  LOS  AND LOS  ARE STORED AS LOSC AND LOSR IN RATESP.
043618,000043:                                                                                                  #     0        R
043619,000044:                                                                                                  #  COS(OBL) AND SIN(OBL) ARE STORED IN THE MATRIX KONMAT.
043620,000045:                                                                                                  #  T, TIME MEASURED IN DAYS(24 HOURS), IS STORED IN TIMEP.
043621,000046:                                                                                                  #  C  AND C  ARE FUDGE FACTORS TO MINIMIZE THE DEVIATION. THEY ARE STORED AS ONE CONSTANT(CMOD), SINCE
043622,000047:                                                                                                  #   0      1                               2  2 1/2
043623,000048:                                                                                                  #  C *SIN(X)+C *COS(X) CAN BE WRITTEN AS (C +C )   *SIN(X+PHI), WHERE PHI=ARCTAN(C /C ).
043624,000049:                                                                                                  #   0         1                            0  1                                   1  0
043625,000050: 
043626,000051:                                                                                                  #  THE MOON IS LOCATED VIA FOUR ANGLES. THE FIRST IS THE OBLIQUITY. THE SECOND IS THE MEAN LONGITUDE OF THE MOON,
043627,000052:                                                                                                  #  MEASURED IN THE ECLIPTIC FROM THE MEAN EQUINOX TO THE MEAN ASCENDING NODE OF THE LUNAR ORBIT, AND THEN ALONG THE
043628,000053:                                                                                                  #  ORBIT. THE THIRD ANGLE IS THE ANGLE BETWEEN THE ECLIPTIC AND THE LUNAR ORBIT. THE FOURTH ANGLE IS THE LONGITUDE
043629,000054:                                                                                                  #  OF THE NODE OF THE MOON, MEASURED IN THE LUNAR ORBIT. LET THESE ANGLES BE OBL,LOM,IM, AND LON RESPECTIVELY.
043630,000055: 
043631,000056:                                                                                                  #  THE SIMPLIFIED POSITION VECTOR OF THE MOON IS
043632,000057:                                                                                                  #    -
043633,000058:                                                                                                  #    M=(COS(LOM), COS(OBL)*SIN(LOM)-SIN(OBL)*SIN(IM)*SIN(LOM-LON), SIN(OBL)*SIN(LOM)+COS(OBL)*SIN(IM)*SIN(LOM-LON))
043634,000059: 
043635,000060:                                                                                                  #    WHERE
043636,000061:                                                                                                  #       LOM=LOM +LOM *T-(A *SIN 2PI*T/27.5545+A *COS(2PI*T/27.5545)+B *SIN 2PI*T/32+B *COS(2PI*T/32)), AND
043637,000062:                                                                                                  #              0    R     0                    1                     0               1
043638,000063:                                                                                                  #        LON=LON +LON
043639,000064:                                                                                                  #               0    R
043640,000065:                                                                                                  #  A , A , B  AND B  ARE STORED AS AMOD AND BMOD (SEE DESCRIPTION OF CMOD, ABOVE).  COS(OBL), SIN(OBL)*SIN(IM),
043641,000066:                                                                                                  #   0   1   0      1
043642,000067:                                                                                                  #  SIN(OBL), AND COS(OBL)*SIN(IM) ARE STORED IN KONMAT AS K1, K2, K3 AND K4, RESPECTIVELY. LOM , LOM , LON , LON
043643,000068:                                                                                                  #  ARE STORED AS LOMO, LOMR, LONO, AND LONR IN RATESP.                                        0     R     0     R
043644,000069:                                                                                                  #  THE THREE PHIS ARE STORED AS AARG, BARG, AND CARG(SUN).  ALL CONSTANTS ARE UPDATED BY YEAR.
043645,000070: 
043646,000071:                                                                                                  #  CALLING SEQUENCE

Page 976

043648,000073:                                                                                                  #    CALL LSPOS.  RETURN IS VIA CPRET.
043649,000074: 
043650,000075:                                                                                                  #  ALARMS OR ABORTS
043651,000076: 
043652,000077:                                                                                                  #    NONE
043653,000078: 
043654,000079:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED
043655,000080: 
043656,000081:                                                                                                  #    TEPHEM - TIME FROM MIDNIGHT 1 JULY PRECEDING THE LAUNCH TO THE TIME OF THE LAUNCH (WHEN THE AGC CLOCK WENT
043657,000082:                                                                                                  #  TO ZERO). TEPHEM IS TP WITH UNITS OF CENTI-SECONDS.
043658,000083:                                                                                                  #    TIME2 AND TIME1 ARE IN MPAC AND MPAC +1 WHEN PROGRAM IS CALLED.
043659,000084: 
043660,000085:                                                                                                  #  OUTPUT
043661,000086: 
043662,000087:                                                                                                  #    UNIT POSITIONAL VECTOR OF SUN IN VSUN.   (SCALED B-1)
043663,000088:                                                                                                  #    UNIT POSITIONAL VECTOR OF MOON IN VMOON. (SCALED B-1)
043664,000089: 
043665,000090:                                                                                                  #  SUBROUTINES USED
043666,000091: 
043667,000092:                                                                                                  #    NONE
043668,000093: 
043669,000094:                                                                                                  #  DEBRIS
043670,000095: 
043671,000096:                                                                                                  #    CURRENT CORE SET,WORK AREA AND FREEFLAG
043672,000097: 04,3001                                           BANK     04                                    
043673,000098: 15,2000                                           SETLOC   EPHEM                                 
043674,000099: 15,2000                                           BANK                                           
043675,000100: 
043676,000101: 15,3660  E5,1714                                  EBANK=   VSUN                                  
043677,000102: 15,3660                                           COUNT*   $$/EPHEM                              
043678,000103: 15,3660  15,3660               LUNPOS             EQUALS   LSPOS                                 
043679,000104: 
043680,000105: 15,3660           54201        LSPOS              SETPD    SR                                    
043681,000106: 15,3661           00001                                    0                                     
043682,000107: 15,3662           20617                                    14D                                   #  TP
043683,000108: 15,3663           56371                           TAD      DDV                                   
043684,000109: 15,3664           01707                                    TEPHEM                                #  TIME OF LAUNCH
043685,000110: 15,3665           12024                                    CSTODAY                               #  24 HOURS-8640000 CENTI-SECS/DAY B-33
043686,000111: 15,3666           00031                           STORE    TIMEP                                 #  T IN DAYS
043687,000112: 15,3667           77170                           AXT,1    AXT,2                                 
043688,000113: 15,3670           00000                                    0                                     
043689,000114: 15,3671           00000                                    0                                     
043690,000115: 15,3672           77614                           CLEAR                                          
043691,000116: 15,3673           00274                                    FREEFLAG                              #  SWITCH BIT
043692,000117: 15,3674           77745        POSITA             DLOAD                                          
043693,000118: 15,3675           12004                                    KONMAT     +2                         #  ZEROS
043694,000119: 15,3676           00027                           STORE    GTMP                                  
043695,000120: 15,3677           40745        POSITB             DLOAD    DMP*                                  
043696,000121: 15,3700           00031                                    TIMEP                                 #  T
043697,000122: 15,3701           12050                                    VAL67      +4,1                       #  1/27 OR 1/32 OR 1/365

Page 977

043699,000124: 15,3702           42661                           SL       DAD*                                  
043700,000125: 15,3703           20211                                    8D                                    
043701,000126: 15,3704           12046                                    VAL67      +2,1                       #  AARG
043702,000127: 15,3705           40756                           SIN      DMP*                                  #  SIN(T/27+PHI) OR T/32 OR T/365
043703,000128: 15,3706           12044                                    VAL67,1                               #  (A0**2+A1**2)**1/2SIN(X+PHIA)
043704,000129: 15,3707           62015                           DAD      INCR,1                                #  PLUS
043705,000130: 15,3710           00027                                    GTMP                                  #  (B0**2+B1**2)**1/2SIN(X+PHIB)
043706,000131: 15,3711           77771                           DEC      -6         B-14                       
043707,000132: 15,3712           00027                           STORE    GTMP                                  #  OR (C0**2+C1**2)**1/2SIN(X+PHIC)
043708,000133: 15,3713           77614                           BOFSET                                         
043709,000134: 15,3714           00054                                    FREEFLAG                              
043710,000135: 15,3715           33677                                    POSITB                                
043711,000136: 15,3716           40745        POSITD             DLOAD    DMP*                                  
043712,000137: 15,3717           00031                                    TIMEP                                 #  T
043713,000138: 15,3720           65747                                    RATESP,2                              #  LOMR,LOSR,LONR
043714,000139: 15,3721           42661                           SL       DAD*                                  
043715,000140: 15,3722           20206                                    5D                                    
043716,000141: 15,3723           65741                                    RATESP     +6,2                       #  LOMO,LOSO,LONO
043717,000142: 15,3724           77625                           DSU                                            
043718,000143: 15,3725           00027                                    GTMP                                  
043719,000144: 15,3726           10021                           STORE    STMP,2                                #  LOM,LOS,LON
043720,000145: 15,3727           63135                           SLOAD    INCR,2                                
043721,000146: 15,3730           00050                                    X2                                    
043722,000147: 15,3731           77775                           DEC      -2         B-14                       
043723,000148: 15,3732           53015                           DAD      BZE                                   
043724,000149: 15,3733           12026                                    RCB-13                                #  PLUS 2
043725,000150: 15,3734           33764                                    POSITE                                #  2ND
043726,000151: 15,3735           77644                           BPL                                            
043727,000152: 15,3736           33674                                    POSITA                                #  1ST
043728,000153: 15,3737           45345        POSITF             DLOAD    DSU                                   #  3RD
043729,000154: 15,3740           00021                                    STMP                                  #  LOM
043730,000155: 15,3741           00025                                    STMP       +4                         #  LON
043731,000156: 15,3742           65356                           SIN      PDDL                                  #  SIN(LOM-LON)
043732,000157: 15,3743           00021                                    STMP                                  
043733,000158: 15,3744           65356                           SIN      PDDL                                  #  SIN LOM
043734,000159: 15,3745           00021                                    STMP                                  
043735,000160: 15,3746           55546                           COS      VDEF                                  #  COS LOM
043736,000161: 15,3747           53521                           MXV      UNIT                                  
043737,000162: 15,3750           12002                                    KONMAT                                #  K1,K2,K3,K4,
043738,000163: 15,3751           02723                           STORE    VMOON                                 
043739,000164: 15,3752           65345                           DLOAD    PDDL                                  
043740,000165: 15,3753           12004                                    KONMAT     +2                         #  ZERO
043741,000166: 15,3754           00023                                    STMP       +2                         
043742,000167: 15,3755           65356                           SIN      PDDL                                  #  SIN LOS
043743,000168: 15,3756           00023                                    STMP       +2                         
043744,000169: 15,3757           55546                           COS      VDEF                                  #  COS LOS
043745,000170: 15,3760           53521                           MXV      UNIT                                  
043746,000171: 15,3761           12002                                    KONMAT                                
043747,000172: 15,3762           02715                           STORE    VSUN                                  
043748,000173: 15,3763           77616                           RVQ                                            
043749,000174: 

Page 978

043751,000176: 15,3764           77745        POSITE             DLOAD                                          
043752,000177: 15,3765           12004                                    KONMAT     +2                         #  ZEROS
043753,000178: 15,3766           00027                           STORE    GTMP                                  
043754,000179: 15,3767           77650                           GOTO                                           
043755,000180: 15,3770           33716                                    POSITD                                
043756,000181: 05,2000                                           SETLOC   EPHEM1                                
043757,000182: 05,2000                                           BANK                                           
043758,000183: 
043759,000184: 05,3507                                           COUNT*   $$/EPHEM                              
043760,000185: 
043761,000186: 05,3507                        STMP               EQUALS   16D                                   
043762,000187: 
043763,000188: 05,3507                        GTMP               EQUALS   22D                                   
043764,000189: 
043765,000190: 05,3507                        TIMEP              EQUALS   24D                                   

End of include-file LUNAR_AND_SOLAR_EPHEMERIDES_SUBROUTINES.agc.  Parent file is MAIN.agc