1 /*
2  *  This library is free software; you can redistribute it and/or
3  *  modify it under the terms of the GNU Lesser General Public
4  *  License as published by the Free Software Foundation; either
5  *  version 2 of the License, or (at your option) any later version.
6  *
7  *  This library is distributed in the hope that it will be useful,
8  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
9  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
10  *  Lesser General Public License for more details.
11  *
12  *  You should have received a copy of the GNU General Public License
13  *  along with this program; if not, write to the Free Software
14  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
15  *
16  *  Copyright (C) 2000 - 2005 Liam Girdwood
17  */
18 
19 #ifndef _LN_SOLAR_H
20 #define _LN_SOLAR_H
21 
22 #include <libnova/ln_types.h>
23 
24 #define LN_SOLAR_STANDART_HORIZON              -0.8333
25 #define LN_SOLAR_CIVIL_HORIZON                 -6.0
26 #define LN_SOLAR_NAUTIC_HORIZON                -12.0
27 #define LN_SOLAR_ASTRONOMICAL_HORIZON          -18.0
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 /*! \defgroup solar Solar
34 *
35 * Calculate solar ecliptical/equatorial coordinates for a given julian date.
36 * Accuracy 0.01 arc second error - uses VSOP87 solution.
37 *
38 * All angles are expressed in degrees.
39 */
40 
41 /*! \fn int ln_get_solar_rst_horizon (double JD, struct ln_lnlat_posn * observer, double horizon, struct ln_rst_time *rst);
42 * \brief Return solar rise/set time over local horizon (specified in degrees).
43 *  \ingroup solar
44 */
45 int LIBNOVA_EXPORT ln_get_solar_rst_horizon (double JD, struct ln_lnlat_posn * observer, double horizon, struct ln_rst_time * rst);
46 
47 /*! \fn int ln_get_solar_rst (double JD, struct ln_lnlat_posn * observer, struct ln_rst_time * rst);
48 * \brief Calculate the time of rise, set and transit for the Sun.
49 * \ingroup solar
50 */
51 int LIBNOVA_EXPORT ln_get_solar_rst (double JD, struct ln_lnlat_posn * observer, struct ln_rst_time * rst);
52 
53 /*! \fn void ln_get_solar_geom_coords (double JD, struct ln_helio_posn * position);
54 * \brief Calculate solar geometric coordinates.
55 * \ingroup solar
56 */
57 void LIBNOVA_EXPORT ln_get_solar_geom_coords (double JD, struct ln_helio_posn * position);
58 
59 /*! \fn void ln_get_solar_equ_coords (double JD, struct ln_equ_posn * position);
60 * \brief Calculate apparent equatorial coordinates.
61 * \ingroup solar
62 */
63 void LIBNOVA_EXPORT ln_get_solar_equ_coords (double JD, struct ln_equ_posn * position);
64 
65 /*! \fn void ln_get_solar_ecl_coords (double JD, struct ln_lnlat_posn * position);
66 * \brief Calculate apparent ecliptical coordinates.
67 * \ingroup solar
68 */
69 void LIBNOVA_EXPORT ln_get_solar_ecl_coords (double JD, struct ln_lnlat_posn * position);
70 
71 /*! \fn void ln_get_solar_geo_coords (double JD, struct ln_rect_posn * position)
72 * \brief Calculate geocentric coordinates (rectangular)
73 * \ingroup solar
74 */
75 void LIBNOVA_EXPORT ln_get_solar_geo_coords (double JD, struct ln_rect_posn * position);
76 
77 /*! \fn double ln_get_solar_sdiam (double JD)
78 * \brief Calculate the semidiameter of the Sun in arc seconds.
79 * \ingroup solar
80 */
81 double LIBNOVA_EXPORT ln_get_solar_sdiam (double JD);
82 
83 #ifdef __cplusplus
84 };
85 #endif
86 
87 #endif
88