X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fephemeris%2FcelestialBody.hxx;h=d32a16edbef8bae61866d9be2fc966ec2d414789;hb=f1ab6e2533a1bf07439b3d5918430f496158d8f3;hp=96f67787d65927dcd426b725bf0f43639c953223;hpb=8159b749f49be587e794a8438db7a4373d527b1d;p=simgear.git diff --git a/simgear/ephemeris/celestialBody.hxx b/simgear/ephemeris/celestialBody.hxx index 96f67787..d32a16ed 100644 --- a/simgear/ephemeris/celestialBody.hxx +++ b/simgear/ephemeris/celestialBody.hxx @@ -5,19 +5,20 @@ * September 1998. This code is based upon algorithms and data kindly * provided by Mr. Paul Schlyter. (pausch@saaf.se). * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. + * Library General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. * * $Id$ **************************************************************************/ @@ -32,7 +33,6 @@ #include -#include class Star; @@ -60,9 +60,9 @@ protected: // make the data protected, in order to give the double magnitude; double lonEcl, latEcl; - double fgCalcEccAnom(double M, double e); - double fgCalcActTime(SGTime *t); - void updateOrbElements(SGTime *t); + double sgCalcEccAnom(double M, double e); + double sgCalcActTime(double mjd); + void updateOrbElements(double mjd); public: CelestialBody(double Nf, double Ns, @@ -70,7 +70,7 @@ public: double wf, double ws, double af, double as, double ef, double es, - double Mf, double Ms, SGTime *t); + double Mf, double Ms, double mjd); CelestialBody(double Nf, double Ns, double If, double Is, double wf, double ws, @@ -84,7 +84,7 @@ public: double getMagnitude(); double getLon(); double getLat(); - void updatePosition(SGTime *t, Star *ourSun); + void updatePosition(double mjd, Star *ourSun); }; /***************************************************************************** @@ -112,7 +112,7 @@ inline CelestialBody::CelestialBody(double Nf, double Ns, double wf, double ws, double af, double as, double ef, double es, - double Mf, double Ms, SGTime *t) + double Mf, double Ms, double mjd) { NFirst = Nf; NSec = Ns; iFirst = If; iSec = Is; @@ -120,8 +120,8 @@ inline CelestialBody::CelestialBody(double Nf, double Ns, aFirst = af; aSec = as; eFirst = ef; eSec = es; MFirst = Mf; MSec = Ms; - updateOrbElements(t); -}; + updateOrbElements(mjd); +} inline CelestialBody::CelestialBody(double Nf, double Ns, double If, double Is, @@ -136,20 +136,20 @@ inline CelestialBody::CelestialBody(double Nf, double Ns, aFirst = af; aSec = as; eFirst = ef; eSec = es; MFirst = Mf; MSec = Ms; -}; +} /**************************************************************************** - * inline void CelestialBody::updateOrbElements(SGTime *t) + * inline void CelestialBody::updateOrbElements(double mjd) * given the current time, this private member calculates the actual * orbital elements * - * Arguments: SGTime *t: the current time: + * Arguments: double mjd: the current modified julian date: * * return value: none ***************************************************************************/ -inline void CelestialBody::updateOrbElements(SGTime *t) +inline void CelestialBody::updateOrbElements(double mjd) { - double actTime = fgCalcActTime(t); + double actTime = sgCalcActTime(mjd); M = DEG_TO_RAD * (MFirst + (MSec * actTime)); w = DEG_TO_RAD * (wFirst + (wSec * actTime)); N = DEG_TO_RAD * (NFirst + (NSec * actTime)); @@ -158,7 +158,7 @@ inline void CelestialBody::updateOrbElements(SGTime *t) a = aFirst + (aSec * actTime); } /***************************************************************************** - * inline double CelestialBody::fgCalcActTime(SGTime *t) + * inline double CelestialBody::sgCalcActTime(double mjd) * this private member function returns the offset in days from the epoch for * wich the orbital elements are calculated (Jan, 1st, 2000). * @@ -166,9 +166,9 @@ inline void CelestialBody::updateOrbElements(SGTime *t) * * return value: the (fractional) number of days until Jan 1, 2000. ****************************************************************************/ -inline double CelestialBody::fgCalcActTime(SGTime *t) +inline double CelestialBody::sgCalcActTime(double mjd) { - return (t->getMjd() - 36523.5); + return (mjd - 36523.5); } /*****************************************************************************