]> git.mxchange.org Git - simgear.git/blobdiff - Astro/orbits.c
Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
[simgear.git] / Astro / orbits.c
index 50a283668e820e32c8e6434882558f00e5985ed7..598ecd7861a1feef1983e7b9cc907299b8f3a82d 100644 (file)
  **************************************************************************/
 
 
+#include <math.h>
 #include <string.h>
 
-#include "orbits.h"
-
-#include "../Include/general.h"
-#include "../Time/fg_time.h"
+#include <Astro/orbits.h>
 
+#include <Include/general.h>
+#include <Time/fg_time.h>
+#include <Main/fg_debug.h>
 
 struct OrbElements pltOrbElements[9];
 
@@ -81,7 +82,7 @@ double fgCalcEccAnom(double M, double e)
         do
         {
                E1 = E0 - (E0 - e * sin(E0) - M) / (1 - e * cos(E0));
-            diff = abs(E0 - E1);
+            diff = fabs(E0 - E1);
             E0 = E1;
                }
         while (diff > fgDegToRad(0.001));
@@ -125,7 +126,7 @@ void fgSolarSystemInit(struct fgTIME t)
    int i;
    FILE *data;
 
-   printf("Initializing solar system\n");
+   fgPrintf( FG_ASTRO, FG_INFO, "Initializing solar system\n");
 
    /* build the full path name to the orbital elements database file */
    g = &general;
@@ -136,11 +137,11 @@ void fgSolarSystemInit(struct fgTIME t)
 
    if ( (data = fopen(path, "r")) == NULL )
    {
-           printf("Cannot open data file: '%s'\n", path);
+           fgPrintf( FG_ASTRO, FG_ALERT, "Cannot open data file: '%s'\n", path);
            return;
    }
    #ifdef DEBUG
-   printf("  reading datafile %s\n", path);
+   fgPrintf( FG_ASTRO, FG_INFO, "  reading datafile %s\n", path);
    #endif
 
    /* for all the objects... */
@@ -173,9 +174,20 @@ void fgSolarSystemUpdate(struct OrbElements *planet, struct fgTIME t)
 
 
 /* $Log$
-/* Revision 1.1  1998/01/07 03:16:17  curt
-/* Moved from .../Src/Scenery/ to .../Src/Astro/
+/* Revision 1.4  1998/01/27 00:47:47  curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
 /*
+ * Revision 1.3  1998/01/22 02:59:27  curt
+ * Changed #ifdef FILE_H to #ifdef _FILE_H
+ *
+ * Revision 1.2  1998/01/19 19:26:58  curt
+ * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
+ * This should simplify things tremendously.
+ *
+ * Revision 1.1  1998/01/07 03:16:17  curt
+ * Moved from .../Src/Scenery/ to .../Src/Astro/
+ *
  * Revision 1.6  1997/12/30 20:47:52  curt
  * Integrated new event manager with subsystem initializations.
  *