![]() |
SolTrack
SolTrack is a simple, free, fast and accurate C routine to compute the position of the Sun
|
#include "SolTrack.h"
Functions | |
void | SolTrack_RiseSet (struct Time time, struct Location location, struct Position *position, struct RiseSet *riseSet, double rsAlt, int useDegrees, int useNorthEqualsZero) |
Compute rise, transit and set times for the Sun, as well as their azimuths/altitude. More... | |
double | rev (double angle) |
Fold an angle to take a value between 0 and 2pi. More... | |
double | rev2 (double angle) |
Fold an angle to take a value between -pi and pi. More... | |
void SolTrack_RiseSet | ( | struct Time | time, |
struct Location | location, | ||
struct Position * | position, | ||
struct RiseSet * | riseSet, | ||
double | rsAlt, | ||
int | useDegrees, | ||
int | useNorthEqualsZero | ||
) |
Compute rise, transit and set times for the Sun, as well as their azimuths/altitude.
[in] | time | Struct containing date and time to compute the position for, in UT |
[in] | location | Struct containing the geographic location to compute the position for |
[out] | position | Struct containing the position of the Sun |
[out] | riseSet | Struct containing the Sun's rise, transit and set data |
[in] | rsAlt | Altitude to return rise/set data for (radians; 0. is actual rise/set). rsAlt>pi/2: compute transit only |
[in] | useDegrees | Use degrees for input and output angular variables, rather than radians |
[in] | useNorthEqualsZero | Use the definition where azimuth=0 denotes north, rather than south |
Example Usage:
References Position::agst, Time::day, Position::declination, Time::hour, Location::latitude, Location::longitude, Time::minute, Time::month, PI, R2D, R2H, rev(), rev2(), Position::rightAscension, RiseSet::riseAzimuth, RiseSet::riseTime, Time::second, RiseSet::setAzimuth, RiseSet::setTime, SolTrack(), RiseSet::transitAltitude, RiseSet::transitTime, and Time::year.
double rev | ( | double | angle | ) |
Fold an angle to take a value between 0 and 2pi.
[in] | angle | Angle to fold (radians) |
Referenced by SolTrack_RiseSet().
double rev2 | ( | double | angle | ) |
Fold an angle to take a value between -pi and pi.
[in] | angle | Angle to fold (radians) |
References MPI, PI, and TWO_PI.
Referenced by SolTrack_RiseSet().