Source Code

This is the source-code for the Apollo 9 Command Module's Guidance Computer. These files were derived originally from the scan from MIT's Dibner Institute's now-discontinued website titled "History of Recent Science and Technology", which in turn was originally created by Gary Neff, though his high-quality scans were unfortunately reduced in legibility when presented online. The markings on the front of the printout imply that it was the original AGC developer Norm Brodeur's copy. A scan by Ron Burkey has superceded it, made from a more-legible copy from the collection of original AGC developer Fred Martin. The source code was transcribed from those images by Ron Burkey. Note that the page images presented online are of reduced quality, and that higher-quality images are available. Report any conversion errors or legibility problems in page images to info@sandroid.org. Notations on the program listing read, in part:

	ASSEMBLE REVISION 249 OF AGC PROGRAM COLOSSUS BY NASA 2021111-041
	20'35 OCT. 28,1968
Note that the date is the date of the printout, not the date of the program revision.

053013,000002:                                                                                                  ## Copyright:   Public domain.
053014,000003:                                                                                                  ## Filename:    PLANETARY_INERTIAL_ORIENTATION.agc
053015,000004:                                                                                                  ## Purpose:     Part of the source code for Colossus, build 249.
053016,000005:                                                                                                  ##              It is part of the source code for the Command Module's (CM)
053017,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), for Apollo 9.
053018,000007:                                                                                                  ## Assembler:   yaYUL
053019,000008:                                                                                                  ## Reference:   Starts on p. 1213
053020,000009:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
053021,000010:                                                                                                  ## Website:     www.ibiblio.org/apollo.
053022,000011:                                                                                                  ## Mod history: 08/28/04 RSB.   Adapted from corresponding Luminary131 file.
053023,000012:                                                                                                  ##              2017-01-06 RSB  Page numbers now agree with those on the
053024,000013:                                                                                                  ##                              original harcopy, as opposed to the PDF page
053025,000014:                                                                                                  ##                              numbers in 1701.pdf.
053026,000015:                                                                                                  ##              2017-01-18 RSB  Cross-diff'd comment text (not whitespace)
053027,000016:                                                                                                  ##                              vs the already-proofed corresponding Colossus
053028,000017:                                                                                                  ##                              237 and Comanche 55 source-code files
053029,000018:                                                                                                  ##                              and corrected errors found.
053030,000019:                                                                                                  ##              2017-03-16 RSB  Comment-text fixes identified in 5-way
053031,000020:                                                                                                  ##                              side-by-side diff of Luminary 69/99/116/131/210.
053032,000021: 
053033,000022:                                                                                                  ## The contents of the "Colossus249" files, in general, are transcribed 
053034,000023:                                                                                                  ## from a scanned copy of the program listing.  Notations on this
053035,000024:                                                                                                  ## document read, in part:
053036,000025:                                                                                                  ##
053037,000026:                                                                                                  ##      Assemble revision 249 of AGC program Colossus by NASA
053038,000027:                                                                                                  ##      2021111-041.  October 28, 1968.  
053039,000028:                                                                                                  ##
053040,000029:                                                                                                  ##      This AGC program shall also be referred to as
053041,000030:                                                                                                  ##                              Colossus 1A
053042,000031:                                                                                                  ##
053043,000032:                                                                                                  ##      Prepared by
053044,000033:                                                                                                  ##                      Massachusetts Institute of Technology
053045,000034:                                                                                                  ##                      75 Cambridge Parkway
053046,000035:                                                                                                  ##                      Cambridge, Massachusetts
053047,000036:                                                                                                  ##      under NASA contract NAS 9-4065.
053048,000037:                                                                                                  ##
053049,000038:                                                                                                  ## Refer directly to the online document mentioned above for further information.
053050,000039:                                                                                                  ## Please report any errors (relative to the scanned pages) to info@sandroid.org.
053051,000040:                                                                                                  ##
053052,000041:                                                                                                  ## In some cases, where the source code for Luminary 131 overlaps that of 
053053,000042:                                                                                                  ## Colossus 249, this code is instead copied from the corresponding Luminary 131
053054,000043:                                                                                                  ## source file, and then is proofed to incorporate any changes.
053055,000044: 

Page 1213

053057,000046:                                                                                                  #  ..... RP-TO-R SUBROUTINE .....
053058,000047:                                                                                                  #  SUBROUTINE TO CONVERT RP (VECTOR IN PLANETARY COORDINATE SYSTEM, EITHER
053059,000048:                                                                                                  #  EARTH-FIXED OR MOON-FIXED) TO R (SAME VECTOR IN THE BASIC REF. SYSTEM)
053060,000049:                                                                                                  #        R = MT(T) * (RP + LP X RP)      MT = M MATRIX TRANSPOSE
053061,000050: 
053062,000051:                                                                                                  #  CALLING SEQUENCE
053063,000052:                                                                                                  #        L       CALL
053064,000053:                                                                                                  #        L+1             RP-TO-R
053065,000054: 
053066,000055:                                                                                                  #  SUBROUTINES USED
053067,000056:                                                                                                  #        EARTHMX, MOONMX, EARTHL
053068,000057: 
053069,000058:                                                                                                  #        ITEMS AVAILABLE FROM LAUNCH DATA
053070,000059:                                                                                                  #                504LM = THE LIBRATION VECTOR L OF THE MOON AT TIME TIMSUBL, EXPRESSED
053071,000060:                                                                                                  #                IN THE MOON-FIXED COORD. SYSTEM         RADIANS B0
053072,000061: 
053073,000062:                                                                                                  #        ITEMS NECESSARY FOR SUBR. USED (SEE DESCRIPTION OF SUBR.)
053074,000063: 
053075,000064:                                                                                                  #  INPUT
053076,000065:                                                                                                  #        MPAC = 0 FOR EARTH, NON-ZERO FOR MOON
053077,000066:                                                                                                  #        0-5D = RP VECTOR
053078,000067:                                                                                                  #        6-7D = TIME
053079,000068: 
053080,000069:                                                                                                  #  OUTPUT
053081,000070:                                                                                                  #        MPAC = R VECTOR METERS B-29 FOR EARTH, B-27 FOR MOON
053082,000071: 
053083,000072: 26,2000                                           SETLOC   PLANTIN                               
053084,000073: 26,2000                                           BANK                                           
053085,000074: 
053086,000075: 26,3341                                           COUNT*   $$/LUROT                              
053087,000076: 
053088,000077: 26,3341           46020        RP-TO-R            STQ      BHIZ                                  
053089,000078: 26,3342           00050                                    RPREXIT                               
053090,000079: 26,3343           55356                                    RPTORA                                
053091,000080: 26,3344           77624                           CALL                                           #  COMPUTE M MATRIX FOR MOON
053092,000081: 26,3345           55416                                    MOONMX                                #  LP=LM FOR MOON        RADIANS B0
053093,000082: 26,3346           77775                           VLOAD                                          
053094,000083: 26,3347           02012                                    504LM                                 
053095,000084: 26,3350           53235        RPTORB             VXV      VAD                                   
053096,000085: 26,3351           00001                                    504RPR                                
053097,000086: 26,3352           00001                                    504RPR                                
053098,000087: 26,3353           52105                           VXM      GOTO                                  
053099,000088: 26,3354           00025                                    MMATRIX                               #  MPAC=R=MT(T)*(RP+LPXRP)
053100,000089: 26,3355           55404                                    RPRPXXXX                              #  RESET PUSHLOC TO 0 BEFORE EXITING
053101,000090: 26,3356           77624        RPTORA             CALL                                           #  EARTH COMPUTATIONS
053102,000091: 26,3357           55570                                    EARTHMX                               #  M MATRIX B-1
053103,000092: 26,3360           77624                           CALL                                           
053104,000093: 26,3361           55622                                    EARTHL                                #  L VECTOR RADIANS B0
053105,000094: 26,3362           76521                           MXV      VSL1                                  #  LP=M(T)*L     RAD B-0
053106,000095: 26,3363           00025                                    MMATRIX                               

Page 1214

053108,000097: 26,3364           77650                           GOTO                                           
053109,000098: 26,3365           55350                                    RPTORB                                
053110,000099: 

Page 1215

053112,000101:                                                                                                  #  ..... R-TO-RP SUBROUTINE .....
053113,000102:                                                                                                  #  SUBROUTINE TO CONVERT R (VECTOR IN REFERENCE COORD. SYSTEM) TO RP
053114,000103:                                                                                                  #  (VECTOR IN PLANETARY COORD SYSTEM) EITHER EARTH-FIXED OR MOON-FIXED
053115,000104:                                                                                                  #        RP = M(T) * (R - L X R)
053116,000105: 
053117,000106:                                                                                                  #  CALLING SEQUENCE
053118,000107:                                                                                                  #        L       CALL
053119,000108:                                                                                                  #        L+1             R-TO-RP
053120,000109: 
053121,000110:                                                                                                  #  SUBROUTINES USED
053122,000111:                                                                                                  #        EARTHMX, MOONMX, EARTHL
053123,000112: 
053124,000113:                                                                                                  #  INPUT
053125,000114:                                                                                                  #        MPAC = 0 FOR EARTH, NON-ZERO FOR MOON
053126,000115:                                                                                                  #        0-5D = R VECTOR
053127,000116:                                                                                                  #        6-7D = TIME
053128,000117: 
053129,000118:                                                                                                  #        ITEMS AVAILABLE FROM LAUNCH DATA
053130,000119:                                                                                                  #                504LM = THE LIBRATION VECTOR L OF THE MOON AT TIME TIMSUBL, EXPRESSED
053131,000120:                                                                                                  #                IN THE MOON-FIXED COORD. SYSTEM                 RADIANS B0
053132,000121: 
053133,000122:                                                                                                  #        ITEMS NECESSARY FOR SUBROUTINES USED (SEE DESCRIPTION OF SUBR.)
053134,000123: 
053135,000124:                                                                                                  #  OUTPUT
053136,000125:                                                                                                  #        MPAC = RP VECTOR METERS B-29 FOR EARTH, B-27 FOR MOON
053137,000126: 
053138,000127: 26,3366           46020        R-TO-RP            STQ      BHIZ                                  
053139,000128: 26,3367           00050                                    RPREXIT                               
053140,000129: 26,3370           55410                                    RTORPA                                
053141,000130: 26,3371           77624                           CALL                                           
053142,000131: 26,3372           55416                                    MOONMX                                
053143,000132: 26,3373           61375                           VLOAD    VXM                                   
053144,000133: 26,3374           02012                                    504LM                                 #  LP=LM
053145,000134: 26,3375           00025                                    MMATRIX                               
053146,000135: 26,3376           77772                           VSL1                                           #  L = MT(T)*LP          RADIANS B0
053147,000136: 26,3377           51235        RTORPB             VXV      BVSU                                  
053148,000137: 26,3400           00001                                    504RPR                                
053149,000138: 26,3401           00001                                    504RPR                                
053150,000139: 26,3402           77721                           MXV                                            #  M(T)*(R-LXR)          B-2
053151,000140: 26,3403           00025                                    MMATRIX                               
053152,000141: 26,3404           40372        RPRPXXXX           VSL1     SETPD                                 
053153,000142: 26,3405           00001                                    0D                                    
053154,000143: 26,3406           77650                           GOTO                                           
053155,000144: 26,3407           00050                                    RPREXIT                               
053156,000145: 26,3410           77624        RTORPA             CALL                                           #  EARTH COMPUTATIONS
053157,000146: 26,3411           55570                                    EARTHMX                               
053158,000147: 26,3412           77624                           CALL                                           
053159,000148: 26,3413           55622                                    EARTHL                                
053160,000149: 26,3414           77650                           GOTO                                           #  MPAC=L=(-AX,-AY,0)    RAD B-0
053161,000150: 26,3415           55377                                    RTORPB                                
053162,000151: 

Page 1216

053164,000153:                                                                                                  #  ..... MOONMX SUBROUTINE .....
053165,000154:                                                                                                  #  SUBROUTINE TO COMPUTE THE TRANSFORMATION MATRIX M FOR THE MOON
053166,000155: 
053167,000156:                                                                                                  #  CALLING SEQUENCE
053168,000157:                                                                                                  #        L       CALL
053169,000158:                                                                                                  #        L+1             MOONMX
053170,000159: 
053171,000160:                                                                                                  #  SUBROUTINES USED
053172,000161:                                                                                                  #        NEWANGLE
053173,000162: 
053174,000163:                                                                                                  #  INPUT
053175,000164:                                                                                                  #        6-7D = TIME
053176,000165: 
053177,000166:                                                                                                  #        ITEMS AVAILABLE FROM LAUNCH DATA
053178,000167:                                                                                                  #                BSUBO, BDOT
053179,000168:                                                                                                  #                TIMSUBO, NODIO, NODDOT, FSUBO, FDOT
053180,000169:                                                                                                  #                COSI = COS(I)   B-1
053181,000170:                                                                                                  #                SINI = SIN(I)   B-1
053182,000171:                                                                                                  #                I IS THE ANGLE BETWEEN THE MEAN LUNAR EQUATORIAL PLANE AND THE
053183,000172:                                                                                                  #                PLANE OF THE ECLIPTIC (1 DEGREE 32.1 MINUTES)
053184,000173: 
053185,000174:                                                                                                  #  OUTPUT
053186,000175:                                                                                                  #        MMATRIX = 3X3 M MATRIX          B-1 (STORED IN VAC AREA)
053187,000176: 
053188,000177: 26,3416           40220        MOONMX             STQ      SETPD                                 
053189,000178: 26,3417           00051                                    EARTHMXX                              
053190,000179: 26,3420           00011                                    8D                                    
053191,000180: 26,3421           77770                           AXT,1                                          #  B REQUIRES SL 0, SL 5 IN NEWANGLE
053192,000181: 26,3422           00005                                    5                                     
053193,000182: 26,3423           65345                           DLOAD    PDDL                                  #  PD 10D        8-9D=BSUBO
053194,000183: 26,3424           15652                                    BSUBO                                 #                10-11D=BDOT
053195,000184: 26,3425           15644                                    BDOT                                  
053196,000185: 26,3426           45006                           PUSH     CALL                                  #  PD 12D
053197,000186: 26,3427           55543                                    NEWANGLE                              #  EXIT WITH PD 8D AND MPAC= B   REVS B0
053198,000187: 26,3430           71406                           PUSH     COS                                   #  PD 10D
053199,000188: 26,3431           14041                           STODL    COB                                   #  PD 8D         COS(B) B-1
053200,000189: 26,3432           77756                           SIN                                            #                SIN(B) B-1
053201,000190: 26,3433           14043                           STODL    SOB                                   #  SETUP INPUT FOR NEWANGLE
053202,000191: 26,3434           15650                                    FSUBO                                 #                        8-9D=FSUBO
053203,000192: 26,3435           41525                           PDDL     PUSH                                  #  PD 10D THEN 12D       10-11D=FDOT
053204,000193: 26,3436           15642                                    FDOT                                  
053205,000194: 26,3437           45170                           AXT,1    CALL                                  #  F REQUIRES SL 1, SL 6 IN NEWANGLE
053206,000195: 26,3440           00004                                    4                                     
053207,000196: 26,3441           55543                                    NEWANGLE                              #  EXIT WITH PD 8D AND MPAC= F REVS B0
053208,000197: 26,3442           14027                           STODL    AVECTR     +2                         #  SAVE F TEMP
053209,000198: 26,3443           15646                                    NODIO                                 #                        8-9D=NODIO
053210,000199: 26,3444           41525                           PDDL     PUSH                                  #  PD 10D THEN 12D       10-11D=NODDOT
053211,000200: 26,3445           15640                                    NODDOT                                #                        MPAC=T
053212,000201: 26,3446           45170                           AXT,1    CALL                                  #  NODE REQUIRES SL 0, SL 5 IN NEWANGLE
053213,000202: 26,3447           00005                                    5                                     
053214,000203: 26,3450           55543                                    NEWANGLE                              #  EXIT WITH PD 8D AND MPAC= NODI REVS B0

Page 1217

053216,000205: 26,3451           71406                           PUSH     COS                                   #  PD 10D        8-9D= NODI REVS B0
053217,000206: 26,3452           77606                           PUSH                                           #  PD 12D        10-11D= COS(NODI) B-1
053218,000207: 26,3453           00025                           STORE    AVECTR                                
053219,000208: 26,3454           76405                           DMP      SL1R                                  
053220,000209: 26,3455           00041                                    COB                                   #                        COS(NODI) B-1
053221,000210: 26,3456           14035                           STODL    BVECTR     +2                         #  PD 10D  20-25D=AVECTR=COB*SIN(NODI)
053222,000211: 26,3457           76405                           DMP      SL1R                                  #                        SOB*SIN(NODI)
053223,000212: 26,3460           00043                                    SOB                                   
053224,000213: 26,3461           14037                           STODL    BVECTR     +4                         #  PD 8D
053225,000214: 26,3462           41556                           SIN      PUSH                                  #  PD 10D                -SIN(NODI) B-1
053226,000215: 26,3463           77676                           DCOMP                                          #          26-31D=BVECTR=COB*COS(NODI)
053227,000216: 26,3464           14033                           STODL    BVECTR                                #  PD 8D                 SOB*COS(NODI)
053228,000217: 26,3465           00027                                    AVECTR     +2                         #  MOVE F FROM TEMP LOC. TO 504F
053229,000218: 26,3466           14007                           STODL    504F                                  
053230,000219: 26,3467           76405                           DMP      SL1R                                  
053231,000220: 26,3470           00041                                    COB                                   
053232,000221: 26,3471           14027                           STODL    AVECTR     +2                         
053233,000222: 26,3472           00011                                    SINNODI                               #  8-9D=SIN(NODI) B-1
053234,000223: 26,3473           76405                           DMP      SL1R                                  
053235,000224: 26,3474           00043                                    SOB                                   
053236,000225: 26,3475           14031                           STODL    AVECTR     +4                         #                        0
053237,000226: 26,3476           15332                                    HI6ZEROS                              #        8-13D= CVECTR=  -SOB B-1
053238,000227: 26,3477           57525                           PDDL     DCOMP                                 #  PD 10D                COB
053239,000228: 26,3500           00043                                    SOB                                   
053240,000229: 26,3501           63325                           PDDL     PDVL                                  #  PD 12D THEN PD 14D
053241,000230: 26,3502           00041                                    COB                                   
053242,000231: 26,3503           00033                                    BVECTR                                
053243,000232: 26,3504           63361                           VXSC     PDVL                                  #  PD 20D        BVECTR*SINI B-2
053244,000233: 26,3505           15636                                    SINI                                  
053245,000234: 26,3506           00011                                    CVECTR                                
053246,000235: 26,3507           53361                           VXSC     VAD                                   #  PD 14D        CVECTR*COSI B-2
053247,000236: 26,3510           15634                                    COSI                                  
053248,000237: 26,3511           77772                           VSL1                                           
053249,000238: 26,3512           24041                           STOVL    MMATRIX    +12D                       #  PD 8D  M2=BVECTR*SINI+CVECTR*COSI B-1
053250,000239: 26,3513           63361                           VXSC     PDVL                                  #  PD 14D
053251,000240: 26,3514           15636                                    SINI                                  #                CVECTR*SINI B-2
053252,000241: 26,3515           00033                                    BVECTR                                
053253,000242: 26,3516           52361                           VXSC     VSU                                   #  PD 8D         BVECTR*COSI B-2
053254,000243: 26,3517           15634                                    COSI                                  
053255,000244: 26,3520           65372                           VSL1     PDDL                                  #  PD 14D
053256,000245: 26,3521           00007                                    504F                                  #  8-13D=DVECTR=BVECTR*COSI-CVECTR*SINI B-1
053257,000246: 26,3522           74346                           COS      VXSC                                  
053258,000247: 26,3523           00011                                    DVECTR                                
053259,000248: 26,3524           73525                           PDDL     SIN                                   #  PD 20D  14-19D= DVECTR*COSF B-2
053260,000249: 26,3525           00007                                    504F                                  
053261,000250: 26,3526           52361                           VXSC     VSU                                   #  PD 14D        AVECTR*SINF B-2
053262,000251: 26,3527           00025                                    AVECTR                                
053263,000252: 26,3530           77772                           VSL1                                           
053264,000253: 26,3531           14033                           STODL    MMATRIX    +6                         #  M1= AVECTR*SINF-DVECTR*COSF B-1
053265,000254: 26,3532           00007                                    504F                                  

Page 1218

053267,000256: 26,3533           74356                           SIN      VXSC                                  #  PD 8D
053268,000257: 26,3534           71525                           PDDL     COS                                   #  PD 14D  8-13D=DVECTR*SINF B-2
053269,000258: 26,3535           00007                                    504F                                  
053270,000259: 26,3536           53361                           VXSC     VAD                                   #  PD 8D         AVECTR*COSF B-2
053271,000260: 26,3537           00025                                    AVECTR                                
053272,000261: 26,3540           57572                           VSL1     VCOMP                                 
053273,000262: 26,3541           34025                           STCALL   MMATRIX                               #  M0= -(AVECTR*COSF+DVECTR*SINF) B-1
053274,000263: 26,3542           00051                                    EARTHMXX                              
053275,000264: 
053276,000265:                                                                                                  #  COMPUTE X=X0+(XDOT)(T+T0)
053277,000266:                                                                                                  #  8-9D= XO (REVS B-0), PUSHLOC SET AT 12D
053278,000267:                                                                                                  #  10-11D=XDOT (REVS/CSEC) SCALED B+23 FOR WEARTH,B+28 FOR NODDOT AND BDOT
053279,000268:                                                                                                  #                        AND B+27 FOR FDOT
053280,000269:                                                                                                  #  X1=DIFFERENCE IN 23 AND SCALING OF XDOT, =0 FOR WEARTH, 5 FOR NODDOT AND
053281,000270:                                                                                                  #                                        BDOT AND 4 FOR FDOT
053282,000271:                                                                                                  #  6-7D=T (CSEC B-28), TIMSUBO= (CSEC B-42 TRIPLE PREC.)
053283,000272: 
053284,000273: 26,3543           54345        NEWANGLE           DLOAD    SR                                    #  ENTER PD 12D
053285,000274: 26,3544           00007                                    6D                                    
053286,000275: 26,3545           20617                                    14D                                   
053287,000276: 26,3546           72371                           TAD      TLOAD                                 #  CHANGE MODE TO TP
053288,000277: 26,3547           01707                                    TIMSUBO                               
053289,000278: 26,3550           00155                                    MPAC                                  
053290,000279: 26,3551           14017                           STODL    TIMSUBM                               #  T+T0 CSEC B-42
053291,000280: 26,3552           00020                                    TIMSUBM    +1                         
053292,000281: 26,3553           77605                           DMP                                            #  PD 10D        MULT BY XDOT IN 10-11D
053293,000282: 26,3554           43257                           SL*      DAD                                   #  PD 8D         ADD XO IN 8-9D AFTER SHIFTING
053294,000283: 26,3555           20206                                    5,1                                   #                SUCH THAT SCALING IS B-0
053295,000284: 26,3556           67206                           PUSH     SLOAD                                 #  PD 10D  SAVE PARTIAL (X0+XDOT*T) IN 8-9D
053296,000285: 26,3557           00017                                    TIMSUBM                               
053297,000286: 26,3560           41261                           SL       DMP                                   
053298,000287: 26,3561           20212                                    9D                                    
053299,000288: 26,3562           00013                                    10D                                   #  XDOT
053300,000289: 26,3563           43257                           SL*      DAD                                   #  PD 8D         SHIFT SUCH THAT THIS PART OF X
053301,000290: 26,3564           20213                                    10D,1                                 #                IS SCALED REVS/CSEC B-0
053302,000291: 26,3565           77600                           BOV                                            #  TURN OFF OVERFLOW IF SET BY SHIFT
053303,000292: 26,3566           55567                                    +1                                    #  INSTRUCTION BEFORE EXITING
053304,000293: 26,3567           77616                           RVQ                                            #  MPAC=X= X0+(XDOT)(T+T0)       REVS B0
053305,000294: 

Page 1219

053307,000296:                                                                                                  #  ..... EARTHMX SUBROUTINE .....
053308,000297:                                                                                                  #  SUBROUTINE TO COMPUTE THE TRANSFORMATION MATRIX M FOR THE EARTH
053309,000298: 
053310,000299:                                                                                                  #  CALLING SEQUENCE
053311,000300:                                                                                                  #        L       CALL
053312,000301:                                                                                                  #        L+1             EARTHMX
053313,000302: 
053314,000303:                                                                                                  #  SUBROUTINES USED
053315,000304:                                                                                                  #        NEWANGLE
053316,000305: 
053317,000306:                                                                                                  #  INPUT
053318,000307:                                                                                                  #        INPUT AVAILABLE FROM LAUNCH DATA        AZO REVS B-0
053319,000308:                                                                                                  #                                                TEPHEM CSEC B-42
053320,000309:                                                                                                  #        6-7D= TIME CSEC B-28
053321,000310: 
053322,000311:                                                                                                  #  OUTPUT
053323,000312:                                                                                                  #        MMATRIX= 3X3 M MATRIX B-1 (STORED IN VAC AREA)
053324,000313: 
053325,000314: 26,3570           40220        EARTHMX            STQ      SETPD                                 #  SET 8-9D=AZO
053326,000315: 26,3571           00051                                    EARTHMXX                              
053327,000316: 26,3572           00011                                    8D                                    #  10-11D=WEARTH
053328,000317: 26,3573           77770                           AXT,1                                          #  FOR SL 5, AND SL 10 IN NEWANGLE
053329,000318: 26,3574           00000                                    0                                     
053330,000319: 26,3575           65345                           DLOAD    PDDL                                  #  LEAVING PD SET AT 12D FOR NEWANGLE
053331,000320: 26,3576           01712                                    AZO                                   
053332,000321: 26,3577           15654                                    WEARTH                                
053333,000322: 26,3600           45006                           PUSH     CALL                                  
053334,000323: 26,3601           55543                                    NEWANGLE                              
053335,000324: 26,3602           41401                           SETPD    PUSH                                  #  18-19D=504AZ
053336,000325: 26,3603           00023                                    18D                                   #                         COS(AZ)   SIN(AZ)     0
053337,000326: 26,3604           65346                           COS      PDDL                                  #  20-37D=  MMATRIX=     -SIN(AZ)   COS(AZ)     0    B-1
053338,000327: 26,3605           00023                                    504AZ                                 #                            0         0        1
053339,000328: 26,3606           65356                           SIN      PDDL                                  
053340,000329: 26,3607           15332                                    HI6ZEROS                              
053341,000330: 26,3610           73525                           PDDL     SIN                                   
053342,000331: 26,3611           00023                                    504AZ                                 
053343,000332: 26,3612           65276                           DCOMP    PDDL                                  
053344,000333: 26,3613           00023                                    504AZ                                 
053345,000334: 26,3614           63346                           COS      PDVL                                  
053346,000335: 26,3615           15332                                    HI6ZEROS                              
053347,000336: 26,3616           41525                           PDDL     PUSH                                  
053348,000337: 26,3617           15330                                    HIDPHALF                              
053349,000338: 26,3620           77650                           GOTO                                           
053350,000339: 26,3621           00051                                    EARTHMXX                              
053351,000340: 

Page 1220

053353,000342:                                                                                                  #  ..... EARTHL SUBROUTINE .....
053354,000343:                                                                                                  #  SUBROUTINE TO COMPUTE L VECTOR FOR EARTH
053355,000344: 
053356,000345:                                                                                                  #  CALLING SEQUENCE
053357,000346:                                                                                                  #        L       CALL
053358,000347:                                                                                                  #        L+1             EARTHL
053359,000348: 
053360,000349:                                                                                                  #  INPUT
053361,000350:                                                                                                  #        AXO,AYO SET AT LAUNCH TIME WITH AYO IMMEDIATELY FOLLOWING AXO IN CORE
053362,000351: 
053363,000352:                                                                                                  #  OUTPUT
053364,000353:                                                                                                  #                -AX
053365,000354:                                                                                                  #        MPAC=   -AY     RADIANS B-0
053366,000355:                                                                                                  #                  0
053367,000356: 
053368,000357: 26,3622           57545        EARTHL             DLOAD    DCOMP                                 
053369,000358: 26,3623           01716                                    AXO                                   
053370,000359: 26,3624           14017                           STODL    504LPL                                
053371,000360: 26,3625           01714                                    -AYO                                  
053372,000361: 26,3626           14021                           STODL    504LPL     +2                         
053373,000362: 26,3627           15332                                    HI6ZEROS                              
053374,000363: 26,3630           24023                           STOVL    504LPL     +4                         
053375,000364: 26,3631           00017                                    504LPL                                
053376,000365: 26,3632           77616                           RVQ                                            
053377,000366: 

Page 1221

053379,000368:                                                                                                  #  CONSTANTS AND ERASABLE ASSIGNMENTS
053380,000369: 
053381,000370: 26,3633  04,3453               1B1                =        DP1/2                                 #  1 SCALED B-1
053382,000371: 26,3633           17775 01734  COSI               2DEC     .99964115  B-1                        #  COS(1 DEG 32.1 MIN) B-1
053383,000372: 26,3635           00333 16153  SINI               2DEC     .02678760  B-1                        #  SIN(1 DEG 32.1 MIN) B-1
053384,000373: 26,3637  0000050               RPREXIT            =        S1                                    #  R-TO-RP AND RP-TO-R SUBR EXIT
053385,000374: 26,3637  0000051               EARTHMXX           =        S2                                    #  EARTHMX, MOONMX SUBR. EXITS
053386,000375: 26,3637                        504RPR             =        0D                                    #  6 REGS        R OR RP VECTOR
053387,000376: 26,3637                        SINNODI            =        8D                                    #  2             SIN(NODI)
053388,000377: 26,3637                        DVECTR             =        8D                                    #  6             D VECTOR MOON
053389,000378: 26,3637                        CVECTR             =        8D                                    #  6             C VECTR MOON
053390,000379: 26,3637                        504AZ              =        18D                                   #  2             AZ
053391,000380: 26,3637                        TIMSUBM            =        14D                                   #  3             TIME SUB M (MOON) T+T0 IN GETAZ
053392,000381: 26,3637                        504LPL             =        14D                                   #  6             L OR LP VECTOR
053393,000382: 26,3637                        AVECTR             =        20D                                   #  6             A VECTOR (MOON)
053394,000383: 26,3637                        BVECTR             =        26D                                   #  6             B VECTOR (MOON)
053395,000384: 26,3637                        MMATRIX            =        20D                                   #  18            M MATRIX
053396,000385: 26,3637                        COB                =        32D                                   #  2             COS(B) B-1
053397,000386: 26,3637                        SOB                =        34D                                   #  2             SIN(B) B-1
053398,000387: 26,3637                        504F               =        6D                                    #  2             F(MOON)
053399,000388: 
053400,000389: 26,3637           77665 42175  NODDOT             2DEC     -.457335143 E-2                        #  REVS/CSEC B+28=-1.07047016 E-6  RAD/SEC
053401,000390: 26,3641           22211 00265  FDOT               2DEC     .570862491                            #  REVS/CSEC B+27= 2.67240019 E-6  RAD/SEC
053402,000391: 26,3643           77777 77767  BDOT               2DEC     -3.07500412 E-8                        #  REVS/CSEC B+28=-7.19756666 E-14 RAD/SEC
053403,000392: 26,3645           41215 66331  NODIO              2DEC     -.960101269                            #  REVS B-0      =-6.03249419      RAD
053404,000393: 26,3647           15237 26751  FSUBO              2DEC     .415998375                            #  REVS B-0      = 2.61379488      RAD
053405,000394: 26,3651           02052 35713  BSUBO              2DEC     .0651205006                            #  REVS B=0      = 0.409164173     RAD
053406,000395: 26,3653           37116 32630  WEARTH             2DEC     .973561855                            #  REVS/CSEC B+23= 7.29211515 E-5  RAD/SEC
053407,000396: 

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