4#define TMOD(x) ((x)<0?(x)+24:((x)>=24?(x)-24:(x)))
5#define DAYSOFF(x) ((x)<0?"(-1) ":((x)>=24?"(+1) ":""))
7#define HOURS(h) ((int)(floor(h)))
8#define MINUTES(h) ((int)(60*(h-floor(h))))
11#define ABS(x) ((x)<0?-(x):(x))
17#define days_since_2000_Jan_0(y,m,d) \
18 (367L*(y)-((7*((y)+(((m)+9)/12)))/4)+((275*(m))/9)+(d)-730530L)
23 #define PI 3.1415926535897932384
26#define RADEG ( 180.0 / PI )
27#define DEGRAD ( PI / 180.0 )
31#define sind(x) sin((x)*DEGRAD)
32#define cosd(x) cos((x)*DEGRAD)
33#define tand(x) tan((x)*DEGRAD)
35#define atand(x) (RADEG*atan(x))
36#define asind(x) (RADEG*asin(x))
37#define acosd(x) (RADEG*acos(x))
38#define atan2d(y,x) (RADEG*atan2(y,x))
52#define day_length(year,month,day,lon,lat) \
53 __daylen__( year, month, day, lon, lat, -50.0/60.0, 1 )
58#define day_civil_twilight_length(year,month,day,lon,lat) \
59 __daylen__( year, month, day, lon, lat, -6.0, 0 )
64#define day_nautical_twilight_length(year,month,day,lon,lat) \
65 __daylen__( year, month, day, lon, lat, -12.0, 0 )
70#define day_astronomical_twilight_length(year,month,day,lon,lat) \
71 __daylen__( year, month, day, lon, lat, -18.0, 0 )
78#define sun_rise_set(year,month,day,lon,lat,rise,set) \
79 __sunriset__( year, month, day, lon, lat, -35.0/60.0, 1, rise, set )
84#define civil_twilight(year,month,day,lon,lat,start,end) \
85 __sunriset__( year, month, day, lon, lat, -6.0, 0, start, end )
90#define nautical_twilight(year,month,day,lon,lat,start,end) \
91 __sunriset__( year, month, day, lon, lat, -12.0, 0, start, end )
96#define astronomical_twilight(year,month,day,lon,lat,start,end) \
97 __sunriset__( year, month, day, lon, lat, -18.0, 0, start, end )
102double __daylen__(
int year,
int month,
int day,
double lon,
double lat,
103 double altit,
int upper_limb );
106 double altit,
int upper_limb,
double *rise,
double *set );
108void sunpos(
double d,
double *lon,
double *r );
110void sun_RA_dec(
double d,
double *RA,
double *dec,
double *r );
116double GMST0(
double d );
struct triple lng lat
Definition garmin_img.c:0
double __daylen__(int year, int month, int day, double lon, double lat, double altit, int upper_limb)
Definition sunriset.c:112
void sunpos(double d, double *lon, double *r)
Definition sunriset.c:177
double revolution(double x)
Definition sunriset.c:245
int __sunriset__(int year, int month, int day, double lon, double lat, double altit, int upper_limb, double *rise, double *set)
Definition sunriset.c:24
double rev180(double x)
Definition sunriset.c:253
double GMST0(double d)
Definition sunriset.c:288
const char * timezone_name
void sun_RA_dec(double d, double *RA, double *dec, double *r)
Definition sunriset.c:209