Exposure of the moon position.
The following functions have been added: MoonPos::getM(), MoonPos::getw(), MoonPos::getxg(), MoonPos::getyg(), MoonPos::getye(), MoonPos::getze(), MoonPos::getDistance(). These are copied from and match the Star class functions (but with xs and ys replaced by xg and yg).
This commit is contained in:
@@ -78,7 +78,7 @@ void MoonPos::updatePosition(double mjd, double lst, double lat, Star *ourSun)
|
||||
{
|
||||
double
|
||||
eccAnom, ecl, actTime,
|
||||
xv, yv, v, r, xh, yh, zh, xg, yg, zg, xe, ye, ze,
|
||||
xv, yv, v, r, xh, yh, zh, zg, xe,
|
||||
Ls, Lm, D, F, mpar, gclat, rho, HA, g,
|
||||
geoRa, geoDec,
|
||||
cosN, sinN, cosvw, sinvw, sinvw_cosi, cosecl, sinecl, rcoslatEcl,
|
||||
@@ -149,6 +149,7 @@ void MoonPos::updatePosition(double mjd, double lst, double lat, Star *ourSun)
|
||||
r += (-0.58 * cos(MlesstwoD)
|
||||
-0.46 * cos(twoD)
|
||||
);
|
||||
distance = r;
|
||||
// SG_LOG(SG_GENERAL, SG_INFO, "Running moon update");
|
||||
rcoslatEcl = r * cos(latEcl);
|
||||
xg = cos(lonEcl) * rcoslatEcl;
|
||||
|
||||
@@ -36,6 +36,9 @@ class MoonPos : public CelestialBody
|
||||
|
||||
private:
|
||||
|
||||
double xg, yg; // the moon's rectangular geocentric coordinates
|
||||
double ye, ze; // the moon's rectangular equatorial coordinates
|
||||
double distance; // the moon's distance to the earth
|
||||
// void TexInit(); // This should move to the constructor eventually.
|
||||
|
||||
// GLUquadricObj *moonObject;
|
||||
@@ -54,7 +57,48 @@ public:
|
||||
~MoonPos();
|
||||
void updatePosition(double mjd, double lst, double lat, Star *ourSun);
|
||||
// void newImage();
|
||||
double getM() const;
|
||||
double getw() const;
|
||||
double getxg() const;
|
||||
double getyg() const;
|
||||
double getye() const;
|
||||
double getze() const;
|
||||
double getDistance() const;
|
||||
};
|
||||
|
||||
inline double MoonPos::getM() const
|
||||
{
|
||||
return M;
|
||||
}
|
||||
|
||||
inline double MoonPos::getw() const
|
||||
{
|
||||
return w;
|
||||
}
|
||||
|
||||
inline double MoonPos::getxg() const
|
||||
{
|
||||
return xg;
|
||||
}
|
||||
|
||||
inline double MoonPos::getyg() const
|
||||
{
|
||||
return yg;
|
||||
}
|
||||
|
||||
inline double MoonPos::getye() const
|
||||
{
|
||||
return ye;
|
||||
}
|
||||
|
||||
inline double MoonPos::getze() const
|
||||
{
|
||||
return ze;
|
||||
}
|
||||
|
||||
inline double MoonPos::getDistance() const
|
||||
{
|
||||
return distance;
|
||||
}
|
||||
|
||||
#endif // _MOONPOS_HXX_
|
||||
|
||||
Reference in New Issue
Block a user