Sg-ifying names.
This commit is contained in:
@@ -59,12 +59,12 @@ void CelestialBody::updatePosition(double mjd, Star *ourSun)
|
|||||||
xv, yv, xh, yh, zh, xg, yg, zg, xe, ye, ze;
|
xv, yv, xh, yh, zh, xg, yg, zg, xe, ye, ze;
|
||||||
|
|
||||||
updateOrbElements(mjd);
|
updateOrbElements(mjd);
|
||||||
actTime = fgCalcActTime(mjd);
|
actTime = sgCalcActTime(mjd);
|
||||||
|
|
||||||
// calcualate the angle bewteen ecliptic and equatorial coordinate system
|
// calcualate the angle bewteen ecliptic and equatorial coordinate system
|
||||||
ecl = DEG_TO_RAD * (23.4393 - 3.563E-7 *actTime);
|
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);
|
xv = a * (cos(eccAnom) - e);
|
||||||
yv = a * (sqrt (1.0 - e*e) * sin(eccAnom));
|
yv = a * (sqrt (1.0 - e*e) * sin(eccAnom));
|
||||||
v = atan2(yv, xv); // the planet's true anomaly
|
v = atan2(yv, xv); // the planet's true anomaly
|
||||||
@@ -111,7 +111,7 @@ void CelestialBody::updatePosition(double mjd, Star *ourSun)
|
|||||||
};
|
};
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* 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,
|
* this private member calculates the eccentric anomaly of a celestial body,
|
||||||
* given its mean anomaly and eccentricity.
|
* given its mean anomaly and eccentricity.
|
||||||
*
|
*
|
||||||
@@ -136,7 +136,7 @@ void CelestialBody::updatePosition(double mjd, Star *ourSun)
|
|||||||
* the eccentric anomaly
|
* the eccentric anomaly
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
double CelestialBody::fgCalcEccAnom(double M, double e)
|
double CelestialBody::sgCalcEccAnom(double M, double e)
|
||||||
{
|
{
|
||||||
double
|
double
|
||||||
eccAnom, E0, E1, diff;
|
eccAnom, E0, E1, diff;
|
||||||
|
|||||||
@@ -60,8 +60,8 @@ protected: // make the data protected, in order to give the
|
|||||||
double magnitude;
|
double magnitude;
|
||||||
double lonEcl, latEcl;
|
double lonEcl, latEcl;
|
||||||
|
|
||||||
double fgCalcEccAnom(double M, double e);
|
double sgCalcEccAnom(double M, double e);
|
||||||
double fgCalcActTime(double mjd);
|
double sgCalcActTime(double mjd);
|
||||||
void updateOrbElements(double mjd);
|
void updateOrbElements(double mjd);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -149,7 +149,7 @@ inline CelestialBody::CelestialBody(double Nf, double Ns,
|
|||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
inline void CelestialBody::updateOrbElements(double mjd)
|
inline void CelestialBody::updateOrbElements(double mjd)
|
||||||
{
|
{
|
||||||
double actTime = fgCalcActTime(mjd);
|
double actTime = sgCalcActTime(mjd);
|
||||||
M = DEG_TO_RAD * (MFirst + (MSec * actTime));
|
M = DEG_TO_RAD * (MFirst + (MSec * actTime));
|
||||||
w = DEG_TO_RAD * (wFirst + (wSec * actTime));
|
w = DEG_TO_RAD * (wFirst + (wSec * actTime));
|
||||||
N = DEG_TO_RAD * (NFirst + (NSec * actTime));
|
N = DEG_TO_RAD * (NFirst + (NSec * actTime));
|
||||||
@@ -158,7 +158,7 @@ inline void CelestialBody::updateOrbElements(double mjd)
|
|||||||
a = aFirst + (aSec * 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
|
* this private member function returns the offset in days from the epoch for
|
||||||
* wich the orbital elements are calculated (Jan, 1st, 2000).
|
* wich the orbital elements are calculated (Jan, 1st, 2000).
|
||||||
*
|
*
|
||||||
@@ -166,7 +166,7 @@ inline void CelestialBody::updateOrbElements(double mjd)
|
|||||||
*
|
*
|
||||||
* return value: the (fractional) number of days until Jan 1, 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);
|
return (mjd - 36523.5);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -88,12 +88,12 @@ void Moon::updatePosition(double mjd, double lst, double lat, Star *ourSun)
|
|||||||
geoRa, geoDec;
|
geoRa, geoDec;
|
||||||
|
|
||||||
updateOrbElements(mjd);
|
updateOrbElements(mjd);
|
||||||
actTime = fgCalcActTime(mjd);
|
actTime = sgCalcActTime(mjd);
|
||||||
|
|
||||||
// calculate the angle between ecliptic and equatorial coordinate system
|
// calculate the angle between ecliptic and equatorial coordinate system
|
||||||
// in Radians
|
// in Radians
|
||||||
ecl = ((DEG_TO_RAD * 23.4393) - (DEG_TO_RAD * 3.563E-7) * actTime);
|
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);
|
xv = a * (cos(eccAnom) - e);
|
||||||
yv = a * (sqrt(1.0 - e*e) * sin(eccAnom));
|
yv = a * (sqrt(1.0 - e*e) * sin(eccAnom));
|
||||||
v = atan2(yv, xv); // the moon's true anomaly
|
v = atan2(yv, xv); // the moon's true anomaly
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ void Saturn::updatePosition(double mjd, Star *ourSun)
|
|||||||
{
|
{
|
||||||
CelestialBody::updatePosition(mjd, ourSun);
|
CelestialBody::updatePosition(mjd, ourSun);
|
||||||
|
|
||||||
double actTime = fgCalcActTime(mjd);
|
double actTime = sgCalcActTime(mjd);
|
||||||
double ir = 0.4897394;
|
double ir = 0.4897394;
|
||||||
double Nr = 2.9585076 + 6.6672E-7*actTime;
|
double Nr = 2.9585076 + 6.6672E-7*actTime;
|
||||||
double B = asin (sin(declination) * cos(ir) -
|
double B = asin (sin(declination) * cos(ir) -
|
||||||
|
|||||||
@@ -84,9 +84,9 @@ void Star::updatePosition(double mjd)
|
|||||||
|
|
||||||
updateOrbElements(mjd);
|
updateOrbElements(mjd);
|
||||||
|
|
||||||
actTime = fgCalcActTime(mjd);
|
actTime = sgCalcActTime(mjd);
|
||||||
ecl = DEG_TO_RAD * (23.4393 - 3.563E-7 * actTime); // Angle in Radians
|
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;
|
xv = cos(eccAnom) - e;
|
||||||
yv = sqrt (1.0 - e*e) * sin(eccAnom);
|
yv = sqrt (1.0 - e*e) * sin(eccAnom);
|
||||||
|
|||||||
Reference in New Issue
Block a user