File: ssattest.cpp

package info (click to toggle)
pluto-lunar 0.0~git20180825.e34c1d1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, forky, sid, trixie
  • size: 1,584 kB
  • sloc: cpp: 18,100; makefile: 653; ansic: 368
file content (45 lines) | stat: -rw-r--r-- 1,391 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/* Copyright (C) 2018, Project Pluto

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA. */

#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include "watdefs.h"
#include "lunar.h"

int main( const int argc, const char **argv)
{
   int i;
   double loc[3], jd;

   if( argc != 2)
      {
      printf( "'ssattest' takes a JD on the command line,  and outputs\n");
      printf( "coordinates for the eight main satellites of Saturn.\n");
      return( -1);
      }
   jd = atof( argv[1]);
   printf( "Date: %.5f\n", jd);
   for( i = 0; i < 8; i++)
      {
      jd = atof( argv[1]);
      calc_ssat_loc( jd, loc, i, 0L);
      printf( "%d: %9.6f %9.6f %9.6f\n", i, loc[0] * 100., loc[1] * 100.,
                  loc[2] * 100.);
      }
   return( 0);
}