Skip to content

Commit

Permalink
Add is-waning to planet info map
Browse files Browse the repository at this point in the history
It proved to be quite challenging to properly determine whether phase
angle is increasing or decreasing. So it's worth providing a flag for
this in the scripting API.
  • Loading branch information
10110111 committed Jul 16, 2023
1 parent 04aba79 commit 9e8316c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/core/modules/Planet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1598,6 +1598,8 @@ QVariantMap Planet::getInfoMap(const StelCore *core) const
map.insert("phase-angle", phaseAngle);
map.insert("phase-angle-dms", StelUtils::radToDmsStr(phaseAngle));
map.insert("phase-angle-deg", StelUtils::radToDecDegStr(phaseAngle));
const bool waning = isWaning(observerHelioPos, core->getObserverHeliocentricEclipticVelocity());
map.insert("is-waning", waning);
double elongation = getElongation(observerHelioPos);
map.insert("elongation", elongation);
map.insert("elongation-dms", StelUtils::radToDmsStr(elongation));
Expand Down
1 change: 1 addition & 0 deletions src/scripting/StelMainScriptAPI.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ public slots:
//! - phase-angle : phase angle of object in radians (for Solar system objects only!)
//! - phase-angle-dms : phase angle of object in DMS (for Solar system objects only!)
//! - phase-angle-deg : phase angle of object in decimal degrees (for Solar system objects only!)
//! - is-waning : whether phase angle is increasing, signifying the waning phase (for Solar system objects only!)
//! - elongation : elongation of object in radians (for Solar system objects only!)
//! - elongation-dms : elongation of object in DMS (for Solar system objects only!)
//! - elongation-deg : elongation of object in decimal degrees (for Solar system objects only!)
Expand Down

0 comments on commit 9e8316c

Please sign in to comment.