X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fephemeris%2Fmoonpos.cxx;h=476969270ae45b8377b5777d8745dd9e386e9217;hb=a0bdec284624820feb0a96a06c0c38e2f07d5e4e;hp=d053082cd2d1cc8272870641cb4b78e88c2b3b10;hpb=557fade4a7df3f030b943ba6114c3c566c57b73c;p=simgear.git diff --git a/simgear/ephemeris/moonpos.cxx b/simgear/ephemeris/moonpos.cxx index d053082c..47696927 100644 --- a/simgear/ephemeris/moonpos.cxx +++ b/simgear/ephemeris/moonpos.cxx @@ -27,7 +27,6 @@ #include #include -#include #ifdef __BORLANDC__ # define exception c_exception @@ -183,7 +182,17 @@ void MoonPos::updatePosition(double mjd, double lst, double lat, Star *ourSun) // SG_LOG( SG_GENERAL, SG_INFO, "g = " << g ); rightAscension = geoRa - mpar * rho * cos(gclat) * sin(HA) / cos (geoDec); - declination = geoDec - mpar * rho * sin (gclat) * sin (g - geoDec) / sin(g); + if (fabs(lat) > 0) { + declination + = geoDec - mpar * rho * sin (gclat) * sin (g - geoDec) / sin(g); + } else { + declination = geoDec; + // cerr << "Geocentric vs. Topocentric position" << endl; + // cerr << "RA (difference) : " + // << SGD_RADIANS_TO_DEGREES * (geoRa - rightAscension) << endl; + // cerr << "Dec (difference) : " + // << SGD_RADIANS_TO_DEGREES * (geoDec - declination) << endl; + } /* SG_LOG( SG_GENERAL, SG_INFO, "Ra = (" << (SGD_RADIANS_TO_DEGREES *rightAscension)