Skip to content

Commit

Permalink
More accurate solution for planet diameter
Browse files Browse the repository at this point in the history
  • Loading branch information
gzotti committed Oct 27, 2021
1 parent 567ecc9 commit 9cb4b5a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core/modules/Planet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2567,7 +2567,7 @@ float Planet::getVMagnitude(const StelCore* core) const
double Planet::getAngularSize(const StelCore* core) const
{
const double rad = (rings ? rings->getSize() : equatorialRadius);
return std::atan2(rad*sphereScale,getJ2000EquatorialPos(core).length()) * M_180_PI;
return std::asin(rad*sphereScale/getJ2000EquatorialPos(core).length()) * M_180_PI;
}


Expand Down
2 changes: 1 addition & 1 deletion src/core/modules/StarMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1278,7 +1278,7 @@ void StarMgr::draw(StelCore* core)
PlanetP moon = GETSTELMODULE(SolarSystem)->getMoon();
Vec3d moonPos=moon->getJ2000EquatorialPos(core);
const double moonRadius = moon->getEquatorialRadius() * moon->getSphereScale();
double angularSize = atan2(moonRadius, moonPos.length());
double angularSize = asin(moonRadius / moonPos.length());
moonPos.normalize();
SphericalCap moonCap(moonPos, cos(angularSize));
for (auto cap : viewportCaps)
Expand Down

0 comments on commit 9cb4b5a

Please sign in to comment.