]> git.mxchange.org Git - flightgear.git/blob - Astro/orbits.h
Changed #ifdef FILE_H to #ifdef _FILE_H
[flightgear.git] / Astro / orbits.h
1 /**************************************************************************
2  * orbits.h - calculates the orbital elements of the sun, moon and planets.
3  *            For inclusion in flight gear
4  *
5  * Written 1997 by Durk Talsma, started October 19, 1997.
6  *
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.
11  *
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.
16  *
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.
20  *
21  * $Id$
22  * (Log is kept at end of this file)
23  **************************************************************************/
24
25
26 #ifndef _ORBITS_H
27 #define _ORBITS_H
28
29
30 #include <stdio.h>
31 #include <math.h>
32
33 #include <Time/fg_time.h>
34
35
36
37 #define STANDARDEPOCH 2000
38 #define PIOVER180       1.74532925199433E-002
39
40 struct SunPos {
41     double xs;
42     double ys;
43     double dist;
44 };
45
46 struct OrbElements {
47     double NFirst;              /* longitude of the ascending node first part */
48     double NSec;                /* longitude of the ascending node second part */
49     double iFirst;              /* inclination to the ecliptic first part */
50     double iSec;                /* inclination to the ecliptic second part */
51     double wFirst;              /* first part of argument of perihelion */
52     double wSec;                /* second part of argument of perihelion */
53     double aFirst;              /* semimayor axis first part*/
54     double aSec;                /* semimayor axis second part */
55     double eFirst;              /* eccentricity first part */
56     double eSec;                /* eccentricity second part */
57     double MFirst;              /* Mean anomaly first part */
58     double MSec;                /* Mean anomaly second part */
59
60     double N, i, w, a, e, M;    /* the resultant orbital elements, obtained from the former */
61 };
62
63 struct CelestialCoord {
64     double RightAscension;
65     double Declination;
66     double distance;
67     double magnitude;
68 };
69
70
71 double fgDegToRad(double angle);
72 double fgCalcEccAnom(double M, double e);
73 double fgCalcActTime(struct fgTIME t);
74
75 void fgReadOrbElements(struct OrbElements *dest, FILE *src);
76 void fgSolarSystemInit(struct fgTIME t);
77 void fgSolarSystemUpdate(struct OrbElements *planets, struct fgTIME t);
78
79
80 #endif /* _ORBITS_H */
81
82
83 /* $Log$
84 /* Revision 1.3  1998/01/22 02:59:27  curt
85 /* Changed #ifdef FILE_H to #ifdef _FILE_H
86 /*
87  * Revision 1.2  1998/01/19 19:26:58  curt
88  * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
89  * This should simplify things tremendously.
90  *
91  * Revision 1.1  1998/01/07 03:16:17  curt
92  * Moved from .../Src/Scenery/ to .../Src/Astro/
93  *
94  * Revision 1.2  1997/12/30 16:36:52  curt
95  * Merged in Durk's changes ...
96  *
97  * Revision 1.1  1997/10/25 03:16:10  curt
98  * Initial revision of code contributed by Durk Talsma.
99  *
100  */