Sun position
Sun position algorithm
|
moon.h - routines to calculate the Moon's position More...
Go to the source code of this file.
Functions | |
void | moon_nrelApp2 (double t_cy, const Sky0_Nut1980 *nut, V3D_Vector *appV, double *dist_au) |
Calculates the Moon's position in geocentric apparent coordinates, using the NREL Moon Position Algorithm. More... | |
void | moon_nrelApparent (double j2kTT_cy, Sky_TrueEquatorial *pos) |
Calculate the Moon's position as a unit vector and a distance, in apparent coordinates. More... | |
void | moon_nrelTopocentric (double j2kdUtc, const Sky_DeltaTs *deltas, const Sky_SiteProp *site, Sky_SiteHorizon *topo) |
Calls moon_nrelApparent() to calculate the Moon's position in apparent coordinates using the NREL Moon Position Algorithm, and then converts this to topocentric horizon coordinates at the specified site. More... | |
double | moon_riseSet (int year, int month, int day, bool getMoonrise, const Sky_DeltaTs *deltas, const Sky_SiteProp *site, Sky_SiteHorizon *topo) |
Routine to calculate the time of moonrise or moonset for the day specified by year, month and day. More... | |
moon.h - routines to calculate the Moon's position
An implementation of the SAMPA (Moon Position Algorithm) from the National Renewable Energy Laboratory
Rectangular coordinates are used wherever possible, to minimise the unnecessary recalculation of trigonometric functions.
Definition in file moon.h.
void moon_nrelApp2 | ( | double | t_cy, |
const Sky0_Nut1980 * | nut, | ||
V3D_Vector * | appV, | ||
double * | dist_au | ||
) |
Calculates the Moon's position in geocentric apparent coordinates, using the NREL Moon Position Algorithm.
[in] | t_cy | Julian centuries since J2000.0, TT timescale |
[in] | nut | Nutation terms and obliquity of the ecliptic |
[out] | appV | Position vector of Moon in apparent coordinates (unit vector i.e. direction cosines) |
[out] | dist_au | Geocentric distance of the Moon (Astronomical Units) |
void moon_nrelApparent | ( | double | j2kTT_cy, |
Sky_TrueEquatorial * | pos | ||
) |
Calculate the Moon's position as a unit vector and a distance, in apparent coordinates.
It calls moon_nrelApp2() to obtain the Moon's position, after having called sky0_nutationSpa() to obtain the necessary nutation terms.
[in] | j2kTT_cy | Julian centuries since J2000.0, TT timescale |
[out] | pos | Timestamped structure containing position data and the equation of the equinoxes |
void moon_nrelTopocentric | ( | double | j2kdUtc, |
const Sky_DeltaTs * | deltas, | ||
const Sky_SiteProp * | site, | ||
Sky_SiteHorizon * | topo | ||
) |
Calls moon_nrelApparent() to calculate the Moon's position in apparent coordinates using the NREL Moon Position Algorithm, and then converts this to topocentric horizon coordinates at the specified site.
[in] | j2kdUtc | 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 |
double moon_riseSet | ( | int | year, |
int | month, | ||
int | day, | ||
bool | getMoonrise, | ||
const Sky_DeltaTs * | deltas, | ||
const Sky_SiteProp * | site, | ||
Sky_SiteHorizon * | topo | ||
) |
Routine to calculate the time of moonrise or moonset for the day specified by year, month and day.
This function uses the NREL MPA algorithm of moon_nrelTopocentric() to calculate the Moon's position.
[in] | year,month,day | Date for which moonrise or moonset time is desired |
[in] | getMoonrise | If true, get moonrise time. If false, get moonset time |
[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 and its time zone, as set by the sky_setSiteLocation() function (or sky_setSiteLoc2()) and sky_setSiteTimeZone(). |
[out] | topo | Optional. Topocentric position of the Moon at rise or set, in both rectangular (unit vector) form, and as Azimuth and Elevation (altitude) angles. If you are not interested in these values, you can pass NULL to this parameter. |
This routine uses an iterative approach. Three iterations seems to be enough.