simgear  3.5.0 [next] git://gitorious.org/fg/simgear.git
SimGear - Simulator Construction Tools
SGEphemeris Class Reference

#include <ephemeris.hxx>

Public Member Functions

 SGEphemeris (const std::string &path)
 
 ~SGEphemeris (void)
 
MoonPosget_moon () const
 
Starget_sun () const
 
double getMoonDeclination () const
 
double getMoonRightAscension () const
 
int getNumPlanets () const
 
int getNumStars () const
 
SGVec3dgetPlanets ()
 
const SGVec3dgetPlanets () const
 
SGVec3dgetStars ()
 
const SGVec3dgetStars () const
 
double getSunDeclination () const
 
double getSunRightAscension () const
 
void update (double mjd, double lst, double lat)
 

Private Attributes

Jupiterjupiter
 
Marsmars
 
Mercurymercury
 
MoonPosmoon
 
Neptuneneptune
 
int nplanets
 
Starour_sun
 
SGVec3d planets [7]
 
Saturnsaturn
 
SGStarDatastars
 
Uranusuranus
 
Venusvenus
 

Detailed Description

Ephemeris class

Written by Durk Talsma d.tal.nosp@m.sma@.nosp@m.direc.nosp@m.t.a2.nosp@m.000.n.nosp@m.l and Curtis Olson http://www.flightgear.org/~curt

Introduction

The SGEphemeris class computes and stores the positions of the Sun, the Moon, the planets, and the brightest stars. These positions can then be used to accurately render the dominant visible items in the Earth's sky. Note, this class isn't intended for use in an interplanetary/interstellar/intergalactic type application. It is calculates everything relative to the Earth and is therefore best suited for Earth centric applications.

The positions of the various astronomical objects are time dependent, so to maintain accuracy, you will need to periodically call the update() method. The SGTime class conveniently provides the two time related values you need to pass to the update() method.

Definition at line 71 of file ephemeris.hxx.

Constructor & Destructor Documentation

SGEphemeris::SGEphemeris ( const std::string &  path)

Constructor. This creates an instance of the SGEphemeris object. When calling the constructor you need to provide a path pointing to your star database file.

Parameters
pathpath to your star database

Definition at line 34 of file ephemeris.cxx.

SGEphemeris::~SGEphemeris ( void  )

Destructor

Definition at line 52 of file ephemeris.cxx.

Member Function Documentation

MoonPos* SGEphemeris::get_moon ( ) const
inline
Returns
a pointer to a Moon class containing all the positional information for Earth's Moon.

Definition at line 137 of file ephemeris.hxx.

Star* SGEphemeris::get_sun ( ) const
inline
Returns
a pointer to a Star class containing all the positional information for Earth's Sun.

Definition at line 121 of file ephemeris.hxx.

double SGEphemeris::getMoonDeclination ( ) const
inline
Returns
the declination of the Moon.

Definition at line 145 of file ephemeris.hxx.

Referenced by SGSky::reposition().

double SGEphemeris::getMoonRightAscension ( ) const
inline
Returns
the right ascension of the Moon.

Definition at line 140 of file ephemeris.hxx.

Referenced by SGSky::reposition().

int SGEphemeris::getNumPlanets ( ) const
inline
Returns
the numbers of defined planets.

Definition at line 150 of file ephemeris.hxx.

Referenced by SGSky::build(), and SGSky::repaint().

int SGEphemeris::getNumStars ( ) const
inline
Returns
the numbers of defined stars.

Definition at line 164 of file ephemeris.hxx.

Referenced by SGSky::build(), and SGSky::repaint().

SGVec3d* SGEphemeris::getPlanets ( )
inline

Returns a pointer to an array of planet data in sgdVec3 format. (See plib.sourceforge.net for information on plib and the ``sg'' package.) An sgdVec3 is a 3 element double array. The first element is the right ascension of the planet, the second is the declination, and the third is the magnitude.

Returns
planets array

Definition at line 160 of file ephemeris.hxx.

Referenced by SGSky::build(), and SGSky::repaint().

const SGVec3d* SGEphemeris::getPlanets ( ) const
inline

Definition at line 161 of file ephemeris.hxx.

SGVec3d* SGEphemeris::getStars ( )
inline

Returns a pointer to an array of star data in sgdVec3 format. An The first element of the sgdVec3 is the right ascension of the planet, the second is the declination, and the third is the magnitude.

Returns
star array

Definition at line 173 of file ephemeris.hxx.

Referenced by SGSky::build(), and SGSky::repaint().

const SGVec3d* SGEphemeris::getStars ( ) const
inline

Definition at line 174 of file ephemeris.hxx.

double SGEphemeris::getSunDeclination ( ) const
inline
Returns
the declination of the Sun.

Definition at line 129 of file ephemeris.hxx.

Referenced by SGSky::reposition().

double SGEphemeris::getSunRightAscension ( ) const
inline
Returns
the right ascension of the Sun.

Definition at line 124 of file ephemeris.hxx.

Referenced by SGSky::reposition().

void SGEphemeris::update ( double  mjd,
double  lst,
double  lat 
)

Update (recalculate) the positions of all objects for the specified time. The update() method requires you to pass in the current modified Julian date, the current local sidereal time, and the current latitude. The update() method is designed to be called by the host application before every frame.

Parameters
mjdmodified julian date
lstcurrent local sidereal time
latcurrent latitude

Definition at line 68 of file ephemeris.cxx.

Member Data Documentation

Jupiter* SGEphemeris::jupiter
private

Definition at line 78 of file ephemeris.hxx.

Referenced by SGEphemeris(), update(), and ~SGEphemeris().

Mars* SGEphemeris::mars
private

Definition at line 77 of file ephemeris.hxx.

Referenced by SGEphemeris(), update(), and ~SGEphemeris().

Mercury* SGEphemeris::mercury
private

Definition at line 75 of file ephemeris.hxx.

Referenced by SGEphemeris(), update(), and ~SGEphemeris().

MoonPos* SGEphemeris::moon
private

Definition at line 74 of file ephemeris.hxx.

Referenced by get_moon(), SGEphemeris(), update(), and ~SGEphemeris().

Neptune* SGEphemeris::neptune
private

Definition at line 81 of file ephemeris.hxx.

Referenced by SGEphemeris(), update(), and ~SGEphemeris().

int SGEphemeris::nplanets
private

Definition at line 87 of file ephemeris.hxx.

Referenced by getNumPlanets(), SGEphemeris(), and update().

Star* SGEphemeris::our_sun
private

Definition at line 73 of file ephemeris.hxx.

Referenced by get_sun(), SGEphemeris(), update(), and ~SGEphemeris().

SGVec3d SGEphemeris::planets[7]
private

Definition at line 88 of file ephemeris.hxx.

Referenced by getPlanets(), SGEphemeris(), and update().

Saturn* SGEphemeris::saturn
private

Definition at line 79 of file ephemeris.hxx.

Referenced by SGEphemeris(), update(), and ~SGEphemeris().

SGStarData* SGEphemeris::stars
private

Definition at line 90 of file ephemeris.hxx.

Referenced by SGEphemeris(), and ~SGEphemeris().

Uranus* SGEphemeris::uranus
private

Definition at line 80 of file ephemeris.hxx.

Referenced by SGEphemeris(), update(), and ~SGEphemeris().

Venus* SGEphemeris::venus
private

Definition at line 76 of file ephemeris.hxx.

Referenced by SGEphemeris(), update(), and ~SGEphemeris().


The documentation for this class was generated from the following files: