StelUtils.hpp   StelUtils.hpp 
skipping to change at line 24 skipping to change at line 24
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA.
*/ */
#ifndef _STELUTILS_HPP_ #ifndef _STELUTILS_HPP_
#define _STELUTILS_HPP_ #define _STELUTILS_HPP_
#include "VecMath.hpp" #include "VecMath.hpp"
#include "fixx11h.h"
#include <QVariantMap> #include <QVariantMap>
#include <QDateTime> #include <QDateTime>
#include <QString> #include <QString>
// astonomical unit (km) // astonomical unit (km)
#define AU 149597870.691 #define AU 149597870.691
// Parsec (km) // Parsec (km)
#define PARSEC 30.857e12 #define PARSEC 30.857e12
// speed of light (km/sec) // speed of light (km/sec)
#define SPEED_OF_LIGHT 299792.458 #define SPEED_OF_LIGHT 299792.458
//! @namespace StelUtils contains general purpose utility functions. //! @namespace StelUtils contains general purpose utility functions.
namespace StelUtils namespace StelUtils
{ {
//! Return the full name of stellarium, i.e. "stellarium 0.9.0"
QString getApplicationName();
//! Return the version of stellarium, i.e. "0.9.0"
QString getApplicationVersion();
//! Convert an angle in hms format to radian. //! Convert an angle in hms format to radian.
//! @param h hour component //! @param h hour component
//! @param m minute component //! @param m minute component
//! @param s second component //! @param s second component
//! @return angle in radian //! @return angle in radian
double hmsToRad(unsigned int h, unsigned int m, double s); double hmsToRad(unsigned int h, unsigned int m, double s);
//! Convert an angle in +-dms format to radian. //! Convert an angle in +-dms format to radian.
//! @param d degree component //! @param d degree component
skipping to change at line 213 skipping to change at line 217
//! Convert a julian day to a QDateTime. //! Convert a julian day to a QDateTime.
//! @param jd to convert //! @param jd to convert
//! @result the matching UTC QDateTime //! @result the matching UTC QDateTime
QDateTime jdToQDateTime(const double& jd); QDateTime jdToQDateTime(const double& jd);
bool getJDFromDate(double* newjd, int y, int m, int d, int h, int mi n, int s); bool getJDFromDate(double* newjd, int y, int m, int d, int h, int mi n, int s);
int numberOfDaysInMonthInYear(int month, int year); int numberOfDaysInMonthInYear(int month, int year);
bool changeDateTimeForRollover(int oy, int om, int od, int oh, int o min, int os, bool changeDateTimeForRollover(int oy, int om, int od, int oh, int o min, int os,
int* ry, int* rm, int* rd, int* rh, i nt* rmin, int* rs); int* ry, int* rm, int* rd, int* rh, int* rmin, int* rs);
//! Output a QVariantMap to qDebug(). Formats like a tree where the re are nested objects. //! Output a QVariantMap to qDebug(). Formats like a tree where the re are nested objects.
void debugQVariantMap(const QVariant& m, const QString& indent="", c onst QString& key=""); void debugQVariantMap(const QVariant& m, const QString& indent="", c onst QString& key="");
//! Use RegExp for final to parse a QString to six ints, use in the event QDateTime cannot handle the date. //! Use RegExp for final to parse a QString to six ints, use in the event QDateTime cannot handle the date.
QList<int> getIntsFromISO8601String(const QString& iso8601Date); QList<int> getIntsFromISO8601String(const QString& iso8601Date);
/// Compute acos(x)
//! The taylor serie is not accurate around x=1 and x=-1
inline float fastAcos(float x)
{
return M_PI_2 - (x + x*x*x * (1.f/6.f + x*x * (3.f/40.f + 5.
f/112.f * x*x)) );
}
//! Compute exp(x) for small exponents x
inline float fastExp(float x)
{
return (x>=0)?
(1.f + x*(1.f+ x/2.f*(1.f+ x/3.f*(1.f+x/4.f*(1.f+x/5
.f))))):
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)))));
}
} }
#endif // _STELUTILS_HPP_ #endif // _STELUTILS_HPP_
 End of changes. 4 change blocks. 
2 lines changed or deleted 24 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/