xv, yv, xh, yh, zh, xg, yg, zg, xe, ye, ze;
updateOrbElements(mjd);
- actTime = fgCalcActTime(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
};
/****************************************************************************
- * 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.
*
* the eccentric anomaly
*
****************************************************************************/
-double CelestialBody::fgCalcEccAnom(double M, double e)
+double CelestialBody::sgCalcEccAnom(double M, double e)
{
double
eccAnom, E0, E1, diff;
double magnitude;
double lonEcl, latEcl;
- double fgCalcEccAnom(double M, double e);
- double fgCalcActTime(double mjd);
+ double sgCalcEccAnom(double M, double e);
+ double sgCalcActTime(double mjd);
void updateOrbElements(double mjd);
public:
***************************************************************************/
inline void CelestialBody::updateOrbElements(double mjd)
{
- double actTime = fgCalcActTime(mjd);
+ 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));
a = aFirst + (aSec * actTime);
}
/*****************************************************************************
- * inline double CelestialBody::fgCalcActTime(double mjd)
+ * 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).
*
*
* return value: the (fractional) number of days until Jan 1, 2000.
****************************************************************************/
-inline double CelestialBody::fgCalcActTime(double mjd)
+inline double CelestialBody::sgCalcActTime(double mjd)
{
return (mjd - 36523.5);
}
geoRa, geoDec;
updateOrbElements(mjd);
- actTime = fgCalcActTime(mjd);
+ actTime = sgCalcActTime(mjd);
// calculate the angle between ecliptic and equatorial coordinate system
// in Radians
ecl = ((DEG_TO_RAD * 23.4393) - (DEG_TO_RAD * 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 moon's true anomaly
{
CelestialBody::updatePosition(mjd, ourSun);
- double actTime = fgCalcActTime(mjd);
+ double actTime = sgCalcActTime(mjd);
double ir = 0.4897394;
double Nr = 2.9585076 + 6.6672E-7*actTime;
double B = asin (sin(declination) * cos(ir) -
updateOrbElements(mjd);
- actTime = fgCalcActTime(mjd);
+ actTime = sgCalcActTime(mjd);
ecl = DEG_TO_RAD * (23.4393 - 3.563E-7 * actTime); // Angle in Radians
- eccAnom = fgCalcEccAnom(M, e); // Calculate the eccentric Anomaly (also known as solving Kepler's equation)
+ eccAnom = sgCalcEccAnom(M, e); // Calculate the eccentric Anomaly (also known as solving Kepler's equation)
xv = cos(eccAnom) - e;
yv = sqrt (1.0 - e*e) * sin(eccAnom);