84 const double deg2rad =
pi / 180.0;
85 const double xpdotp = 1440.0 / (2.0 *
pi);
87 double sec, mu, radiusearthkm, tumin, xke, j2, j3, j4, j3oj2;
88 double startsec, stopsec, startdayofyr, stopdayofyr, jdstart, jdstop;
89 int startyear, stopyear, startmon, stopmon, startday, stopday, starthr, stophr, startmin,
91 int cardnumb, numb, j;
92 long revnum = 0, elnum = 0;
93 char classification, intldesg[11];
95 int mon, day, hr, minute, nexp, ibexp;
98 getgravconst(whichconst, tumin, mu, radiusearthkm, xke, j2, j3, j4, j3oj2);
104 for (j = 10; j <= 15; j++)
106 if (longstr1[j] ==
' ')
112 if (longstr1[44] !=
' ')
114 longstr1[43] = longstr1[44];
117 if (longstr1[7] ==
' ')
121 if (longstr1[9] ==
' ')
125 for (j = 45; j <= 49; j++)
127 if (longstr1[j] ==
' ')
132 if (longstr1[51] ==
' ')
136 if (longstr1[53] !=
' ')
138 longstr1[52] = longstr1[53];
142 for (j = 26; j <= 32; j++)
144 if (longstr2[j] ==
' ')
149 if (longstr1[62] ==
' ')
153 if (longstr1[68] ==
' ')
159 "%2d %5ld %1c %10s %2d %12lf %11lf %7lf %2d %7lf %2d %2d %6ld ",
176 if (longstr2[52] ==
' ')
179 "%2d %5ld %9lf %9lf %8lf %9lf %9lf %10lf %6ld %lf %lf %lf \n",
196 "%2d %5ld %9lf %9lf %8lf %9lf %9lf %11lf %6ld %lf %lf %lf \n",
213 if (longstr2[52] ==
' ')
216 "%2d %5ld %9lf %9lf %8lf %9lf %9lf %10lf %6ld \n",
230 "%2d %5ld %9lf %9lf %8lf %9lf %9lf %11lf %6ld \n",
244 satrec.
no = satrec.
no / xpdotp;
245 satrec.
nddot = satrec.
nddot * pow(10.0, nexp);
246 satrec.
bstar = satrec.
bstar * pow(10.0, ibexp);
249 satrec.
a = pow(satrec.
no * tumin, (-2.0 / 3.0));
250 satrec.
ndot = satrec.
ndot / (xpdotp * 1440.0);
251 satrec.
nddot = satrec.
nddot / (xpdotp * 1440.0 * 1440);
257 satrec.
mo = satrec.
mo * deg2rad;
259 satrec.
alta = satrec.
a * (1.0 + satrec.
ecco) - 1.0;
260 satrec.
altp = satrec.
a * (1.0 - satrec.
ecco) - 1.0;
283 if ((typerun !=
'v') && (typerun !=
'c'))
286 if (typeinput ==
'e')
288 printf(
"input start prop year mon day hr min sec \n");
290 silence = scanf(
"%i %i %i %i %i %lf",
298 jday(startyear, startmon, startday, starthr, startmin, startsec, jdstart);
300 printf(
"input stop prop year mon day hr min sec \n");
301 silence = scanf(
"%i %i %i %i %i %lf",
309 jday(stopyear, stopmon, stopday, stophr, stopmin, stopsec, jdstop);
311 startmfe = (jdstart - satrec.
jdsatepoch) * 1440.0;
312 stopmfe = (jdstop - satrec.
jdsatepoch) * 1440.0;
314 printf(
"input time step in minutes \n");
315 silence = scanf(
"%lf", &deltamin);
318 if (typeinput ==
'd')
320 printf(
"input start year dayofyr \n");
321 silence = scanf(
"%i %lf", &startyear, &startdayofyr);
322 printf(
"input stop year dayofyr \n");
323 silence = scanf(
"%i %lf", &stopyear, &stopdayofyr);
325 days2mdhms(startyear, startdayofyr, mon, day, hr, minute, sec);
326 jday(startyear, mon, day, hr, minute, sec, jdstart);
327 days2mdhms(stopyear, stopdayofyr, mon, day, hr, minute, sec);
328 jday(stopyear, mon, day, hr, minute, sec, jdstop);
330 startmfe = (jdstart - satrec.
jdsatepoch) * 1440.0;
331 stopmfe = (jdstop - satrec.
jdsatepoch) * 1440.0;
333 printf(
"input time step in minutes \n");
334 silence = scanf(
"%lf", &deltamin);
337 if (typeinput ==
'm')
339 printf(
"input start min from epoch \n");
340 silence = scanf(
"%lf", &startmfe);
341 printf(
"input stop min from epoch \n");
342 silence = scanf(
"%lf", &stopmfe);
343 printf(
"input time step in minutes \n");
344 silence = scanf(
"%lf", &deltamin);
void twoline2rv(char longstr1[130], char longstr2[130], char typerun, char typeinput, char opsmode, gravconsttype whichconst, double &startmfe, double &stopmfe, double &deltamin, elsetrec &satrec)
bool sgp4init(gravconsttype whichconst, char opsmode, const long int satn, const double epoch, const double xbstar, const double xecco, const double xargpo, const double xinclo, const double xmo, const double xno, const double xnodeo, elsetrec &satrec)