StelUtils.hpp   StelUtils.hpp 
skipping to change at line 137 skipping to change at line 137
//! Convert a dms formatted string to an angle in radian //! Convert a dms formatted string to an angle in radian
//! @param s The input string //! @param s The input string
double dmsStrToRad(const QString& s); double dmsStrToRad(const QString& s);
//! Obtains a Vec3f from a string. //! Obtains a Vec3f from a string.
//! @param s the string describing the Vector with the form "x,y,z" //! @param s the string describing the Vector with the form "x,y,z"
//! @return The corresponding vector //! @return The corresponding vector
//! @deprecated Use the >> operator from Vec3f class //! @deprecated Use the >> operator from Vec3f class
Vec3f strToVec3f(const QStringList& s); Vec3f strToVec3f(const QStringList& s);
//! Reads a Vec3f from a string, separated by commas. Example: 1.0,2 .0,3.0
Vec3f strToVec3f(const QString& s); Vec3f strToVec3f(const QString& s);
//! Like StelUtils::strToVec3f, but with 4 components and with doubl
e precision
Vec4d strToVec4d(const QStringList& s);
//! Like StelUtils::strToVec3f, but with 4 components and with doubl
e precision
Vec4d strToVec4d(const QString& s);
//! Converts a Vec3f to a string in the same format that can be read
by strToVec3f
QString vec3fToStr(const Vec3f& v);
//! Converts a Vec4d to a string in the same format that can be read
by strToVec4d
QString vec4dToStr(const Vec4d& v);
//! Converts a Vec3f to HTML color notation. //! Converts a Vec3f to HTML color notation.
//! @param v The vector //! @param v The vector
//! @return The string in HTML color notation "#rrggbb". //! @return The string in HTML color notation "#rrggbb".
QString vec3fToHtmlColor(const Vec3f& v); QString vec3fToHtmlColor(const Vec3f& v);
//! Converts a color in HTML notation to a Vec3f. //! Converts a color in HTML notation to a Vec3f.
//! @param c The HTML spec color string //! @param c The HTML spec color string
Vec3f htmlColorToVec3f(const QString& c); Vec3f htmlColorToVec3f(const QString& c);
skipping to change at line 179 skipping to change at line 189
//! @param v the input 3D vector //! @param v the input 3D vector
void rectToSphe(float *lng, float *lat, const Vec3d& v); void rectToSphe(float *lng, float *lat, const Vec3d& v);
//! Convert from spherical coordinates to Rectangular direction. //! Convert from spherical coordinates to Rectangular direction.
//! @param lng float* to store longitude in radian //! @param lng float* to store longitude in radian
//! @param lat float* to store latitude in radian //! @param lat float* to store latitude in radian
//! @param v the input 3D vector //! @param v the input 3D vector
void rectToSphe(float *lng, float *lat, const Vec3f& v); void rectToSphe(float *lng, float *lat, const Vec3f& v);
//! Coordinate Transformation from equatorial to ecliptical //! Coordinate Transformation from equatorial to ecliptical
void ctRadec2Ecl(const double raRad, const double decRad, const doub le eclRad, double *lambdaRad, double *betaRad); void equToEcl(const double raRad, const double decRad, const double eclRad, double *lambdaRad, double *betaRad);
//! Convert a string longitude, latitude, RA or Declination angle //! Convert a string longitude, latitude, RA or Declination angle
//! to radians. //! to radians.
//! @param str the angle in format something like these: //! @param str the angle in format something like these:
//! - +53d 51'21.6" //! - +53d 51'21.6"
//! - +53d51'21.6" //! - +53d51'21.6"
//! - -1d 10'31.8" //! - -1d 10'31.8"
//! - +46d6'31" //! - +46d6'31"
//! - 50D46'0"N //! - 50D46'0"N
//! - 123D47'59"W //! - 123D47'59"W
skipping to change at line 236 skipping to change at line 246
QString julianDayToISO8601String(const double jd); QString julianDayToISO8601String(const double jd);
//! Return the Julian Date matching the ISO8601 date string. //! Return the Julian Date matching the ISO8601 date string.
//! Also handles negative and distant years. //! Also handles negative and distant years.
double getJulianDayFromISO8601String(const QString& iso8601Date, boo l* ok); double getJulianDayFromISO8601String(const QString& iso8601Date, boo l* ok);
//! Format the date and day-of-week per the format in fmt //! Format the date and day-of-week per the format in fmt
//! (see QDateTime::toString()). Uses the @b system locale, not //! (see QDateTime::toString()). Uses the @b system locale, not
//! the one set in Stellarium. //! the one set in Stellarium.
//! @return QString representing the formatted date //! @return QString representing the formatted date
QString localeDateString(const int year, const int month, const int day, const int dayOfWeek, const QString fmt); QString localeDateString(const int year, const int month, const int day, const int dayOfWeek, const QString &fmt);
//! Format the date and day-of-week per the @b system locale's //! Format the date and day-of-week per the @b system locale's
//! QLocale::ShortFormat. //! QLocale::ShortFormat.
//! @return QString representing the formatted date //! @return QString representing the formatted date
QString localeDateString(const int year, const int month, const int day, const int dayOfWeek); QString localeDateString(const int year, const int month, const int day, const int dayOfWeek);
//! Get the current Julian Date from system time. //! Get the current Julian Date from system time.
//! @return the current Julian Date //! @return the current Julian Date
double getJDFromSystem(); double getJDFromSystem();
skipping to change at line 577 skipping to change at line 587
//! Journal of Astrophysics & Astronomy, Vol. 29, p. 363–366 (2008) //! Journal of Astrophysics & Astronomy, Vol. 29, p. 363–366 (2008)
//! http://www.ias.ac.in/jaa/dec2008/JAA610.pdf //! http://www.ias.ac.in/jaa/dec2008/JAA610.pdf
//! Note: These polynomials are based on the uncorrected deltaT tabl e from the Astronomical Almanac, thus //! Note: These polynomials are based on the uncorrected deltaT tabl e from the Astronomical Almanac, thus
//! ndot = -26.0 arcsec/cy^2. Meeus & Simons (2000) corrected the de ltaT table for years before 1955.5 using //! ndot = -26.0 arcsec/cy^2. Meeus & Simons (2000) corrected the de ltaT table for years before 1955.5 using
//! ndot = -25.7376 arcsec/cy^2. Therefore the accuracies stated by Meeus & Simons are correct and cannot be //! ndot = -25.7376 arcsec/cy^2. Therefore the accuracies stated by Meeus & Simons are correct and cannot be
//! compared with accuracies from Islam & Sadiq & Qureshi. //! compared with accuracies from Islam & Sadiq & Qureshi.
//! @param jDay the date and time expressed as a julian day //! @param jDay the date and time expressed as a julian day
//! @return Delta-T in seconds //! @return Delta-T in seconds
double getDeltaTByIslamSadiqQureshi(const double jDay); double getDeltaTByIslamSadiqQureshi(const double jDay);
//! Get Delta-T estimation for a given date.
//! Implementation of polinomial approximation of time period 1620-2
013 for DeltaT by M. Khalid, Mariam Sultana and Faheem Zaidi (2014).
//! Source: Delta T: Polynomial Approximation of Time Period 1620-20
13
//! Journal of Astrophysics, Vol. 2014, Article ID 480964
//! http://dx.doi.org/10.1155/2014/480964
//! @param jDay the date and time expressed as a julian day
//! @return Delta-T in seconds
double getDeltaTByKhalidSultanaZaidi(const double jDay);
//! Get Secular Acceleration estimation for a given year. //! Get Secular Acceleration estimation for a given year.
//! Method described is here: http://eclipse.gsfc.nasa.gov/SEcat5/se cular.html //! Method described is here: http://eclipse.gsfc.nasa.gov/SEcat5/se cular.html
//! For adapting from -26 to -25.858, use -0.91072 * (-25.858 + 26.0 ) = -0.12932224 //! For adapting from -26 to -25.858, use -0.91072 * (-25.858 + 26.0 ) = -0.12932224
//! For adapting from -26 to -23.895, use -0.91072 * (-23.895 + 26.0 ) = -1.9170656 //! For adapting from -26 to -23.895, use -0.91072 * (-23.895 + 26.0 ) = -1.9170656
//! @param jDay the JD //! @param jDay the JD
//! @param ndot value n-dot which use in the algorithm //! @param ndot value n-dot which use in the algorithm
//! @return SecularAcceleration in seconds //! @return SecularAcceleration in seconds
//! @note n-dot for secular acceleration of the Moon in ELP2000-82B is -23.8946 "/cy/cy //! @note n-dot for secular acceleration of the Moon in ELP2000-82B is -23.8946 "/cy/cy
double getMoonSecularAcceleration(const double jDay, const double nd ot); double getMoonSecularAcceleration(const double jDay, const double nd ot);
//! Get the standard error (sigma) for the value of DeltaT //! Get the standard error (sigma) for the value of DeltaT
//! @param jDay the JD //! @param jDay the JD
//! @return sigma in seconds //! @return sigma in seconds
double getDeltaTStandardError(const double jDay); double getDeltaTStandardError(const double jDay);
//! Sign function from http://stackoverflow.com/questions/1903954/is -there-a-standard-sign-function-signum-sgn-in-c-c //! Sign function from http://stackoverflow.com/questions/1903954/is -there-a-standard-sign-function-signum-sgn-in-c-c
template <typename T> int sign(T val) { template <typename T> int sign(T val)
{
return (T(0) < val) - (val < T(0)); return (T(0) < val) - (val < T(0));
} }
//! Compute cosines and sines around a circle which is split in "seg ments" parts. //! Compute cosines and sines around a circle which is split in "seg ments" parts.
//! Values are stored in the global static array cos_sin_theta. //! Values are stored in the global static array cos_sin_theta.
//! Used for the sin/cos values along a latitude circle, equator, et c. for a spherical mesh. //! Used for the sin/cos values along a latitude circle, equator, et c. for a spherical mesh.
//! @param slices number of partitions (elsewhere called "segments") for the circle //! @param slices number of partitions (elsewhere called "segments") for the circle
float *ComputeCosSinTheta(const int slices); float *ComputeCosSinTheta(const int slices);
//! Compute cosines and sines around a half-circle which is split in "segments" parts. //! Compute cosines and sines around a half-circle which is split in "segments" parts.
skipping to change at line 618 skipping to change at line 638
//! Compute cosines and sines around part of a circle (from top to b ottom) which is split in "segments" parts. //! Compute cosines and sines around part of a circle (from top to b ottom) which is split in "segments" parts.
//! Values are stored in the global static array cos_sin_rho. //! Values are stored in the global static array cos_sin_rho.
//! Used for the sin/cos values along a meridian. //! Used for the sin/cos values along a meridian.
//! This allows leaving away pole caps. The array now contains value s for the region minAngle+segments*phi //! This allows leaving away pole caps. The array now contains value s for the region minAngle+segments*phi
//! @param dRho a difference angle between the stops //! @param dRho a difference angle between the stops
//! @param segments number of segments //! @param segments number of segments
//! @param minAngle start angle inside the half-circle. maxAngle=min Angle+segments*phi //! @param minAngle start angle inside the half-circle. maxAngle=min Angle+segments*phi
float* ComputeCosSinRhoZone(const float dRho, const int segments, co nst float minAngle); float* ComputeCosSinRhoZone(const float dRho, const int segments, co nst float minAngle);
//! Compute date in decimal year format
//! @param year
//! @param month
//! @param day
//! @return decimal year
double getDecYear(const int year, const int month, const int day);
//! Uncompress gzip or zlib compressed data. //! Uncompress gzip or zlib compressed data.
QByteArray uncompress(const QByteArray& data); QByteArray uncompress(const QByteArray& data);
//! Uncompress (gzip/zlib) data from this QIODevice, which must be o
pen and readable.
//! @param device The device to read from, must already be opened wi
th an OpenMode supporting reading
//! @param maxBytes The max. amount of bytes to read from the device
, or -1 to read until EOF. Note that it
//! always stops when inflate() returns Z_STREAM_END. Positive value
s can be used for interleaving compressed data
//! with other data.
QByteArray uncompress(QIODevice &device, qint64 maxBytes=-1);
#ifdef _MSC_BUILD #ifdef _MSC_BUILD
inline double trunc(double x) inline double trunc(double x)
{ {
return (x < 0 ? std::ceil(x) : std::floor(x)); return (x < 0 ? std::ceil(x) : std::floor(x));
} }
#else #else
inline double trunc(double x) { return ::trunc(x); } inline double trunc(double x) { return ::trunc(x); }
#endif #endif
} }
#endif // _STELUTILS_HPP_ #endif // _STELUTILS_HPP_
 End of changes. 10 change blocks. 
8 lines changed or deleted 52 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/