head 1.4; access; symbols; locks; strict; comment @# @; 1.4 date 2002.09.07.01.50.35; author curt; state Exp; branches; next 1.3; 1.3 date 2002.08.31.19.01.50; author curt; state Exp; branches; next 1.2; 1.2 date 2002.08.31.18.53.58; author curt; state Exp; branches; next 1.1; 1.1 date 2002.02.15.17.21.54; author curt; state Exp; branches; next ; desc @@ 1.4 log @Updated doxygen docs. @ text @
Main Page Class Hierarchy Compound List File List Compound Members File Members

# celestialBody.hxx

    00001 /**************************************************************************
    00002  * celestialBody.hxx
    00003  * Written by Durk Talsma. Originally started October 1997, for distribution
    00004  * with the FlightGear project. Version 2 was written in August and
    00005  * September 1998. This code is based upon algorithms and data kindly
    00006  * provided by Mr. Paul Schlyter. (pausch@@saaf.se).
    00007  *
    00008  * This library is free software; you can redistribute it and/or
    00009  * modify it under the terms of the GNU Library General Public
    00010  * License as published by the Free Software Foundation; either
    00011  * version 2 of the License, or (at your option) any later version.
    00012  *
    00013  * This library is distributed in the hope that it will be useful,
    00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00016  * Library General Public License for more details.
    00017  *
    00018  * You should have received a copy of the GNU Library General Public
    00019  * License along with this library; if not, write to the
    00020  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    00021  * Boston, MA  02111-1307, USA.
    00022  *
    00023  * $Id: celestialBody.hxx,v 1.12 2002/04/25 15:09:10 david Exp $
    00024  **************************************************************************/
    00025
    00026
    00027 #ifndef _CELESTIALBODY_H_
    00028 #define _CELESTIALBODY_H_
    00029
    00030 #ifndef __cplusplus
    00031 # error This library requires C++
    00032 #endif
    00033
    00034
    00035 #include <simgear/constants.h>
    00036
    00037 class Star;
    00038
    00039 class CelestialBody
    00040 {
    00041 protected:              // make the data protected, in order to give the
    00042                         //  inherited classes direct access to the data
    00043   double NFirst;        /* longitude of the ascending node first part */
    00044   double NSec;          /* longitude of the ascending node second part */
    00045   double iFirst;        /* inclination to the ecliptic first part */
    00046   double iSec;          /* inclination to the ecliptic second part */
    00047   double wFirst;        /* first part of argument of perihelion */
    00048   double wSec;          /* second part of argument of perihelion */
    00049   double aFirst;        /* semimayor axis first part*/
    00050   double aSec;          /* semimayor axis second part */
    00051   double eFirst;        /* eccentricity first part */
    00052   double eSec;          /* eccentricity second part */
    00053   double MFirst;        /* Mean anomaly first part */
    00054   double MSec;          /* Mean anomaly second part */
    00055
    00056   double N, i, w, a, e, M; /* the resulting orbital elements, obtained from the former */
    00057
    00058   double rightAscension, declination;
    00059   double r, R, s, FV;
    00060   double magnitude;
    00061   double lonEcl, latEcl;
    00062
    00063   double sgCalcEccAnom(double M, double e);
    00064   double sgCalcActTime(double mjd);
    00065   void updateOrbElements(double mjd);
    00066
    00067 public:
    00068   CelestialBody(double Nf, double Ns,
    00069                 double If, double Is,
    00070                 double wf, double ws,
    00071                 double af, double as,
    00072                 double ef, double es,
    00073                 double Mf, double Ms, double mjd);
    00074   CelestialBody(double Nf, double Ns,
    00075                 double If, double Is,
    00076                 double wf, double ws,
    00077                 double af, double as,
    00078                 double ef, double es,
    00079                 double Mf, double Ms);
    00080   void getPos(double *ra, double *dec);
    00081   void getPos(double *ra, double *dec, double *magnitude);
    00082   double getRightAscension();
    00083   double getDeclination();
    00084   double getMagnitude();
    00085   double getLon();
    00086   double getLat();
    00087   void updatePosition(double mjd, Star *ourSun);
    00088 };
    00089
    00090 inline double CelestialBody::getRightAscension() { return rightAscension; }
    00091 inline double CelestialBody::getDeclination() { return declination; }
    00092 inline double CelestialBody::getMagnitude() { return magnitude; }
    00093
    00094 inline double CelestialBody::getLon()
    00095 {
    00096   return lonEcl;
    00097 }
    00098
    00099 inline double CelestialBody::getLat()
    00100 {
    00101   return latEcl;
    00102 }
    00103
    00104 #endif // _CELESTIALBODY_H_
    00105

@ 1.3 log @Oops, try again. @ text @d114 1 a114 1