Planet.cpp   Planet.cpp 
skipping to change at line 504 skipping to change at line 504
StelUtils::radToDmsStr(angularSize, true )); StelUtils::radToDmsStr(angularSize, true ));
} }
else else
{ {
oss << q_("Apparent diameter: %1").arg(StelUtils::ra dToDmsStr(angularSize, true)); oss << q_("Apparent diameter: %1").arg(StelUtils::ra dToDmsStr(angularSize, true));
} }
oss << "<br>"; oss << "<br>";
} }
double siderealPeriod = getSiderealPeriod(); double siderealPeriod = getSiderealPeriod();
double siderealDay = getSiderealDay();
if ((flags&Extra1) && (siderealPeriod>0)) if ((flags&Extra1) && (siderealPeriod>0))
{ {
// TRANSLATORS: Sidereal (orbital) period for solar system b odies in days and in Julian years (symbol: a) // TRANSLATORS: Sidereal (orbital) period for solar system b odies in days and in Julian years (symbol: a)
oss << q_("Sidereal period: %1 days (%2 a)").arg(QString::nu mber(siderealPeriod, 'f', 2)).arg(QString::number(siderealPeriod/365.25, 'f ', 3)) << "<br>"; oss << q_("Sidereal period: %1 days (%2 a)").arg(QString::nu mber(siderealPeriod, 'f', 2)).arg(QString::number(siderealPeriod/365.25, 'f ', 3)) << "<br>";
if (std::abs(getSiderealDay())>0) if (std::abs(siderealDay)>0)
{ {
oss << q_("Sidereal day: %1").arg(StelUtils::hoursTo oss << q_("Sidereal day: %1").arg(StelUtils::hoursTo
HmsStr(std::abs(getSiderealDay()*24))) << "<br>"; HmsStr(std::abs(siderealDay*24))) << "<br>";
bool fwddir = true; oss << q_("Mean solar day: %1").arg(StelUtils::hours
if (englishName.compare("Venus") || englishName.comp ToHmsStr(std::abs(getMeanSolarDay()*24))) << "<br>";
are("Uranus"))
fwddir = false;
oss << q_("Mean solar day: %1").arg(StelUtils::hours
ToHmsStr(std::abs(StelUtils::calculateSolarDay(siderealPeriod, getSiderealD
ay(), fwddir)*24))) << "<br>";
} }
} }
if ((flags&Extra2) && (englishName.compare("Sun")!=0)) if ((flags&Extra2) && (englishName.compare("Sun")!=0))
{ {
const Vec3d& observerHelioPos = core->getObserverHeliocentri cEclipticPos(); const Vec3d& observerHelioPos = core->getObserverHeliocentri cEclipticPos();
oss << QString(q_("Phase Angle: %1")).arg(StelUtils::radToDm sStr(getPhaseAngle(observerHelioPos))) << "<br>"; oss << QString(q_("Phase Angle: %1")).arg(StelUtils::radToDm sStr(getPhaseAngle(observerHelioPos))) << "<br>";
oss << QString(q_("Elongation: %1")).arg(StelUtils::radToDms Str(getElongation(observerHelioPos))) << "<br>"; oss << QString(q_("Elongation: %1")).arg(StelUtils::radToDms Str(getElongation(observerHelioPos))) << "<br>";
oss << QString(q_("Phase: %1")).arg(getPhase(observerHelioPo s), 0, 'f', 2) << "<br>"; oss << QString(q_("Phase: %1")).arg(getPhase(observerHelioPo s), 0, 'f', 2) << "<br>";
oss << QString(q_("Illuminated: %1%")).arg(getPhase(observer HelioPos) * 100, 0, 'f', 1) << "<br>"; oss << QString(q_("Illuminated: %1%")).arg(getPhase(observer HelioPos) * 100, 0, 'f', 1) << "<br>";
skipping to change at line 816 skipping to change at line 814
if (englishName=="Jupiter") if (englishName=="Jupiter")
{ {
// use semi-empirical coefficient for GRS drift // use semi-empirical coefficient for GRS drift
// TODO: need improved // TODO: need improved
return remainder * 360. + re.offset - 0.2483 * std::abs(Stel App::getInstance().getCore()->getJDay() - 2456172); return remainder * 360. + re.offset - 0.2483 * std::abs(Stel App::getInstance().getCore()->getJDay() - 2456172);
} }
else else
return remainder * 360. + re.offset; return remainder * 360. + re.offset;
} }
double Planet::getMeanSolarDay() const
{
double msd = 0.;
double sday = getSiderealDay();
double coeff = std::abs(sday/getSiderealPeriod());
float sign = 1;
// planets with retrograde rotation
if (englishName=="Venus" || englishName=="Uranus" || englishName=="P
luto")
sign = -1;
if (pType.contains("moon"))
{
// duration of mean solar day on moon are same as synodic mo
nth on this moon
double a = parent->getSiderealPeriod()/sday;
msd = sday*(a/(a-1));
}
else
msd = sign*sday/(1 - sign*coeff);
return msd;
}
// Get the Planet position in the parent Planet ecliptic coordinate in AU // Get the Planet position in the parent Planet ecliptic coordinate in AU
Vec3d Planet::getEclipticPos() const Vec3d Planet::getEclipticPos() const
{ {
return eclipticPos; return eclipticPos;
} }
// Return the heliocentric ecliptical position (Vsop87) // Return the heliocentric ecliptical position (Vsop87)
Vec3d Planet::getHeliocentricEclipticPos() const Vec3d Planet::getHeliocentricEclipticPos() const
{ {
Vec3d pos = eclipticPos; Vec3d pos = eclipticPos;
skipping to change at line 1029 skipping to change at line 1049
} }
if (englishName=="Uranus") if (englishName=="Uranus")
return -7.19 + d + 0.0028*phaseDeg + extinctionMag; return -7.19 + d + 0.0028*phaseDeg + extinctionMag;
if (englishName=="Neptune") if (englishName=="Neptune")
return -6.87 + d + extinctionMag; return -6.87 + d + extinctionMag;
if (englishName=="Pluto") if (englishName=="Pluto")
return -1.01 + d + 0.041*phaseDeg + extinctionMag; return -1.01 + d + 0.041*phaseDeg + extinctionMag;
*/ */
// GZ: I prefer the values given by Meeus, Astronomical Algo rithms (1992). // GZ: I prefer the values given by Meeus, Astronomical Algo rithms (1992).
// There are two solutions: // There are two solutions:
// (1) G. Mller, based on visual observations 1877-91. [Expl .Suppl.1961] // (1) G. Mueller, based on visual observations 1877-91. [Ex pl.Suppl.1961]
// (2) Astronomical Almanac 1984 and later. These give V (in strumental) magnitudes. // (2) Astronomical Almanac 1984 and later. These give V (in strumental) magnitudes.
// The structure is almost identical, just the numbers are d ifferent! // The structure is almost identical, just the numbers are d ifferent!
// I activate (1) for now, because we want to simulate the e ye's impression. (Esp. Venus!) // I activate (1) for now, because we want to simulate the e ye's impression. (Esp. Venus!)
// (1) // (1)
if (englishName=="Mercury") if (englishName=="Mercury")
{ {
double ph50=phaseDeg-50.0; double ph50=phaseDeg-50.0;
return 1.16 + d + 0.02838*ph50 + 0.0001023*ph50*ph50 + extinctionMag; return 1.16 + d + 0.02838*ph50 + 0.0001023*ph50*ph50 + extinctionMag;
} }
if (englishName=="Venus") if (englishName=="Venus")
return -4.0 + d + 0.01322*phaseDeg + 0.0000004247*ph aseDeg*phaseDeg*phaseDeg + extinctionMag; return -4.0 + d + 0.01322*phaseDeg + 0.0000004247*ph aseDeg*phaseDeg*phaseDeg + extinctionMag;
if (englishName=="Mars") if (englishName=="Mars")
return -1.3 + d + 0.01486*phaseDeg + extinctionMag; return -1.3 + d + 0.01486*phaseDeg + extinctionMag;
if (englishName=="Jupiter") if (englishName=="Jupiter")
return -8.93 + d + extinctionMag; return -8.93 + d + extinctionMag;
if (englishName=="Saturn") if (englishName=="Saturn")
{ {
// TODO re-add rings computation // add rings computation
// GZ: implemented from Meeus, Astr.Alg.1992 // GZ: implemented from Meeus, Astr.Alg.1992
const double jd=core->getJDay(); const double jd=core->getJDay();
const double T=(jd-2451545.0)/36525.0; const double T=(jd-2451545.0)/36525.0;
const double i=((0.000004*T-0.012998)*T+28.075216)*M _PI/180.0; const double i=((0.000004*T-0.012998)*T+28.075216)*M _PI/180.0;
const double Omega=((0.000412*T+1.394681)*T+169.5084 70)*M_PI/180.0; const double Omega=((0.000412*T+1.394681)*T+169.5084 70)*M_PI/180.0;
static SolarSystem *ssystem=GETSTELMODULE(SolarSyste m); static SolarSystem *ssystem=GETSTELMODULE(SolarSyste m);
const Vec3d saturnEarth=getHeliocentricEclipticPos() - ssystem->getEarth()->getHeliocentricEclipticPos(); const Vec3d saturnEarth=getHeliocentricEclipticPos() - ssystem->getEarth()->getHeliocentricEclipticPos();
double lambda=atan2(saturnEarth[1], saturnEarth[0]); double lambda=atan2(saturnEarth[1], saturnEarth[0]);
double beta=atan2(saturnEarth[2], sqrt(saturnEarth[0 ]*saturnEarth[0]+saturnEarth[1]*saturnEarth[1])); double beta=atan2(saturnEarth[2], sqrt(saturnEarth[0 ]*saturnEarth[0]+saturnEarth[1]*saturnEarth[1]));
const double sinB=sin(i)*cos(beta)*sin(lambda-Omega) -cos(i)*sin(beta); const double sinB=sin(i)*cos(beta)*sin(lambda-Omega) -cos(i)*sin(beta);
skipping to change at line 1079 skipping to change at line 1099
if (englishName=="Mercury") if (englishName=="Mercury")
return 0.42 + d + .038*phaseDeg - 0.000273*phaseDeg* phaseDeg + 0.000002*phaseDeg*phaseDeg*phaseDeg + extinctionMag; return 0.42 + d + .038*phaseDeg - 0.000273*phaseDeg* phaseDeg + 0.000002*phaseDeg*phaseDeg*phaseDeg + extinctionMag;
if (englishName=="Venus") if (englishName=="Venus")
return -4.40 + d + 0.0009*phaseDeg + 0.000239*phaseD eg*phaseDeg - 0.00000065*phaseDeg*phaseDeg*phaseDeg + extinctionMag; return -4.40 + d + 0.0009*phaseDeg + 0.000239*phaseD eg*phaseDeg - 0.00000065*phaseDeg*phaseDeg*phaseDeg + extinctionMag;
if (englishName=="Mars") if (englishName=="Mars")
return -1.52 + d + 0.016*phaseDeg + extinctionMag; return -1.52 + d + 0.016*phaseDeg + extinctionMag;
if (englishName=="Jupiter") if (englishName=="Jupiter")
return -9.40 + d + 0.005*phaseDeg + extinctionMag; return -9.40 + d + 0.005*phaseDeg + extinctionMag;
if (englishName=="Saturn") if (englishName=="Saturn")
{ {
// TODO re-add rings computation // add rings computation
// GZ: implemented from Meeus, Astr.Alg.1992 // GZ: implemented from Meeus, Astr.Alg.1992
const double jd=core->getJDay(); const double jd=core->getJDay();
const double T=(jd-2451545.0)/36525.0; const double T=(jd-2451545.0)/36525.0;
const double i=((0.000004*T-0.012998)*T+28.075216)*M _PI/180.0; const double i=((0.000004*T-0.012998)*T+28.075216)*M _PI/180.0;
const double Omega=((0.000412*T+1.394681)*T+169.5084 70)*M_PI/180.0; const double Omega=((0.000412*T+1.394681)*T+169.5084 70)*M_PI/180.0;
static SolarSystem *ssystem=GETSTELMODULE(SolarSyste m); static SolarSystem *ssystem=GETSTELMODULE(SolarSyste m);
const Vec3d saturnEarth=getHeliocentricEclipticPos() - ssystem->getEarth()->getHeliocentricEclipticPos(); const Vec3d saturnEarth=getHeliocentricEclipticPos() - ssystem->getEarth()->getHeliocentricEclipticPos();
double lambda=atan2(saturnEarth[1], saturnEarth[0]); double lambda=atan2(saturnEarth[1], saturnEarth[0]);
double beta=atan2(saturnEarth[2], sqrt(saturnEarth[0 ]*saturnEarth[0]+saturnEarth[1]*saturnEarth[1])); double beta=atan2(saturnEarth[2], sqrt(saturnEarth[0 ]*saturnEarth[0]+saturnEarth[1]*saturnEarth[1]));
const double sinB=sin(i)*cos(beta)*sin(lambda-Omega) -cos(i)*sin(beta); const double sinB=sin(i)*cos(beta)*sin(lambda-Omega) -cos(i)*sin(beta);
 End of changes. 7 change blocks. 
13 lines changed or deleted 33 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/