1 /**************************************************************************
2 * orbits.h - calculates the orbital elements of the sun, moon and planets.
3 * For inclusion in flight gear
5 * Written 1997 by Durk Talsma, started October 19, 1997.
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of the
10 * License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 * (Log is kept at end of this file)
23 **************************************************************************/
33 #include "../Time/fg_time.h"
37 #define STANDARDEPOCH 2000
38 #define PIOVER180 1.74532925199433E-002
46 double NFirst; /* longitude of the ascending node first part */
47 double NSec; /* longitude of the ascending node second part */
48 double iFirst; /* inclination to the ecliptic first part */
49 double iSec; /* inclination to the ecliptic second part */
50 double wFirst; /* first part of argument of perihelion */
51 double wSec; /* second part of argument of perihelion */
52 double aFirst; /* semimayor axis first part*/
53 double aSec; /* semimayor axis second part */
54 double eFirst; /* eccentricity first part */
55 double eSec; /* eccentricity second part */
56 double MFirst; /* Mean anomaly first part */
57 double MSec; /* Mean anomaly second part */
59 double N, i, w, a, e, M; /* the resultant orbital elements, obtained from the former */
62 struct CelestialCoord {
63 double RightAscension;
69 double fgDegToRad(double angle);
70 double fgCalcEccAnom(double M, double e);
71 double fgCalcActTime(struct fgTIME t);
73 void fgReadOrbElements(struct OrbElements *dest, FILE *src);
74 void fgSolarSystemInit(struct fgTIME t);
75 void fgSolarSystemUpdate(struct OrbElements *planets, struct fgTIME t);
82 /* Revision 1.1 1997/10/25 03:16:10 curt
83 /* Initial revision of code contributed by Durk Talsma.