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.

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

Page 1213

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

Page 1214

053093,000097: 26,3364           77650                           GOTO                                           
053094,000098: 26,3365           55350                                    RPTORB                                
053095,000099: 

Page 1215

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

Page 1216

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

Page 1217

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

Page 1218

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

Page 1219

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

Page 1220

053338,000342:                                                                                                  #  ..... EARTHL SUBROUTINE .....
053339,000343:                                                                                                  #  SUBROUTINE TO COMPUTE L VECTOR FOR EARTH
053340,000344: 
053341,000345:                                                                                                  #  CALLING SEQUENCE
053342,000346:                                                                                                  #        L       CALL
053343,000347:                                                                                                  #        L+1             EARTHL
053344,000348: 
053345,000349:                                                                                                  #  INPUT
053346,000350:                                                                                                  #        AXO,AYO SET AT LAUNCH TIME WITH AYO IMMEDIATELY FOLLOWING AXO IN CORE
053347,000351: 
053348,000352:                                                                                                  #  OUTPUT
053349,000353:                                                                                                  #                -AX
053350,000354:                                                                                                  #        MPAC=   -AY     RADIANS B-0
053351,000355:                                                                                                  #                  0
053352,000356: 
053353,000357: 26,3622           57545        EARTHL             DLOAD    DCOMP                                 
053354,000358: 26,3623           01716                                    AXO                                   
053355,000359: 26,3624           14017                           STODL    504LPL                                
053356,000360: 26,3625           01714                                    -AYO                                  
053357,000361: 26,3626           14021                           STODL    504LPL     +2                         
053358,000362: 26,3627           15332                                    HI6ZEROS                              
053359,000363: 26,3630           24023                           STOVL    504LPL     +4                         
053360,000364: 26,3631           00017                                    504LPL                                
053361,000365: 26,3632           77616                           RVQ                                            
053362,000366: 

Page 1221

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

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