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_RISE_SET_H 20 #define _LN_RISE_SET_H 21 22 #include <libnova/ln_types.h> 23 24 #define LN_STAR_STANDART_HORIZON -0.5667 25 26 #ifdef __cplusplus 27 extern "C" { 28 #endif 29 30 31 /*! \defgroup rst Rise, Set, Transit 32 * 33 * Functions relating to an objects rise, set and transit 34 * 35 * All angles are expressed in degrees. 36 */ 37 38 /*! \fn int ln_get_object_rst (double JD, struct ln_lnlat_posn * observer, struct ln_equ_posn * object,struct ln_rst_time * rst); 39 * \brief Calculate the time of rise, set and transit for an object not orbiting the Sun. 40 * \ingroup rst 41 */ 42 int LIBNOVA_EXPORT ln_get_object_rst (double JD, struct ln_lnlat_posn * observer, struct ln_equ_posn * object, struct ln_rst_time * rst); 43 44 /*! \fn int ln_get_object_rst_horizon (double JD, struct ln_lnlat_posn * observer, struct ln_equ_posn * object, long double horizon, struct ln_rst_time * rst); 45 * \brief Calculate the time of rise, set and transit above local horizon for 46 * an object not orbiting the Sun. 47 * 48 */ 49 int LIBNOVA_EXPORT ln_get_object_rst_horizon (double JD, struct ln_lnlat_posn * observer, 50 struct ln_equ_posn * object, long double horizon, struct ln_rst_time * rst); 51 52 /*! \fn int ln_get_object_next_rst (double JD, struct ln_lnlat_posn * observer, struct ln_equ_posn * object, struct ln_rst_time * rst); 53 * \brief Calculate the time of next rise, set and transit for an object not orbiting the Sun. 54 * E.g. it's sure, that rise, set and transit will be in <JD, JD+1> range. 55 * This function is not too precise, it's good to get general idea when object will rise. 56 * \ingroup rst 57 */ 58 int LIBNOVA_EXPORT ln_get_object_next_rst (double JD, struct ln_lnlat_posn * observer, struct ln_equ_posn * object, struct ln_rst_time * rst); 59 60 /*! \fn int ln_get_object_next_rst_horizon (double JD, struct ln_lnlat_posn * observer, struct ln_equ_posn * object, double horizon, struct ln_rst_time * rst); 61 * \brief Calculate the time of next rise, set and transit for an object not orbiting the Sun. 62 * E.g. it's sure, that rise, set and transit will be in <JD, JD+1> range. 63 * \ingroup rst 64 */ 65 int LIBNOVA_EXPORT ln_get_object_next_rst_horizon (double JD, struct ln_lnlat_posn * observer, struct ln_equ_posn * object, 66 double horizon, struct ln_rst_time * rst); 67 68 /*! \fn int ln_get_body_rst_horizon (double JD, struct ln_lnlat_posn * observer, void (*get_equ_body_coords) (double, struct ln_equ_posn *), double horizon, struct ln_rst_time *rst); 69 * \brief Calculate the time of rise, set and transit for an object a body, usually Sun, a planet or Moon. 70 * \ingroup rst 71 */ 72 int LIBNOVA_EXPORT ln_get_body_rst_horizon (double JD, struct ln_lnlat_posn * observer, void (*get_equ_body_coords) (double, struct ln_equ_posn *), double horizon, struct ln_rst_time * rst); 73 74 /*! \fn int ln_get_body_next_rst_horizon (double JD, struct ln_lnlat_posn * observer, void (*get_equ_body_coords) (double, struct ln_equ_posn *), double horizon, struct ln_rst_time *rst); 75 * \brief Calculate the time of next rise, set and transit for an object a body, usually Sun, a planet or Moon. 76 * E.g. it's sure, that rise, set and transit will be in <JD, JD+1> range. 77 * \ingroup rst 78 */ 79 int LIBNOVA_EXPORT ln_get_body_next_rst_horizon (double JD, struct ln_lnlat_posn * observer, void (*get_equ_body_coords) (double, struct ln_equ_posn *), double horizon, struct ln_rst_time * rst); 80 81 /*! \fn int ln_get_body_next_rst_horizon_future (double JD, struct ln_lnlat_posn * observer, void (*get_equ_body_coords) (double, struct ln_equ_posn *), double horizon, int day_limit, struct ln_rst_time *rst); 82 * \brief Calculate the time of next rise, set and transit for an object a body, usually Sun, a planet or Moon. 83 * E.g. it's sure, that rise, set and transit will be in <JD, JD+day_limit> range. 84 * \ingroup rst 85 */ 86 int LIBNOVA_EXPORT ln_get_body_next_rst_horizon_future (double JD, struct ln_lnlat_posn * observer, void (*get_equ_body_coords) (double, struct ln_equ_posn *), double horizon, int day_limit, struct ln_rst_time * rst); 87 88 typedef void (*get_motion_body_coords_t) (double, void * orbit, struct ln_equ_posn *); 89 90 /*! \fn int ln_get_motion_body_rst_horizon (double JD, struct ln_lnlat_posn * observer, get_motion_body_coords_t get_motion_body_coords, double horizon, struct ln_rst_time *rst); 91 * \brief Calculate the time of rise, set and transit for an object a body on elliptic, parabolic or hyperbolic orbit. 92 * \ingroup rst 93 */ 94 int LIBNOVA_EXPORT ln_get_motion_body_rst_horizon (double JD, struct ln_lnlat_posn * observer, get_motion_body_coords_t get_motion_body_coords, void * orbit, double horizon, struct ln_rst_time * rst); 95 96 /*! \fn int ln_get_motion_body_next_rst_horizon (double JD, struct ln_lnlat_posn * observer, get_motion_body_coords_t get_motion_body_coords, double horizon, struct ln_rst_time *rst); 97 * \brief Calculate the time of next rise, set and transit for an object a body on elliptic, parabolic or hyperbolic orbit. 98 * E.g. it's sure, that rise, set and transit will be in <JD, JD+1> range. 99 * \ingroup rst 100 */ 101 int LIBNOVA_EXPORT ln_get_motion_body_next_rst_horizon (double JD, struct ln_lnlat_posn * observer, get_motion_body_coords_t get_motion_body_coords, void * orbit, double horizon, struct ln_rst_time * rst); 102 103 /*! \fn int ln_get_motion_body_next_rst_horizon_future (double JD, struct ln_lnlat_posn * observer, get_motion_body_coords_t get_motion_body_coords, double horizon, int day_limit, struct ln_rst_time *rst); 104 * \brief Calculate the time of next rise, set and transit for an object a body on elliptic, parabolic or hyperbolic orbit. 105 * E.g. it's sure, that rise, set and transit will be in <JD, JD+day_limit> range. 106 * \ingroup rst 107 */ 108 int LIBNOVA_EXPORT ln_get_motion_body_next_rst_horizon_future (double JD, struct ln_lnlat_posn * observer, get_motion_body_coords_t get_motion_body_coords, void * orbit, double horizon, int day_limit, struct ln_rst_time * rst); 109 110 #ifdef __cplusplus 111 }; 112 #endif 113 114 #endif 115