libnova.h   libnova.h 
skipping to change at line 15 skipping to change at line 15
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Copyright (C) 2000 Liam Girdwood <liam@nova-ioe.org> Copyright (C) 2000 Liam Girdwood <liam@gnova.org>
*/ */
/*! \mainpage libnova /*! \mainpage libnova
* Celestial Mechanics and Astronomical Calculation Library * Celestial Mechanics and Astronomical Calculation Library
* *
* \section intro Introduction * \section intro Introduction
* libnova is a general purpose, double precision, celestial mechanics and a stronomical calculation library. * libnova is a general purpose, double precision, celestial mechanics and a stronomical calculation library.
* *
* The intended audience of libnova is C / C++ programmers, astronomers and anyone else interested in calculating positions of astronomical objects or celestial mechanics. * The intended audience of libnova is C / C++ programmers, astronomers and anyone else interested in calculating positions of astronomical objects or celestial mechanics.
* libnova is the calculation engine used by the <A href="http://nova.sf.net ">Nova</A> project and most importantly, is free software. * libnova is the calculation engine used by the <A href="http://nova.sf.net ">Nova</A> project and most importantly, is free software.
skipping to change at line 40 skipping to change at line 40
* - Aberration * - Aberration
* - Nutation * - Nutation
* - Apparent Position * - Apparent Position
* - Dynamical Time * - Dynamical Time
* - Julian Day * - Julian Day
* - Precession * - Precession
* - Proper Motion * - Proper Motion
* - Sidereal Time * - Sidereal Time
* - Solar Coordinates (using VSOP87) * - Solar Coordinates (using VSOP87)
* - Coordinate Transformations * - Coordinate Transformations
* - Planetary Positions (Mercury - Neptune using VSOP87) * - Planetary Positions Mercury - Pluto (Mercury - Neptune using VSOP87)
* - Planetary Magnitude, illuminated disk and phase angle. * - Planetary Magnitude, illuminated disk and phase angle.
* - Lunar Position (using ELP82), phase angle. * - Lunar Position (using ELP82), phase angle.
* - Elliptic Motion of bodies (Asteroid + Comet positional and orbit data) * - Elliptic Motion of bodies (Asteroid + Comet positional and orbit data)
* - Asteroid + Comet magnitudes * - Asteroid + Comet magnitudes
* - Parabolic Motion of bodies (Comet positional data) * - Parabolic Motion of bodies (Comet positional data)
* - Orbit velocities and lengths * - Orbit velocities and lengths
* - Atmospheric refraction * - Atmospheric refraction
* - Rise, Set and Transit times. * - Rise, Set and Transit times.
* - Semidiameters of the Sun, Moon, Planets and asteroids. * - Semidiameters of the Sun, Moon, Planets and asteroids.
* - Angular separation of bodies
* *
* \section docs Documentation * \section docs Documentation
* API documentation for libnova is included in the source. It can also be f ound in this website and an offline tarball is available <A href="http://li bnova.sf.net/libnovadocs.tar.gz">here</A>. * API documentation for libnova is included in the source. It can also be f ound in this website and an offline tarball is available <A href="http://li bnova.sf.net/libnovadocs.tar.gz">here</A>.
* *
* \section download Download * \section download Download
* The latest released version of libnova is 0.8.0 and was released on the 2 8th July 2003. * The latest released version of libnova is 0.9.0 and was released on the 2 5th Jan 2004.
* It is available for download <A href="http://sf.net/project/showfiles.php ?group_id=57697">here.</A> * It is available for download <A href="http://sf.net/project/showfiles.php ?group_id=57697">here.</A>
* *
* \section cvs CVS * \section cvs CVS
* The latest CVS version of libnova is available via CVS <A href="http://sf .net/cvs/?group_id=57697">here.</A> * The latest CVS version of libnova is available via CVS <A href="http://sf .net/cvs/?group_id=57697">here.</A>
* *
* \section licence Licence * \section licence Licence
* libnova is released under the <A href="http://www.gnu.org">GNU</A> LGPL. * libnova is released under the <A href="http://www.gnu.org">GNU</A> LGPL.
* *
* \section help Help * \section help Help
* If you are interested in helping in the future development of libnova, th en please get in touch. * If you are interested in helping in the future development of libnova, th en please get in touch.
* Currently, we are needing help in the folowing areas. * Currently, we are needing help in the folowing areas.
* - Documentation. (Not just API reference, but also astronomy info for nov ice users) * - Documentation. (Not just API reference, but also astronomy info for nov ice users)
* - Programming (in C) astronomical solutions or algorithms. * - Programming (in C) astronomical solutions or algorithms.
* - Algorithms and Solutions. * - Algorithms and Solutions.
* - Website and logo. * - Website and logo.
* *
* \section contact Contact * \section contact Contact
* If you would like further information, then please contact me <A href="ma ilto:liam@nova-ioe.org">here</A> * If you would like further information, then please contact me <A href="ma ilto:liam@gnova.org">here</A>
* *
* Liam Girdwood * Liam Girdwood
* *
* \section thanks Thanks * \section thanks Thanks
* Thanks to Jean Meeus for most of the algorithms used in this library. * Thanks to Jean Meeus for most of the algorithms used in this library.
* From his book "Astronomical Algorithms". * From his book "Astronomical Algorithms".
* *
* Thanks to Michelle Chapront-Touze and Jean Chapront for publishing * Thanks to Michelle Chapront-Touze and Jean Chapront for publishing
* the Lunar Solution ELP 2000-82B. * the Lunar Solution ELP 2000-82B.
* *
skipping to change at line 99 skipping to change at line 100
#ifndef LN_LIBNOVA_H #ifndef LN_LIBNOVA_H
#define LN_LIBNOVA_H #define LN_LIBNOVA_H
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include <time.h> #include <time.h>
/* define some usefull constants if they are not already defined */
#ifndef M_PI_2
#define M_PI_2 1.5707963267948966192313216916398
#define M_PI_4 0.78539816339744830961566084581988
#define M_PI 3.1415926535897932384626433832795
#endif
/*! /*!
** Date ** Date
* \struct ln_date * \struct ln_date
* \brief Human readable Date and time used by libnova * \brief Human readable Date and time used by libnova
* *
* This is the Human readable (easy printf) date format used * This is the Human readable (easy printf) date format used
* by libnova. * by libnova.
*/ */
struct ln_date struct ln_date
skipping to change at line 177 skipping to change at line 185
}; };
/*! \struct lnh_lnlat_posn /*! \struct lnh_lnlat_posn
** \brief Ecliptical (or celestial) Latitude and Longitude. ** \brief Ecliptical (or celestial) Latitude and Longitude.
* *
* Human readable Ecliptical (or celestial) Longitude and Latitude. * Human readable Ecliptical (or celestial) Longitude and Latitude.
*/ */
struct lnh_lnlat_posn struct lnh_lnlat_posn
{ {
struct ln_dms lng; /*!< longitude. Object longitude.<p> struct ln_dms lng; /*!< longitude. Object longitude.*/
NOTE: IAU changed from positive west to negative west longit
ude
in 1982, however we will currently use the older convention of:-
Negative East of Greenwich,
Positive West of Greenwich */
struct ln_dms lat; /*!< latitude. Object latitude */ struct ln_dms lat; /*!< latitude. Object latitude */
}; };
/*! \struct ln_equ_posn /*! \struct ln_equ_posn
** \brief Equatorial Coordinates. ** \brief Equatorial Coordinates.
* *
* The Right Ascension and Declination of an object. * The Right Ascension and Declination of an object.
* *
* Angles are expressed in degrees. * Angles are expressed in degrees.
*/ */
skipping to change at line 224 skipping to change at line 228
/*! \struct ln_lnlat_posn /*! \struct ln_lnlat_posn
** \brief Ecliptical (or celestial) Longitude and Latitude. ** \brief Ecliptical (or celestial) Longitude and Latitude.
* *
* The Ecliptical (or celestial) Latitude and Longitude of and object. * The Ecliptical (or celestial) Latitude and Longitude of and object.
* *
* Angles are expressed in degrees. * Angles are expressed in degrees.
*/ */
struct ln_lnlat_posn struct ln_lnlat_posn
{ {
double lng; /*!< longitude. Object longitude. <p> double lng; /*!< longitude. Object longitude. */
NOTE: IAU changed from positive west to negative west longitude
in 1982, however we will currently use the older convention of:-
Negative East of Greenwich,
Positive West of Greenwich */
double lat; /*!< latitude. Object latitude */ double lat; /*!< latitude. Object latitude */
}; };
/*! \struct ln_helio_posn /*! \struct ln_helio_posn
* \brief Heliocentric position * \brief Heliocentric position
* *
* A heliocentric position is an objects position relative to the * A heliocentric position is an objects position relative to the
* centre of the Sun. * centre of the Sun.
* *
* Angles are expressed in degrees. * Angles are expressed in degrees.
skipping to change at line 284 skipping to change at line 284
* Angles are expressed in degrees. * Angles are expressed in degrees.
*/ */
struct ln_ell_orbit struct ln_ell_orbit
{ {
double a; /*!< Semi major axis, in AU */ double a; /*!< Semi major axis, in AU */
double e; /*!< Eccentricity */ double e; /*!< Eccentricity */
double i; /*!< Inclination in degrees */ double i; /*!< Inclination in degrees */
double w; /*!< Argument of perihelion in degrees */ double w; /*!< Argument of perihelion in degrees */
double omega; /*!< Longitude of ascending node in degrees*/ double omega; /*!< Longitude of ascending node in degrees*/
double n; /*!< Mean motion, in degrees/day */ double n; /*!< Mean motion, in degrees/day */
double JD; /*!< Epoch of orbital elements, in julian day */ double JD; /*!< Time of last passage in Perihelion, in julian d ay*/
}; };
/*! /*!
* \struct ln_par_orbit * \struct ln_par_orbit
* \brief Parabolic Orbital elements * \brief Parabolic Orbital elements
* *
* TODO. * TODO.
* Angles are expressed in degrees. * Angles are expressed in degrees.
*/ */
struct ln_par_orbit struct ln_par_orbit
{ {
double q; /*!< Perihelion distance in AU */ double q; /*!< Perihelion distance in AU */
double i; /*!< Inclination in degrees */ double i; /*!< Inclination in degrees */
double w; /*!< Argument of perihelion in degrees */ double w; /*!< Argument of perihelion in degrees */
double omega; /*!< Longitude of ascending node in degrees*/ double omega; /*!< Longitude of ascending node in degrees*/
double JD; /*!< Time of passage in Perihelion, in julian day */ double JD; /*!< Time of last passage in Perihelion, in julian d ay */
}; };
/*! /*!
* \struct ln_rst_time * \struct ln_rst_time
* \brief Rise, Set and Transit times. * \brief Rise, Set and Transit times.
* *
* Contains the Rise, Set and transit times for a body. * Contains the Rise, Set and transit times for a body.
* *
* Angles are expressed in degrees. * Angles are expressed in degrees.
*/ */
skipping to change at line 399 skipping to change at line 399
* \ingroup calendar * \ingroup calendar
*/ */
void get_timet_from_julian (double JD, time_t * in_time); void get_timet_from_julian (double JD, time_t * in_time);
/*! \fn double get_julian_local_date(struct ln_date* date) /*! \fn double get_julian_local_date(struct ln_date* date)
* \brief Calculate Julian day from local date * \brief Calculate Julian day from local date
* \ingroup calendar * \ingroup calendar
*/ */
double get_julian_local_date(struct ln_date* date); double get_julian_local_date(struct ln_date* date);
/*! \fn int get_date_from_mpc (struct ln_date* date, char* mpc_date)
* \brief Calculate the local date from the a MPC packed date.
* \ingroup calendar
*/
int get_date_from_mpc (struct ln_date* date, char* mpc_date);
/*! \fn double get_julian_from_mpc (char* mpc_date)
* \brief Calculate the julian day from the a MPC packed date.
* \ingroup calendar
*/
double get_julian_from_mpc (char* mpc_date);
/*! \defgroup misc Misc Functions /*! \defgroup misc Misc Functions
*/ */
/*! \fn double get_dec_location(char * s) /*! \fn double get_dec_location(char * s)
* \ingroup misc * \ingroup misc
* \brief Obtains Latitude, Longitude, RA or Declination from a string. * \brief Obtains Latitude, Longitude, RA or Declination from a string.
*/ */
double get_dec_location(char *s); double get_dec_location(char *s);
/*! \fn char * get_humanr_location(double location) /*! \fn char * get_humanr_location(double location)
skipping to change at line 471 skipping to change at line 483
/*! \defgroup conversion General Conversion Functions /*! \defgroup conversion General Conversion Functions
* *
* Conversion from one libnova type to another. * Conversion from one libnova type to another.
*/ */
/*! \fn double rad_to_deg (double radians) /*! \fn double rad_to_deg (double radians)
* \brief radians to degrees * \brief radians to degrees
* \ingroup conversion * \ingroup conversion
*/ */
inline double rad_to_deg (double radians); double rad_to_deg (double radians);
/*! \fn double deg_to_rad (double radians) /*! \fn double deg_to_rad (double radians)
* \brief degrees to radians * \brief degrees to radians
* \ingroup conversion * \ingroup conversion
*/ */
inline double deg_to_rad (double degrees); double deg_to_rad (double degrees);
/*! \fn double hms_to_deg (struct ln_hms * hms) /*! \fn double hms_to_deg (struct ln_hms * hms)
* \brief hours to degrees * \brief hours to degrees
* \ingroup conversion * \ingroup conversion
*/ */
double hms_to_deg (struct ln_hms * hms); double hms_to_deg (struct ln_hms * hms);
/*! \fn void deg_to_hms (double degrees, struct ln_hms * hms) /*! \fn void deg_to_hms (double degrees, struct ln_hms * hms)
* \brief degrees to hours * \brief degrees to hours
* \ingroup conversion * \ingroup conversion
skipping to change at line 658 skipping to change at line 670
* \brief Calculate equatorial coordinates from horizontal coordinates * \brief Calculate equatorial coordinates from horizontal coordinates
* \ingroup transform * \ingroup transform
*/ */
/* Pg 89 */ /* Pg 89 */
void get_equ_from_hrz void get_equ_from_hrz
(struct ln_hrz_posn *object, (struct ln_hrz_posn *object,
struct ln_lnlat_posn * observer, struct ln_lnlat_posn * observer,
double JD, double JD,
struct ln_equ_posn * position); struct ln_equ_posn * position);
/*! \fn void get_rect_from_helio (struct ln_helio_posn *object, double JD, struct ln_rect_posn * position); /*! \fn void get_rect_from_helio (struct ln_helio_posn *object, struct ln_r ect_posn * position);
* \brief Calculate geocentric coordinates from heliocentric coordinates * \brief Calculate geocentric coordinates from heliocentric coordinates
* \ingroup transform * \ingroup transform
*/ */
/* Pg ?? */ /* Pg ?? */
void get_rect_from_helio void get_rect_from_helio
(struct ln_helio_posn *object, (struct ln_helio_posn *object,
double JD,
struct ln_rect_posn * position); struct ln_rect_posn * position);
/*! \fn void get_ecl_from_rect (struct ln_rect_posn * rect, struct ln_lnlat _posn * posn) /*! \fn void get_ecl_from_rect (struct ln_rect_posn * rect, struct ln_lnlat _posn * posn)
* \ingroup transform * \ingroup transform
* Transform an objects rectangular coordinates into ecliptical coordinates. * Transform an objects rectangular coordinates into ecliptical coordinates.
*/ */
/* Equ 33.2 /* Equ 33.2
*/ */
void get_ecl_from_rect (struct ln_rect_posn * rect, struct ln_lnlat_posn * posn); void get_ecl_from_rect (struct ln_rect_posn * rect, struct ln_lnlat_posn * posn);
skipping to change at line 832 skipping to change at line 843
/*! \fn double get_solar_rst (double JD, struct ln_lnlat_posn * observer, s truct ln_rst_time * rst); /*! \fn double get_solar_rst (double JD, struct ln_lnlat_posn * observer, s truct ln_rst_time * rst);
* \brief Calculate the time of rise, set and transit for the Sun. * \brief Calculate the time of rise, set and transit for the Sun.
* \ingroup solar * \ingroup solar
*/ */
int get_solar_rst_horizont (double JD, struct ln_lnlat_posn * observer, dou ble horizont, struct ln_rst_time * rst); int get_solar_rst_horizont (double JD, struct ln_lnlat_posn * observer, dou ble horizont, struct ln_rst_time * rst);
/*! \fn double get_solar_rst (double JD, struct ln_lnlat_posn * observer, s truct ln_rst_time * rst); /*! \fn double get_solar_rst (double JD, struct ln_lnlat_posn * observer, s truct ln_rst_time * rst);
* \brief Calculate the time of rise, set and transit for the Sun. * \brief Calculate the time of rise, set and transit for the Sun.
* \ingroup solar * \ingroup solar
*/ */
inline int get_solar_rst (double JD, struct ln_lnlat_posn * observer, struc t ln_rst_time * rst); int get_solar_rst (double JD, struct ln_lnlat_posn * observer, struct ln_rs t_time * rst);
/*! \fn void get_geom_solar_coords (double JD, struct ln_helio_posn * posit ion); /*! \fn void get_geom_solar_coords (double JD, struct ln_helio_posn * posit ion);
* \brief Calculate solar geometric coordinates. * \brief Calculate solar geometric coordinates.
* \ingroup solar * \ingroup solar
*/ */
void get_geom_solar_coords void get_geom_solar_coords
(double JD, (double JD,
struct ln_helio_posn * position); struct ln_helio_posn * position);
/*! \fn void get_equ_solar_coords (double JD, struct ln_equ_posn * position ); /*! \fn void get_equ_solar_coords (double JD, struct ln_equ_posn * position );
skipping to change at line 1773 skipping to change at line 1784
* \ingroup elliptic * \ingroup elliptic
*/ */
void get_ell_body_equ_coords (double JD, struct ln_ell_orbit * orbit, struc t ln_equ_posn * posn); void get_ell_body_equ_coords (double JD, struct ln_ell_orbit * orbit, struc t ln_equ_posn * posn);
/*! \fn double get_ell_body_rst (double JD, struct ln_lnlat_posn * observer , struct ln_ell_orbit * orbit, struct ln_rst_time * rst); /*! \fn double get_ell_body_rst (double JD, struct ln_lnlat_posn * observer , struct ln_ell_orbit * orbit, struct ln_rst_time * rst);
* \brief Calculate the time of rise, set and transit for a body with an ell iptic orbit. * \brief Calculate the time of rise, set and transit for a body with an ell iptic orbit.
* \ingroup elliptic * \ingroup elliptic
*/ */
int get_ell_body_rst (double JD, struct ln_lnlat_posn * observer, struct ln _ell_orbit * orbit, struct ln_rst_time * rst); int get_ell_body_rst (double JD, struct ln_lnlat_posn * observer, struct ln _ell_orbit * orbit, struct ln_rst_time * rst);
/*!\fn double get_ell_last_perihelion (double epoch_JD, double M, double n)
;
* \brief Calculate the julian day of the last perihelion.
* \ingroup elliptic
*/
double get_ell_last_perihelion (double epoch_JD, double M, double n);
/*! \defgroup parabolic Parabolic Motion /*! \defgroup parabolic Parabolic Motion
* *
* Functions relating to the Parabolic motion of bodies. * Functions relating to the Parabolic motion of bodies.
* *
* All angles are expressed in degrees. * All angles are expressed in degrees.
*/ */
/*! \fn double solve_barker (double q, double t); /*! \fn double solve_barker (double q, double t);
* \brief Solve Barkers equation. * \brief Solve Barkers equation.
* \ingroup parabolic * \ingroup parabolic
skipping to change at line 1947 skipping to change at line 1964
* E.g. it's sure, that rise, set and transit will be in <JD, JD+1> range. * E.g. it's sure, that rise, set and transit will be in <JD, JD+1> range.
* \ingroup rst * \ingroup rst
*/ */
int get_object_next_rst (double JD, struct ln_lnlat_posn * observer, struct ln_equ_posn * object, struct ln_rst_time * rst); int get_object_next_rst (double JD, struct ln_lnlat_posn * observer, struct ln_equ_posn * object, struct ln_rst_time * rst);
#define STAR_STANDART_HORIZONT -0.5667 #define STAR_STANDART_HORIZONT -0.5667
int get_body_rst_horizont (double JD, struct ln_lnlat_posn * observer, void (*get_equ_body_coords) (double, struct ln_equ_posn *), int get_body_rst_horizont (double JD, struct ln_lnlat_posn * observer, void (*get_equ_body_coords) (double, struct ln_equ_posn *),
double horizont, struct ln_rst_time * rst); double horizont, struct ln_rst_time * rst);
/*! \defgroup angular Angular Separation
*
* Functions relating to an the angular separation and position
* angle between 2 bodies.
*
* All angles are expressed in degrees.
*/
/*! \fn double get_angular_separation (struct ln_equ_posn* posn1, struct ln
_equ_posn* posn2);
* \brief Calculate the angular separation between 2 bodies
* \ingroup angular
*/
double get_angular_separation (struct ln_equ_posn* posn1, struct ln_equ_pos
n* posn2);
/*! \fn double get_rel_posn_angle (struct ln_equ_posn* posn1, struct ln_equ
_posn* posn2);
* \brief Calculate the position angle between 2 bodies
* \ingroup angular
*/
double get_rel_posn_angle (struct ln_equ_posn* posn1, struct ln_equ_posn* p
osn2);
#ifdef __cplusplus #ifdef __cplusplus
}; };
#endif #endif
#endif #endif
 End of changes. 18 change blocks. 
22 lines changed or deleted 63 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/