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.

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

Page 975

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

Page 976

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

Page 977

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

Page 978

043742,000176: 15,3764           77745        POSITE             DLOAD                                          
043743,000177: 15,3765           12004                                    KONMAT     +2                         #  ZEROS
043744,000178: 15,3766           00027                           STORE    GTMP                                  
043745,000179: 15,3767           77650                           GOTO                                           
043746,000180: 15,3770           33716                                    POSITD                                
043747,000181: 05,2000                                           SETLOC   EPHEM1                                
043748,000182: 05,2000                                           BANK                                           
043749,000183: 
043750,000184: 05,3507                                           COUNT*   $$/EPHEM                              
043751,000185: 
043752,000186: 05,3507                        STMP               EQUALS   16D                                   
043753,000187: 
043754,000188: 05,3507                        GTMP               EQUALS   22D                                   
043755,000189: 
043756,000190: 05,3507                        TIMEP              EQUALS   24D                                   

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