Sun position
Sun position algorithm
|
planet.h - Astronomical routines to get the positions of planets More...
Go to the source code of this file.
Functions | |
void | planet_setCurrent (int np) |
Stores the selected planet number np in internal storage for later use by planet_getApparent() or planet_getTopocentric() More... | |
void | planet_getApp2 (double t_cy, int np, const Sky1_Nut1980 *nut, V3D_Vector *appV, double *dist_au) |
This function calculates the specified planet's position in apparent coordinates, using the planet_getGeocentric() and planet_getHeliocentric() functions More... | |
void | planet_getApparent (double j2kTT_cy, Sky_TrueEquatorial *pos) |
Calculate the position of the currently selected planet as a unit vector and a distance, in apparent coordinates. More... | |
void | planet_getTopocentric (double j2kUtc_d, const Sky_DeltaTs *deltas, const Sky_SiteProp *site, Sky_SiteHorizon *topo) |
Calls planet_getApparent() to calculate the planet's position in apparent coordinates, and then converts this to topocentric horizon coordinates at the specified site. More... | |
void | planet_getGeocentric (double t_cy, int np, V3D_Vector *p2V, double *dist_au) |
Calculates an approximate position of the selected planet as seen from the centre of the earth. More... | |
int | planet_getHeliocentric (double t_cy, int np, V3D_Vector *j2kV_au, V3D_Vector *velV_aupd) |
Calculates an approximate heliocentric position of the selected planet. More... | |
planet.h - Astronomical routines to get the positions of planets
Routines to obtain a specified planet's position and convert that position to apparent coordinates and/or topocentric coordinates.
Definition in file planet.h.
void planet_setCurrent | ( | int | np | ) |
Stores the selected planet number np in internal storage for later use by planet_getApparent() or planet_getTopocentric()
[in] | np | Desired planet. 1=Mercury, 2=Venus, 3=Earth-Moon Barycentre, 4=Mars, 5=Jupiter, 6=Saturn, 7=Uranus, 8=Neptune Numbers outside this range will cause an assertion failure |
void planet_getApp2 | ( | double | t_cy, |
int | np, | ||
const Sky1_Nut1980 * | nut, | ||
V3D_Vector * | appV, | ||
double * | dist_au | ||
) |
This function calculates the specified planet's position in apparent coordinates, using the planet_getGeocentric() and planet_getHeliocentric() functions
[in] | t_cy | Julian centuries since J2000.0, TT timescale |
[in] | np | Desired planet. 1=Mercury, 2=Venus, 3=Earth-Moon Barycentre, 4=Mars, 5=Jupiter, 6=Saturn, 7=Uranus, 8=Neptune Numbers outside this range will cause an assertion failure |
[in] | nut | Nutation terms and obliquity of the ecliptic, as returned by functions sky1_nutationIAU1980() and sky1_epsilon1980() |
[out] | appV | Position vector of planet in apparent coordinates (unit vector i.e. direction cosines) |
[out] | dist_au | Geocentric distance of the planet (Astronomical Units) |
void planet_getApparent | ( | double | j2kTT_cy, |
Sky_TrueEquatorial * | pos | ||
) |
Calculate the position of the currently selected planet as a unit vector and a distance, in apparent coordinates.
It calls planet_getApp2() to obtain the planet's position, after having called sky1_nutationIAU1980() to obtain the necessary nutation terms.
This function is designed to be callable by the skyfast_init() and skyfast_backgroundUpdate() functions in a tracking application.
[in] | j2kTT_cy | Julian centuries since J2000.0, TT timescale |
[out] | pos | Timestamped structure containing position data and the equation of the equinoxes |
The planet whose coordinates are obtained with this function is the planet most recently specified with planet_setCurrent()
void planet_getTopocentric | ( | double | j2kUtc_d, |
const Sky_DeltaTs * | deltas, | ||
const Sky_SiteProp * | site, | ||
Sky_SiteHorizon * | topo | ||
) |
Calls planet_getApparent() to calculate the planet's position in apparent coordinates, and then converts this to topocentric horizon coordinates at the specified site.
[in] | j2kUtc_d | UTC time in "J2KD" form - i.e days since J2000.0 (= JD - 2 451 545.0) |
[in] | deltas | Delta T values, as set by the sky_initTime() (or sky_initTimeSimple() or sky_initTimeDetailed()) routines |
[in] | site | Properties of the observing site, particularly its geometric location on the surface of the Earth, as set by the sky_setSiteLocation() function (or sky_setSiteLoc2()) |
[out] | topo | Topocentric position, in both rectangular (unit vector) form, and as Azimuth and Elevation (altitude) angles |
You will need to call planet_setCurrent() before calling this function to select the planet whose coordinates you want.
void planet_getGeocentric | ( | double | t_cy, |
int | np, | ||
V3D_Vector * | p2V, | ||
double * | dist_au | ||
) |
Calculates an approximate position of the selected planet as seen from the centre of the earth.
This function calls planet_getHeliocentric() for the desired planet. It then (as an approximation) calls this routine again for the position of the Earth and uses this to obtain the geocentric position of the planet.
[in] | t_cy | Julian centuries since J2000.0, TT timescale |
[in] | np | Desired planet. 1=Mercury, 2=Venus, 3=Earth-Moon Barycentre, 4=Mars, 5=Jupiter, 6=Saturn, 7=Uranus, 8=Neptune Numbers outside this range will cause an assertion failure |
[out] | p2V | Position vector of planet in J2000.0 coordinates (unit vector i.e. direction cosines) |
[out] | dist_au | Geocentric distance of the planet (Astronomical Units) |
int planet_getHeliocentric | ( | double | t_cy, |
int | np, | ||
V3D_Vector * | j2kV_au, | ||
V3D_Vector * | velV_aupd | ||
) |
Calculates an approximate heliocentric position of the selected planet.
[in] | t_cy | Julian centuries since J2000.0, TDB (or TT) timescale |
[in] | np | Desired planet. 1=Mercury, 2=Venus, 3=Earth-Moon Barycentre, 4=Mars, 5=Jupiter, 6=Saturn, 7=Uranus, 8=Neptune Numbers outside this range will cause an assertion failure |
[out] | j2kV_au | Heliocentric position of planet referred to J2000.0 mean equator and equinox. |
[out] | velV_aupd | (Optional) Velocity vector of the planet (AU/day), also referred to J2000.0 equator and equinox. If you are not interested in this value, you can pass NULL to this argument. |
iauPlan94()
function from the International Astronomical Union's (IAU) Standards of Fundamental Astronomy (SOFA) collection. See the SOFA Software License at the end of this function's C source code. According to the requirements of that license, here are the required declarations. iauPlan94()
). It does not itself constitute software provided by and/or endorsed by SOFA. iauAnp()