20 #ifndef _STELUTILS_HPP_
21 #define _STELUTILS_HPP_
23 #include "VecMath.hpp"
25 #include <QVariantMap>
31 #define AU 149597870.691
33 #define PARSEC 30.857e12
35 #define SPEED_OF_LIGHT 299792.458
51 double hmsToRad(
const unsigned int h,
const unsigned int m,
const double s);
58 double dmsToRad(
const int d,
const unsigned int m,
const double s);
65 void radToHms(
double rad,
unsigned int& h,
unsigned int& m,
double& s);
73 void radToDms(
double rad,
bool& sign,
unsigned int& d,
unsigned int& m,
double& s);
83 QString
radToHmsStr(
const double angle,
const bool decimal=
false);
95 QString
radToDmsStr(
const double angle,
const bool decimal=
false,
const bool useD=
false);
149 void ctRadec2Ecl(
const double raRad,
const double decRad,
const double eclRad,
double *lambdaRad,
double *betaRad);
184 double asinh(
const double z);
210 QString
localeDateString(
const int year,
const int month,
const int day,
const int dayOfWeek,
const QString fmt);
215 QString
localeDateString(
const int year,
const int month,
const int day,
const int dayOfWeek);
253 bool getJDFromDate(
double* newjd,
const int y,
const int m,
const int d,
const int h,
const int min,
const int s);
255 int numberOfDaysInMonthInYear(
const int month,
const int year);
256 bool changeDateTimeForRollover(
int oy,
int om,
int od,
int oh,
int omin,
int os,
257 int* ry,
int* rm,
int* rd,
int* rh,
int* rmin,
int* rs);
260 void debugQVariantMap(
const QVariant& m,
const QString& indent=
"",
const QString& key=
"");
267 return M_PI_2 - (x + x*x*x * (1.f/6.f + x*x * (3.f/40.f + 5.f/112.f * x*x)) );
274 (1.f + x*(1.f+ x/2.f*(1.f+ x/3.f*(1.f+x/4.f*(1.f+x/5.f))))):
275 1.f / (1.f -x*(1.f -x/2.f*(1.f- x/3.f*(1.f-x/4.f*(1.f-x/5.f)))));
283 for(
int i=0; i<3; i++)
285 max = dayColor[i] > max ? dayColor[i] : max;
287 return Vec3f(max, 0, 0);
293 QString hoursToHmsStr(
const double hours);
568 #endif // _STELUTILS_HPP_