StelUtils.cpp   StelUtils.cpp 
skipping to change at line 335 skipping to change at line 335
} }
void spheToRect(double lng, double lat, Vec3d& v) void spheToRect(double lng, double lat, Vec3d& v)
{ {
const double cosLat = cos(lat); const double cosLat = cos(lat);
v.set(cos(lng) * cosLat, sin(lng) * cosLat, sin(lat)); v.set(cos(lng) * cosLat, sin(lng) * cosLat, sin(lat));
} }
void spheToRect(float lng, float lat, Vec3f& v) void spheToRect(float lng, float lat, Vec3f& v)
{ {
const double cosLat = cos(lat); const double dlng = lng, dlat = lat, cosLat = cos(dlat);
v.set(cos(lng) * cosLat, sin(lng) * cosLat, sin(lat)); v.set(cos(dlng) * cosLat, sin(dlng) * cosLat, sin(dlat));
} }
void rectToSphe(double *lng, double *lat, const Vec3d& v) void rectToSphe(double *lng, double *lat, const Vec3d& v)
{ {
double r = v.length(); double r = v.length();
*lat = asin(v[2]/r); *lat = asin(v[2]/r);
*lng = atan2(v[1],v[0]); *lng = atan2(v[1],v[0]);
} }
void rectToSphe(float *lng, float *lat, const Vec3d& v) void rectToSphe(float *lng, float *lat, const Vec3d& v)
skipping to change at line 1034 skipping to change at line 1034
*min = finalRe.capturedTexts().at(5).toInt(&ok); *min = finalRe.capturedTexts().at(5).toInt(&ok);
error = error || !ok; error = error || !ok;
*s = finalRe.capturedTexts().at(6).toFloat(&ok); *s = finalRe.capturedTexts().at(6).toFloat(&ok);
error = error || !ok; error = error || !ok;
if (!error) if (!error)
return true; return true;
} }
return false; return false;
} }
// Calculate and getting orbital period in days from semi-major axis
double calculateOrbitalPeriod(double SemiMajorAxis)
{
// Calculate semi-major axis in meters
double a = AU*1000*SemiMajorAxis;
// Calculate orbital period in seconds
// Here 1.32712440018e20 is heliocentric gravitational constant
double period = 2*M_PI*std::sqrt(a*a*a/1.32712440018e20);
return period/86400; // return period in days
}
} // end of the StelUtils namespace } // end of the StelUtils namespace
 End of changes. 2 change blocks. 
2 lines changed or deleted 13 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/