Skip to content

Commit

Permalink
Added visibility of an antisolar point for other planets (fix #1481)
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-w committed Jan 26, 2021
1 parent 2465714 commit b691bc0
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/core/modules/GridLinesMgr.cpp
Expand Up @@ -1375,7 +1375,7 @@ void SkyPoint::updateLabel()
}
case ANTISOLAR:
{
frameType = StelCore::FrameObservercentricEclipticOfDate;
frameType = StelCore::FrameObservercentricEclipticJ2000;
// TRANSLATORS: Antisolar Point
northernLabel = q_("ASP");
break;
Expand Down Expand Up @@ -1489,14 +1489,15 @@ void SkyPoint::draw(StelCore *core) const
{
// Antisolar Point
Vec3d coord;
double eclJDE = earth->getRotObliquity(core->getJDE());
double eclJDE = earth->getRotObliquity(2451545.0);
double ra_equ, dec_equ, lambdaJDE, betaJDE;

StelUtils::rectToSphe(&ra_equ,&dec_equ, sun->getEquinoxEquatorialPos(core));
StelUtils::rectToSphe(&ra_equ,&dec_equ, sun->getJ2000EquatorialPos(core));
StelUtils::equToEcl(ra_equ, dec_equ, eclJDE, &lambdaJDE, &betaJDE);
if (lambdaJDE<0) lambdaJDE+=2.0*M_PI;
betaJDE *= -1.f;

StelUtils::spheToRect(lambdaJDE + M_PI, 0., coord);
StelUtils::spheToRect(lambdaJDE + M_PI, betaJDE, coord);

sPainter.drawSprite2dMode(coord, 5.f);
sPainter.drawText(coord, northernLabel, 0, shift, shift, false);
Expand Down Expand Up @@ -1874,8 +1875,6 @@ void GridLinesMgr::draw(StelCore* core)
equinoxPoints->draw(core);
solsticePoints->draw(core);
longitudeLine->draw(core);
// Antisolar point are calculated in Ecliptic (on date) frame (Earth only)
antisolarPoint->draw(core);
}

// Lines after grids, to be able to e.g. draw equators in different color!
Expand All @@ -1902,6 +1901,8 @@ void GridLinesMgr::draw(StelCore* core)
equinoxJ2000Points->draw(core);
solsticeJ2000Points->draw(core);
apexPoints->draw(core);
// Antisolar point are calculated in Ecliptic (J2000) frame
antisolarPoint->draw(core);
}

void GridLinesMgr::updateLabels()
Expand Down

0 comments on commit b691bc0

Please sign in to comment.