Back to index

php5  5.3.10
astro.h
Go to the documentation of this file.
00001 /* This macro computes the length of the day, from sunrise to sunset. */
00002 /* Sunrise/set is considered to occur when the Sun's upper limb is    */
00003 /* 35 arc minutes below the horizon (this accounts for the refraction */
00004 /* of the Earth's atmosphere).                                        */
00005 #define day_length(year,month,day,lon,lat)  \
00006         __daylen__( year, month, day, lon, lat, -35.0/60.0, 1 )
00007 
00008 /* This macro computes the length of the day, including civil twilight. */
00009 /* Civil twilight starts/ends when the Sun's center is 6 degrees below  */
00010 /* the horizon.                                                         */
00011 #define day_civil_twilight_length(year,month,day,lon,lat)  \
00012         __daylen__( year, month, day, lon, lat, -6.0, 0 )
00013 
00014 /* This macro computes the length of the day, incl. nautical twilight.  */
00015 /* Nautical twilight starts/ends when the Sun's center is 12 degrees    */
00016 /* below the horizon.                                                   */
00017 #define day_nautical_twilight_length(year,month,day,lon,lat)  \
00018         __daylen__( year, month, day, lon, lat, -12.0, 0 )
00019 
00020 /* This macro computes the length of the day, incl. astronomical twilight. */
00021 /* Astronomical twilight starts/ends when the Sun's center is 18 degrees   */
00022 /* below the horizon.                                                      */
00023 #define day_astronomical_twilight_length(year,month,day,lon,lat)  \
00024         __daylen__( year, month, day, lon, lat, -18.0, 0 )
00025 
00026 
00027 /* This macro computes times for sunrise/sunset.                      */
00028 /* Sunrise/set is considered to occur when the Sun's upper limb is    */
00029 /* 35 arc minutes below the horizon (this accounts for the refraction */
00030 /* of the Earth's atmosphere).                                        */
00031 #define timelib_astro_sun_rise_set(ts,lon,lat,hrise,hset,rise,set)  \
00032         timelib_astro_rise_set_altitude( ts, lon, lat, -35.0/60.0, 1, hrise, hset, rise, set )
00033 
00034 /* This macro computes the start and end times of civil twilight.       */
00035 /* Civil twilight starts/ends when the Sun's center is 6 degrees below  */
00036 /* the horizon.                                                         */
00037 #define civil_twilight(ts,lon,lat,start,end)  \
00038         timelib_astro_rise_set_altitude( ts, lon, lat, -6.0, 0, start, end )
00039 
00040 /* This macro computes the start and end times of nautical twilight.    */
00041 /* Nautical twilight starts/ends when the Sun's center is 12 degrees    */
00042 /* below the horizon.                                                   */
00043 #define nautical_twilight(ts,lon,lat,start,end)  \
00044         timelib_astro_rise_set_altitude( ts, lon, lat, -12.0, 0, start, end )
00045 
00046 /* This macro computes the start and end times of astronomical twilight.   */
00047 /* Astronomical twilight starts/ends when the Sun's center is 18 degrees   */
00048 /* below the horizon.                                                      */
00049 #define astronomical_twilight(ts,lon,lat,start,end)  \
00050         timelib_astro_rise_set_altitude( ts, lon, lat, -18.0, 0, start, end )
00051