int main( const int argc, const char **argv) { const int test_differences = (argc == 1 || argc == 3); const double jde = (argc == 1 ? 2451539.5 : atof( argv[1])); int nSat; // loop counter // Process each satellite in turn. setvbuf( stdout, NULL, _IONBF, 0); for (nSat=0; nSat<5; nSat++) { double dRect[6]; // satellite coordinates // Retrieve the coordinates of the satellite relative to the // centre of Saturn. These are equatorial coordinates for the // mean ecliptic and epoch of J2000.0. Positions in AU, // velocities in AU/second. Printed out in km and km/s. memset( dRect, 0, 6 * sizeof( double)); gust86_posn( jde, nSat, dRect ); if( test_differences) subtract_test_data( dRect, nSat, 0); printf( "%d: %14.6lf %14.6lf %14.6lf\n", nSat, dRect[0] * AU_IN_KM, dRect[1] * AU_IN_KM, dRect[2] * AU_IN_KM); if( test_differences) subtract_test_data( dRect + 3, nSat, 1); printf( " %14.6lf %14.6lf %14.6lf\n", dRect[3] * AU_IN_KM, dRect[4] * AU_IN_KM, dRect[5] * AU_IN_KM); } return( 0); }
int main( int argc, char **argv) { const int test_differences = (argc == 1 || argc == 3); const double jde = (argc == 1 ? 2451539.5 : atof( argv[1])); int nSat; // loop counter const char *sat_names[5] = { "Ariel", "Umbriel", "Titania", "Oberon", "Miranda" }; // Process each satellite in turn. for (nSat=0; nSat<5; nSat++) { double dRect[6]; // satellite coordinates // Retrieve the coordinates of the satellite relative to the // centre of Saturn. These are equatorial coordinates for the // mean ecliptic and epoch of J2000.0. Positions in AU, // velocities in AU/second. Printed out in km and km/s. gust86_posn( jde, nSat, dRect ); if( test_differences) subtract_test_data( dRect, nSat, 0); printf( "%d %-8s: %14.6lf %14.6lf %14.6lf\n", nSat, sat_names[nSat], dRect[0] * AU_IN_KM, dRect[1] * AU_IN_KM, dRect[2] * AU_IN_KM); if( test_differences) subtract_test_data( dRect + 3, nSat, 1); printf( " %14.6lf %14.6lf %14.6lf\n", dRect[3] * AU_IN_KM, dRect[4] * AU_IN_KM, dRect[5] * AU_IN_KM); } return( 0); }