Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navstar Sun limb size and direction fix #2021

Merged
merged 1 commit into from
Nov 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions plugins/NavStars/src/NavStars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -590,11 +590,11 @@ void NavStars::extraInfo(StelCore* core, const StelObjectP& selectedObject)

if ("Sun" == englishName || "Moon" == englishName)
{
// Adjust Ho if target is Sun or Moon by adding/subtracting half the angular diameter.
double d = selectedObject->getAngularSize(core);
if (upperLimb)
d *= -1;
calc.addAltAppRad(((d / 2) * M_PI) / 180.);
// Adjust Ho if target is Sun or Moon by adding/subtracting the angular radius.
double obj_radius_in_degrees = selectedObject->getAngularSize(core);
if (!upperLimb)
obj_radius_in_degrees *= -1;
calc.addAltAppRad((obj_radius_in_degrees * M_PI) / 180.);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@A-j-K congratulations for using expressive variable names! and I love your copious use of whitespace (see higher in the code).

extraText = upperLimb ?
" (" + QString(qc_("upper limb", "the highest part of the Sun or Moon")) + ")" :
" (" + QString(qc_("lower limb", "the lowest part of the Sun or Moon")) + ")";
Expand Down
13 changes: 13 additions & 0 deletions scripts/tests/navstars-sun-issue-2019-N.ssc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

core.setObserverLocation(-29.75888, 19.945, 0);
LandscapeMgr.setCurrentLandscapeName("Ocean");
LandscapeMgr.setFlagLandscape(true);
LandscapeMgr.setFlagAtmosphere(true);
GridLinesMgr.setFlagHorizonLine(true);
LandscapeMgr.setFlagCardinalsPoints(true);
core.setDate("2021-11-08T19:31:41");
core.setTimeRate(0);

core.selectObjectByName("Sun", false);
StelMovementMgr.setFlagTracking(true);

13 changes: 13 additions & 0 deletions scripts/tests/navstars-sun-issue-2019-S.ssc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

core.setObserverLocation(-29.75888, -19.945, 0);
LandscapeMgr.setCurrentLandscapeName("Ocean");
LandscapeMgr.setFlagLandscape(true);
LandscapeMgr.setFlagAtmosphere(true);
GridLinesMgr.setFlagHorizonLine(true);
LandscapeMgr.setFlagCardinalsPoints(true);
core.setDate("2021-11-08T19:31:41");
core.setTimeRate(0);

core.selectObjectByName("Sun", false);
StelMovementMgr.setFlagTracking(true);