00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef _CELESTIALBODY_H_
00027 #define _CELESTIALBODY_H_
00028
00029 #ifndef __cplusplus
00030 # error This library requires C++
00031 #endif
00032
00033
00034 #include <simgear/constants.h>
00035
00036 class Star;
00037
00038 class CelestialBody
00039 {
00040 protected:
00041
00042 double NFirst;
00043 double NSec;
00044 double iFirst;
00045 double iSec;
00046 double wFirst;
00047 double wSec;
00048 double aFirst;
00049 double aSec;
00050 double eFirst;
00051 double eSec;
00052 double MFirst;
00053 double MSec;
00054
00055 double N, i, w, a, e, M;
00056
00057 double rightAscension, declination;
00058 double r, R, s, FV;
00059 double magnitude;
00060 double lonEcl, latEcl;
00061
00062 double sgCalcEccAnom(double M, double e);
00063 double sgCalcActTime(double mjd);
00064 void updateOrbElements(double mjd);
00065
00066 public:
00067 CelestialBody(double Nf, double Ns,
00068 double If, double Is,
00069 double wf, double ws,
00070 double af, double as,
00071 double ef, double es,
00072 double Mf, double Ms, double mjd);
00073 CelestialBody(double Nf, double Ns,
00074 double If, double Is,
00075 double wf, double ws,
00076 double af, double as,
00077 double ef, double es,
00078 double Mf, double Ms);
00079 void getPos(double *ra, double *dec);
00080 void getPos(double *ra, double *dec, double *magnitude);
00081 double getRightAscension();
00082 double getDeclination();
00083 double getMagnitude();
00084 double getLon();
00085 double getLat();
00086 void updatePosition(double mjd, Star *ourSun);
00087 };
00088
00089 inline double CelestialBody::getRightAscension() { return rightAscension; }
00090 inline double CelestialBody::getDeclination() { return declination; }
00091 inline double CelestialBody::getMagnitude() { return magnitude; }
00092
00093 inline double CelestialBody::getLon()
00094 {
00095 return lonEcl;
00096 }
00097
00098 inline double CelestialBody::getLat()
00099 {
00100 return latEcl;
00101 }
00102
00103 #endif // _CELESTIALBODY_H_
00104