#include <SO3Astronomy.h>
Static Public Member Functions | |
| static double | NormalizeDegrees (double x) |
| static double | RadToDeg (double x) |
| static double | DegToRad (double x) |
| static double | SinDeg (double x) |
| static double | CosDeg (double x) |
| static double | Atan2Deg (double y, double x) |
| static void | ConvertEclipticToEquatorialRad (double lon, double lat, double &rasc, double &decl) |
| static void | ConvertRectangularToSpherical (double x, double y, double z, double &rasc, double &decl, double &dist) |
| static void | ConvertSphericalToRectangular (double rasc, double decl, double dist, double &x, double &y, double &z) |
| static void | ConvertEquatorialToHorizontal (double jday, double longitude, double latitude, double rasc, double decl, double &azimuth, double &altitude) |
| static void | GetEclipticSunPosition (double jday, double &lambda, double &beta) |
| static void | GetEquatorialSunPosition (double jday, double &sunRightAscension, double &sunDeclinaison) |
| static void | GetHorizontalSunPosition (double jday, double longitude, double latitude, double &azimuth, double &altitude) |
| static void | GetHorizontalSunPosition (double jday, Ogre::Degree longitude, Ogre::Degree latitude, Ogre::Degree &azimuth, Ogre::Degree &altitude) |
| static void | GetEclipticMoonPositionRad (double jday, double &lon, double &lat) |
| static void | GetHorizontalMoonPosition (double jday, double longitude, double latitude, double &azimuth, double &altitude) |
| static void | GetHorizontalMoonPosition (double jday, Ogre::Degree longitude, Ogre::Degree latitude, Ogre::Degree &azimuth, Ogre::Degree &altitude) |
| static void | GetMoonPhase (double jday, float &moonPhase) |
| static int | GetJulianDayFromGregorianDate (int year, int month, int day) |
| static double | GetJulianDayFromGregorianDateTime (int year, int month, int day, int hour, int minute, double second) |
| static double | GetJulianDayFromGregorianDateTime (int year, int month, int day, double secondsFromMidnight) |
| static void | GetGregorianDateFromJulianDay (int julianDay, int &year, int &month, int &day) |
| static void | GetGregorianDateTimeFromJulianDay (double julianDay, int &year, int &month, int &day, int &hour, int &minute, double &second) |
| static void | GetGregorianDateFromJulianDay (double julianDay, int &year, int &month, int &day) |
| static int | EnterHighPrecissionFloatingPointMode () |
| static void | RestoreFloatingPointMode (int oldMode) |
| static void | GetEclipticSunMeanLongitude (double jday, double &sunlon) |
Static Public Attributes | |
| static const double | J2000 = 2451545.0 |
| January 1, 2000, noon. | |
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 51 of file SO3Astronomy.h.
| double SO3::SAstronomy::Atan2Deg | ( | double | y, | |
| double | x | |||
| ) | [static] |
Definition at line 61 of file SO3Astronomy.cpp.
| void SO3::SAstronomy::ConvertEclipticToEquatorialRad | ( | double | lon, | |
| double | lat, | |||
| double & | rasc, | |||
| double & | decl | |||
| ) | [static] |
Convert from ecliptic to ecuatorial spherical coordinates, in radians.
| lon | Ecliptic longitude | |
| lat | Ecliptic latitude | |
| rasc | Right ascension | |
| decl | Declination |
Definition at line 76 of file SO3Astronomy.cpp.
| void SO3::SAstronomy::ConvertEquatorialToHorizontal | ( | double | jday, | |
| double | longitude, | |||
| double | latitude, | |||
| double | rasc, | |||
| double | decl, | |||
| double & | azimuth, | |||
| double & | altitude | |||
| ) | [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.
| 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 103 of file SO3Astronomy.cpp.
| void SO3::SAstronomy::ConvertRectangularToSpherical | ( | double | x, | |
| double | y, | |||
| double | z, | |||
| double & | rasc, | |||
| double & | decl, | |||
| double & | dist | |||
| ) | [static] |
Definition at line 89 of file SO3Astronomy.cpp.
| void SO3::SAstronomy::ConvertSphericalToRectangular | ( | double | rasc, | |
| double | decl, | |||
| double | dist, | |||
| double & | x, | |||
| double & | y, | |||
| double & | z | |||
| ) | [static] |
Definition at line 96 of file SO3Astronomy.cpp.
| double SO3::SAstronomy::CosDeg | ( | double | x | ) | [static] |
Definition at line 56 of file SO3Astronomy.cpp.
| double SO3::SAstronomy::DegToRad | ( | double | x | ) | [static] |
Convert degrees to radians.
Definition at line 46 of file SO3Astronomy.cpp.
| int SO3::SAstronomy::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.
Definition at line 330 of file SO3Astronomy.cpp.
| void SO3::SAstronomy::GetEclipticMoonPositionRad | ( | double | jday, | |
| double & | lon, | |||
| double & | lat | |||
| ) | [static] |
Gets the moon position at a specific time in ecliptic coordinates
| lon,: | Ecliptic longitude, in radians. | |
| lat,: | Ecliptic latitude, in radians. |
Definition at line 187 of file SO3Astronomy.cpp.
| void SO3::SAstronomy::GetEclipticSunMeanLongitude | ( | double | jday, | |
| double & | sunlon | |||
| ) | [static] |
Definition at line 128 of file SO3Astronomy.cpp.
| void SO3::SAstronomy::GetEclipticSunPosition | ( | double | jday, | |
| double & | lambda, | |||
| double & | beta | |||
| ) | [static] |
Definition at line 153 of file SO3Astronomy.cpp.
| void SO3::SAstronomy::GetEquatorialSunPosition | ( | double | jday, | |
| double & | sunRightAscension, | |||
| double & | sunDeclinaison | |||
| ) | [static] |
Definition at line 162 of file SO3Astronomy.cpp.
| void SO3::SAstronomy::GetGregorianDateFromJulianDay | ( | double | julianDay, | |
| int & | year, | |||
| int & | month, | |||
| int & | day | |||
| ) | [static] |
Get gregorian date from floating point julian day.
Definition at line 321 of file SO3Astronomy.cpp.
| void SO3::SAstronomy::GetGregorianDateFromJulianDay | ( | int | julianDay, | |
| int & | year, | |||
| int & | month, | |||
| int & | day | |||
| ) | [static] |
Get gregorian date from integer julian day.
Definition at line 284 of file SO3Astronomy.cpp.
| void SO3::SAstronomy::GetGregorianDateTimeFromJulianDay | ( | double | julianDay, | |
| int & | year, | |||
| int & | month, | |||
| int & | day, | |||
| int & | hour, | |||
| int & | minute, | |||
| double & | second | |||
| ) | [static] |
Get gregorian date time from floating point julian day.
Definition at line 305 of file SO3Astronomy.cpp.
| void SO3::SAstronomy::GetHorizontalMoonPosition | ( | double | jday, | |
| Ogre::Degree | longitude, | |||
| Ogre::Degree | latitude, | |||
| Ogre::Degree & | azimuth, | |||
| Ogre::Degree & | altitude | |||
| ) | [static] |
Definition at line 238 of file SO3Astronomy.cpp.
| void SO3::SAstronomy::GetHorizontalMoonPosition | ( | double | jday, | |
| double | longitude, | |||
| double | latitude, | |||
| double & | azimuth, | |||
| double & | altitude | |||
| ) | [static] |
Definition at line 220 of file SO3Astronomy.cpp.
| void SO3::SAstronomy::GetHorizontalSunPosition | ( | double | jday, | |
| Ogre::Degree | longitude, | |||
| Ogre::Degree | latitude, | |||
| Ogre::Degree & | azimuth, | |||
| Ogre::Degree & | altitude | |||
| ) | [static] |
Definition at line 179 of file SO3Astronomy.cpp.
| void SO3::SAstronomy::GetHorizontalSunPosition | ( | double | jday, | |
| double | longitude, | |||
| double | latitude, | |||
| double & | azimuth, | |||
| double & | altitude | |||
| ) | [static] |
Get the sun's position in the sky in, relative to the horizon.
| 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 171 of file SO3Astronomy.cpp.
| int SO3::SAstronomy::GetJulianDayFromGregorianDate | ( | int | year, | |
| int | month, | |||
| int | day | |||
| ) | [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
Definition at line 256 of file SO3Astronomy.cpp.
| double SO3::SAstronomy::GetJulianDayFromGregorianDateTime | ( | int | year, | |
| int | month, | |||
| int | day, | |||
| double | secondsFromMidnight | |||
| ) | [static] |
Get astronomical julian day from normal gregorian calendar.
Definition at line 277 of file SO3Astronomy.cpp.
| double SO3::SAstronomy::GetJulianDayFromGregorianDateTime | ( | int | year, | |
| int | month, | |||
| int | day, | |||
| int | hour, | |||
| int | minute, | |||
| double | second | |||
| ) | [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 267 of file SO3Astronomy.cpp.
| void SO3::SAstronomy::GetMoonPhase | ( | double | jday, | |
| float & | moonPhase | |||
| ) | [static] |
Compute the moon phase at a given date.
Definition at line 246 of file SO3Astronomy.cpp.
| double SO3::SAstronomy::NormalizeDegrees | ( | double | x | ) | [static] |
Normalize an angle to the 0, 360 range.
| x | The angle to normalize |
Definition at line 66 of file SO3Astronomy.cpp.
| double SO3::SAstronomy::RadToDeg | ( | double | x | ) | [static] |
Convert radians to degrees.
Definition at line 41 of file SO3Astronomy.cpp.
| void SO3::SAstronomy::RestoreFloatingPointMode | ( | int | oldMode | ) | [static] |
Definition at line 337 of file SO3Astronomy.cpp.
| double SO3::SAstronomy::SinDeg | ( | double | x | ) | [static] |
Definition at line 51 of file SO3Astronomy.cpp.
const double SO3::SAstronomy::J2000 = 2451545.0 [static] |
January 1, 2000, noon.
Definition at line 54 of file SO3Astronomy.h.
1.6.3