00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00043 #ifndef EPHEMERIS_H
00044 #define EPHEMERIS_H
00045
00046 #include "FlyLegacy.h"
00047
00048
00049
00050
00051
00052 #define LUNATION_DAYS 29.530589
00053
00054
00055
00056
00057
00058 typedef struct {
00059 double N;
00060 double i;
00061 double w;
00062 double a;
00063 double e;
00064 double M;
00065 } SOrbitalElements;
00066
00067
00068 class CSol;
00069
00070 class CCelestialBody
00071 {
00072 protected:
00073 double Nf, If, wf, af, ef, Mf;
00074 double Ns, Is, ws, as, es, Ms;
00075 double N, i, w, a, e, M;
00076
00077 double rightAscension, declination;
00078 double r, R, s, FV;
00079 double magnitude;
00080 double lonEcl, latEcl;
00081
00082 protected:
00083 double CalcEccAnom (double M, double e);
00084 double CalcActTime (double mjd);
00085 void UpdateOrbElements (double mjd);
00086
00087 public:
00088 CCelestialBody (double Nf, double If, double wf, double af, double ef, double Mf,
00089 double Ns, double Is, double ws, double as, double es, double Ms,
00090 double mjd);
00091
00092 CCelestialBody (double Nf, double If, double wf, double af, double ef, double Mf,
00093 double Ns, double Is, double ws, double as, double es, double Ms);
00094
00095 void SetElements (double Nf, double If, double wf, double af, double ef, double Mf,
00096 double Ns, double Is, double ws, double as, double es, double Ms,
00097 double mjd);
00098
00099 void SetElements (double Nf, double If, double wf, double af, double ef, double Mf,
00100 double Ns, double Is, double ws, double as, double es, double Ms);
00101
00102 void GetPos(double *ra, double *dec);
00103 void GetPos(double *ra, double *dec, double *magnitude);
00104 double GetRightAscension();
00105 double GetDeclination();
00106 double GetMagnitude();
00107
00108 double GetLon();
00109 double GetLat();
00110 void UpdatePosition (double mjd, CSol *ourSun);
00111 };
00112
00113
00114 class CSol : public CCelestialBody
00115 {
00116 public:
00117 CSol (double mjd);
00118 CSol ();
00119 ~CSol();
00120
00121
00122 void UpdatePosition (double mjd);
00123
00124 inline double getM(void) { return M; }
00125 inline double getw(void) { return w; }
00126 inline double getxs(void) { return xs; }
00127 inline double getys(void) { return ys; }
00128 inline double getDistance(void) { return distance; }
00129
00130 private:
00131 double xs, ys;
00132 double distance;
00133 };
00134
00135
00136 class CMoon : public CCelestialBody {
00137 public:
00138 CMoon (double mjd);
00139 CMoon ();
00140 ~CMoon ();
00141
00142 float age;
00143
00144
00145 void UpdatePosition(double mjd, double lst, double lat, CSol *ourSun);
00146 float GetAge (void);
00147 };
00148
00149
00150 class CMercury : public CCelestialBody
00151 {
00152 public:
00153 CMercury (double mjd);
00154 CMercury ();
00155
00156
00157 void UpdatePosition(double mjd, CSol* ourSun);
00158 };
00159
00160
00161 class CVenus : public CCelestialBody
00162 {
00163 public:
00164 CVenus (double mjd);
00165 CVenus ();
00166
00167
00168 void UpdatePosition(double mjd, CSol *ourSun);
00169 };
00170
00171
00172 class CMars : public CCelestialBody
00173 {
00174 public:
00175 CMars ( double mjd );
00176 CMars ();
00177
00178
00179 void UpdatePosition(double mjd, CSol *ourSun);
00180 };
00181
00182
00183 class CJupiter : public CCelestialBody
00184 {
00185 public:
00186 CJupiter (double mjd);
00187 CJupiter ();
00188
00189
00190 void UpdatePosition(double mjd, CSol *ourSun);
00191 };
00192
00193
00194 class CSaturn : public CCelestialBody
00195 {
00196 public:
00197 CSaturn (double mjd);
00198 CSaturn ();
00199
00200
00201 void UpdatePosition(double mjd, CSol *ourSun);
00202 };
00203
00204
00205 #endif // EPHEMERIS_H
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231