]> git.mxchange.org Git - simgear.git/blobdiff - simgear/ephemeris/celestialBody.cxx
Fix a build order problem.
[simgear.git] / simgear / ephemeris / celestialBody.cxx
index a46a34dfca3c416f5efcaf9f923c8fb405c6505f..7e9a463c15021e77f17a161ca32ec8bf109fc261 100644 (file)
@@ -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$
  **************************************************************************/
@@ -34,7 +35,7 @@
 
 
 /**************************************************************************
- * void CelestialBody::updatePosition(fgTIME *t, Star *ourSun)
+ * void CelestialBody::updatePosition(double mjd, Star *ourSun)
  *
  * Basically, this member function provides a general interface for 
  * calculating the right ascension and declinaion. This function is 
  * position is calculated an a slightly different manner.  
  *
  * arguments:
- * fgTIME t: provides the current time.
+ * double mjd: provides the modified julian date.
  * Star *ourSun: the sun's position is needed to convert heliocentric 
  *               coordinates into geocentric coordinates.
  *
  * return value: none
  *
  *************************************************************************/
-void CelestialBody::updatePosition(FGTime *t, Star *ourSun)
+void CelestialBody::updatePosition(double mjd, Star *ourSun)
 {
   double eccAnom, v, ecl, actTime, 
     xv, yv, xh, yh, zh, xg, yg, zg, xe, ye, ze;
 
-  updateOrbElements(t);
-  actTime = fgCalcActTime(t);
+  updateOrbElements(mjd);
+  actTime = sgCalcActTime(mjd);
 
   // calcualate the angle bewteen ecliptic and equatorial coordinate system
   ecl = DEG_TO_RAD * (23.4393 - 3.563E-7 *actTime);
   
-  eccAnom = fgCalcEccAnom(M, e);  //calculate the eccentric anomaly
+  eccAnom = sgCalcEccAnom(M, e);  //calculate the eccentric anomaly
   xv = a * (cos(eccAnom) - e);
   yv = a * (sqrt (1.0 - e*e) * sin(eccAnom));
   v = atan2(yv, xv);           // the planet's true anomaly
@@ -87,8 +88,8 @@ void CelestialBody::updatePosition(FGTime *t, Star *ourSun)
   ze = yg * sin(ecl) + zg * cos(ecl);
   rightAscension = atan2(ye, xe);
   declination = atan2(ze, sqrt(xe*xe + ye*ye));
-  FG_LOG(FG_GENERAL, FG_INFO, "Planet found at : " 
-        << rightAscension << " (ra), " << declination << " (dec)" );
+  /* FG_LOG(FG_GENERAL, FG_INFO, "Planet found at : " 
+        << rightAscension << " (ra), " << declination << " (dec)" ); */
 
   //calculate some variables specific to calculating the magnitude 
   //of the planet
@@ -107,10 +108,10 @@ void CelestialBody::updatePosition(FGTime *t, Star *ourSun)
   }
 
   FV = RAD_TO_DEG * acos( tmp );
-};
+}
 
 /****************************************************************************
- * double CelestialBody::fgCalcEccAnom(double M, double e)
+ * double CelestialBody::sgCalcEccAnom(double M, double e)
  * this private member calculates the eccentric anomaly of a celestial body, 
  * given its mean anomaly and eccentricity.
  * 
@@ -135,7 +136,7 @@ void CelestialBody::updatePosition(FGTime *t, Star *ourSun)
  * the eccentric anomaly
  *
  ****************************************************************************/
-double CelestialBody::fgCalcEccAnom(double M, double e)
+double CelestialBody::sgCalcEccAnom(double M, double e)
 {
   double 
     eccAnom, E0, E1, diff;