SO3Engine
|
#include <SO3Astronomy.h>
Static Public Member Functions | |
static double | NormalizeDegrees (const double &x) |
static double | RadToDeg (const double &x) |
static double | DegToRad (const double &x) |
static double | SinDeg (const double &x) |
static double | CosDeg (const double &x) |
static double | Atan2Deg (const double &y, const double &x) |
static void | ConvertEclipticToEquatorialRad (const double &lon, const double &lat, double &rasc, double &decl) |
static void | ConvertRectangularToSpherical (const double &x, const double &y, const double &z, double &rasc, double &decl, double &dist) |
static void | ConvertSphericalToRectangular (const double &rasc, const double &decl, const double &dist, double &x, double &y, double &z) |
static void | ConvertEquatorialToHorizontal (const double &jday, const double &longitude, const double &latitude, const double &rasc, const double &decl, double &azimuth, double &altitude) |
static void | GetEclipticSunPosition (const double &jday, double &lambda, double &beta) |
static void | GetEquatorialSunPosition (const double &jday, double &sunRightAscension, double &sunDeclinaison) |
static void | GetHorizontalSunPosition (const double &jday, const double &longitude, const double &latitude, double &azimuth, double &altitude) |
static void | GetHorizontalSunPosition (const double &jday, const Ogre::Degree &longitude, const Ogre::Degree &latitude, Ogre::Degree &azimuth, Ogre::Degree &altitude) |
static void | GetEclipticMoonPositionRad (const double &jday, double &lon, double &lat) |
static void | GetHorizontalMoonPosition (const double &jday, const double &longitude, const double &latitude, double &azimuth, double &altitude) |
static void | GetHorizontalMoonPosition (const double &jday, const Ogre::Degree &longitude, const Ogre::Degree &latitude, Ogre::Degree &azimuth, Ogre::Degree &altitude) |
static void | GetMoonPhase (const double &jday, float &moonPhase) |
static int | GetJulianDayFromGregorianDate (const int &year, const int &month, const int &day) |
static double | GetJulianDayFromGregorianDateTime (const int &year, const int &month, const int &day, const int &hour, const int &minute, const double &second) |
static double | GetJulianDayFromGregorianDateTime (const int &year, const int &month, const int &day, const double &secondsFromMidnight) |
static void | GetGregorianDateFromJulianDay (const int &julianDay, int &year, int &month, int &day) |
static void | GetGregorianDateTimeFromJulianDay (const double &julianDay, int &year, int &month, int &day, int &hour, int &minute, double &second) |
static void | GetGregorianDateFromJulianDay (const double &julianDay, int &year, int &month, int &day) |
static int | EnterHighPrecissionFloatingPointMode () |
static void | RestoreFloatingPointMode (const int &oldMode) |
static void | GetEclipticSunMeanLongitude (const double &jday, double &sunlon) |
Static Public Attributes | |
static const double | J2000 = 2451545.0 |
January 1, 2000, noon. | |
Detailed Description
Static class with astronomy routines. This class contains various astronomical routines useful in Caelum. Most of the formulas are from http://stjarnhimlen.se/comp/ppcomp.html That site contains much more than was implemented here; it has code for determining the positions of all the planets. Only the sun and moon are actually useful for caelum. The formulas are isolated here in pure procedural code for easier testing (Tests are done as assertions in the demo). Precision is vital here, so this class uses double instead of float for precission. All angles are in degrees unless otherwise mentioned.
Definition at line 48 of file SO3Astronomy.h.
Member Function Documentation
◆ Atan2Deg()
|
static |
Definition at line 60 of file SO3Astronomy.cpp.
◆ ConvertEclipticToEquatorialRad()
|
static |
Convert from ecliptic to ecuatorial spherical coordinates, in radians.
- Parameters
-
lon Ecliptic longitude lat Ecliptic latitude rasc Right ascension decl Declination
- Warning
- : This function works in radians.
Definition at line 74 of file SO3Astronomy.cpp.
◆ ConvertEquatorialToHorizontal()
|
static |
Convert from equatorial to horizontal coordinates. This function converts from angles relative to the earth's equator to angle relative to the horizon at a given point.
- Parameters
-
jday Astronomical time as julian day. longitude Observer's longitude in degrees east. latitude Observer's latitude in degrees north. rasc Object's right ascension. decl Object's declination. azimuth Object's azimuth (clockwise degrees from true north). altitude Object's altitude (degrees above the horizon).
Definition at line 101 of file SO3Astronomy.cpp.
◆ ConvertRectangularToSpherical()
|
static |
Definition at line 87 of file SO3Astronomy.cpp.
◆ ConvertSphericalToRectangular()
|
static |
Definition at line 94 of file SO3Astronomy.cpp.
◆ CosDeg()
|
static |
Definition at line 55 of file SO3Astronomy.cpp.
◆ DegToRad()
|
static |
Convert degrees to radians.
Definition at line 45 of file SO3Astronomy.cpp.
◆ EnterHighPrecissionFloatingPointMode()
|
static |
Enter high-precission floating-point mode. By default Direct3D decreases the precission of ALL floating point calculations, enough to stop Caelum's astronomy routines from working correctly. To trigger this behaviour in a standard ogre demo select the Direct3D render system and set "Floating-point mode" to "Fastest". Otherwise it's not a problem. It can be fixed by changing the precission only inside caelum's astronomy routines using the _controlfp function. This only works for MSVC on WIN32; This is a no-op on other compilers.
- Note
- : Must be paired with restoreFloatingPointMode.
- Returns
- Value to pass to restoreFloatingModeMode.
Definition at line 328 of file SO3Astronomy.cpp.
◆ GetEclipticMoonPositionRad()
|
static |
Gets the moon position at a specific time in ecliptic coordinates
- Parameters
-
lon Ecliptic longitude, in radians. lat Ecliptic latitude, in radians.
Definition at line 185 of file SO3Astronomy.cpp.
◆ GetEclipticSunMeanLongitude()
|
static |
Definition at line 126 of file SO3Astronomy.cpp.
◆ GetEclipticSunPosition()
|
static |
Definition at line 151 of file SO3Astronomy.cpp.
◆ GetEquatorialSunPosition()
|
static |
Definition at line 160 of file SO3Astronomy.cpp.
◆ GetGregorianDateFromJulianDay() [1/2]
|
static |
Get gregorian date from floating point julian day.
Definition at line 319 of file SO3Astronomy.cpp.
◆ GetGregorianDateFromJulianDay() [2/2]
|
static |
Get gregorian date from integer julian day.
Definition at line 282 of file SO3Astronomy.cpp.
◆ GetGregorianDateTimeFromJulianDay()
|
static |
Get gregorian date time from floating point julian day.
Definition at line 303 of file SO3Astronomy.cpp.
◆ GetHorizontalMoonPosition() [1/2]
|
static |
Definition at line 218 of file SO3Astronomy.cpp.
◆ GetHorizontalMoonPosition() [2/2]
|
static |
Definition at line 236 of file SO3Astronomy.cpp.
◆ GetHorizontalSunPosition() [1/2]
|
static |
Get the sun's position in the sky in, relative to the horizon.
- Parameters
-
jday Astronomical time as julian day. longitude Observer longitude latitude Observer latitude azimuth Astronomical azimuth, measured clockwise from North = 0. altitude Astronomical altitude, elevation above the horizon.
Definition at line 169 of file SO3Astronomy.cpp.
◆ GetHorizontalSunPosition() [2/2]
|
static |
Definition at line 177 of file SO3Astronomy.cpp.
◆ GetJulianDayFromGregorianDate()
|
static |
Get astronomical julian day from normal gregorian calendar. From wikipedia: the integer number of days that have elapsed since the initial epoch defined as noon Universal Time (UT) Monday, January 1, 4713 BC
- Note
- this is the time at noon, not midnight.
Definition at line 254 of file SO3Astronomy.cpp.
◆ GetJulianDayFromGregorianDateTime() [1/2]
|
static |
Get astronomical julian day from normal gregorian calendar.
Definition at line 275 of file SO3Astronomy.cpp.
◆ GetJulianDayFromGregorianDateTime() [2/2]
|
static |
Get astronomical julian day from normal gregorian calendar. Calculate julian day from a day in the normal gregorian calendar. Time should be given as UTC.
Definition at line 265 of file SO3Astronomy.cpp.
◆ GetMoonPhase()
|
static |
Compute the moon phase at a given date.
Definition at line 244 of file SO3Astronomy.cpp.
◆ NormalizeDegrees()
|
static |
Normalize an angle to the 0, 360 range.
- Parameters
-
x The angle to normalize
Definition at line 65 of file SO3Astronomy.cpp.
◆ RadToDeg()
|
static |
Convert radians to degrees.
Definition at line 40 of file SO3Astronomy.cpp.
◆ RestoreFloatingPointMode()
|
static |
Definition at line 335 of file SO3Astronomy.cpp.
◆ SinDeg()
|
static |
Definition at line 50 of file SO3Astronomy.cpp.
Member Data Documentation
◆ J2000
|
static |
January 1, 2000, noon.
Definition at line 51 of file SO3Astronomy.h.
The documentation for this class was generated from the following files:
- include/SO3Utils/SO3Astronomy.h
- src/SO3Utils/SO3Astronomy.cpp
Generated by 1.9.8