'TLE DECODE PROGRAM 'constants pi = 3.141592653# tpi = pi * 2 '2 pi rd = 180! / pi 'radians to degrees G = 6.6726E-11 'Gravitational constant Me = 5.9736E+24 'Mass of Earth Re = 6378.145# 'equatorial radius (km) CLS 'open TLE file filenam$ = "iss.tle" 'change this line to read in your TLE file OPEN filenam$ FOR INPUT AS #1 'assume we have 3 lines in the file with correct TLE format 'input data LINE INPUT #1, satnam$ PRINT "Satellite ID : "; satnam$ PRINT LINE INPUT #1, s$ PRINT s$ IF LEFT$(s$, 1) <> "1" THEN PRINT "Incorrect Data": END sat$ = "Catalog #" + MID$(s$, 3, 5) + " Designation - " + MID$(s$, 10, 6) yr0 = 1900 + VAL(MID$(s$, 18, 3)) IF yr0 < 1958 THEN yr0 = yr0 + 100 T0 = VAL(MID$(s$, 21, 12)) elset = VAL(MID$(s$, 65, 4)) decay = VAL(MID$(s$, 34, 10)) LINE INPUT #1, s$ PRINT s$ PRINT IF LEFT$(s$, 1) <> "2" THEN PRINT "Incorrect Data": END inc = VAL(MID$(s$, 9, 8)) RAANd = VAL(MID$(s$, 18, 8)) e = VAL(MID$(s$, 27, 7)) / 1E+07 w0d = VAL(MID$(s$, 35, 8)) MA0d = VAL(MID$(s$, 44, 8)) MMrev = VAL(MID$(s$, 53, 11)) rev0 = VAL(MID$(s$, 64, 5)) 'change units - mostly only used by prediction program i = inc / rd 'inclination (radians) RAAN = RAANd / rd 'RA ascending node (radians) w0 = w0d / rd 'argument of perigee (radians) MA0 = MA0d / rd 'mean anomaly (radians) MM = MMrev * tpi 'mean motion (radians/day) dec = decay * tpi 'decay (radians/day/day) 'compute additional parameters a0 = (7.46496 * G * Me / MM / MM) ^ (1! / 3!) 'semimajor axis (km) PER = 1440 / MMrev 'period (mins) htae = a0 - Re 'height ref equat and a0 (km) pht = a0 * (1 - e) - Re 'perigee height aht = a0 * (1 + e) - Re 'apogee height day = INT(T0) fracday = T0 - day dechour = fracday * 24 hr = INT(dechour) min = INT((dechour - hr) * 60) 'print parameters PRINT USING "Epoch time = year #### day ### hour ## minute ## UT"; yr0; day; hr; min PRINT PRINT "Orbit Size and Shape" PRINT USING " Semimajor axis = ###### km"; a0 PRINT USING " Eccentricity = #.#### "; e PRINT "Orbit Orientation" PRINT USING " Inclination = ###.## deg"; inc PRINT USING " RAAN = ###.## deg"; RAANd PRINT USING " Perigee arg. = ###.## deg"; w0d PRINT "Satellite Information" PRINT USING " Mean motion = ##.### rev/day"; MMrev PRINT USING " Period = ####.# minutes"; PER PRINT USING " Perigee height = ###### km"; pht PRINT USING " Apogee height = ###### km"; aht PRINT USING " Epoch anomaly = ###.## deg"; MA0d PRINT USING " Orbit number = ######"; rev0 PRINT USING " TLE set number = ######"; elset END