|
libnova
v 0.15.0
|
00001 /* 00002 * This library is free software; you can redistribute it and/or 00003 * modify it under the terms of the GNU Lesser General Public 00004 * License as published by the Free Software Foundation; either 00005 * version 2 of the License, or (at your option) any later version. 00006 * 00007 * This library is distributed in the hope that it will be useful, 00008 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00009 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00010 * Lesser General Public License for more details. 00011 * 00012 * You should have received a copy of the GNU General Public License 00013 * along with this program; if not, write to the Free Software 00014 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00015 * 00016 * Copyright (C) 2000 - 2005 Liam Girdwood 00017 */ 00018 00019 #ifndef _LN_TYPES_H 00020 #define _LN_TYPES_H 00021 00022 #ifdef __cplusplus 00023 extern "C" { 00024 #endif 00025 00026 #if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) || defined( __BCPLUSPLUS__) || defined( __MWERKS__) 00027 # if defined( LIBNOVA_STATIC ) 00028 # define LIBNOVA_EXPORT 00029 # elif defined( LIBNOVA_SHARED ) 00030 # define LIBNOVA_EXPORT __declspec(dllexport) 00031 # else 00032 # define LIBNOVA_EXPORT 00033 # endif 00034 #else 00035 # define LIBNOVA_EXPORT 00036 #endif 00037 00038 /* define some useful constants if they are not already defined */ 00039 #if(!defined(M_PI_2) && (!defined(_MSC_VER) || !defined(_USE_MATH_DEFINES))) 00040 #define M_PI_2 1.5707963267948966192313216916398 00041 #define M_PI_4 0.78539816339744830961566084581988 00042 #define M_PI 3.1415926535897932384626433832795 00043 #endif 00044 00045 /* sideral day length in seconds and days (for JD)*/ 00046 #define LN_SIDEREAL_DAY_SEC 86164.09 00047 #define LN_SIDEREAL_DAY_DAY LN_SIDEREAL_DAY_SEC/86400 00048 00049 /* 1.1.2000 Julian Day & others */ 00050 #define JD2000 2451545.0 00051 #define JD2050 2469807.50 00052 00053 #define B1900 2415020.3135 00054 #define B1950 2433282.4235 00055 00066 struct ln_date 00067 { 00068 int years; 00069 int months; 00070 int days; 00071 int hours; 00072 int minutes; 00073 double seconds; 00074 }; 00075 00086 struct ln_zonedate 00087 { 00088 int years; 00089 int months; 00090 int days; 00091 int hours; 00092 int minutes; 00093 double seconds; 00094 long gmtoff; 00095 }; 00096 00103 struct ln_dms 00104 { 00105 unsigned short neg; 00106 unsigned short degrees; 00107 unsigned short minutes; 00108 double seconds; 00109 }; 00110 00117 struct ln_hms 00118 { 00119 unsigned short hours; 00120 unsigned short minutes; 00121 double seconds; 00122 }; 00123 00130 struct lnh_equ_posn 00131 { 00132 struct ln_hms ra; 00133 struct ln_dms dec; 00134 }; 00135 00142 struct lnh_hrz_posn 00143 { 00144 struct ln_dms az; 00145 struct ln_dms alt; 00146 }; 00147 00148 00155 struct lnh_lnlat_posn 00156 { 00157 struct ln_dms lng; 00158 struct ln_dms lat; 00159 }; 00160 00161 00170 struct ln_equ_posn 00171 { 00172 double ra; 00173 double dec; 00174 }; 00175 00184 struct ln_hrz_posn 00185 { 00186 double az; 00188 double alt; 00189 }; 00190 00191 00200 struct ln_lnlat_posn 00201 { 00202 double lng; 00203 double lat; 00204 }; 00205 00206 00216 struct ln_helio_posn 00217 { 00218 double L; 00219 double B; 00220 double R; 00221 }; 00222 00237 struct ln_rect_posn 00238 { 00239 double X; 00240 double Y; 00241 double Z; 00242 }; 00243 00252 struct ln_gal_posn 00253 { 00254 double l; 00255 double b; 00256 }; 00257 00265 struct ln_ell_orbit 00266 { 00267 double a; 00268 double e; 00269 double i; 00270 double w; 00271 double omega; 00272 double n; 00273 double JD; 00274 }; 00275 00283 struct ln_par_orbit 00284 { 00285 double q; 00286 double i; 00287 double w; 00288 double omega; 00289 double JD; 00290 }; 00291 00299 struct ln_hyp_orbit 00300 { 00301 double q; 00302 double e; 00303 double i; 00304 double w; 00305 double omega; 00306 double JD; 00307 }; 00308 00317 struct ln_rst_time 00318 { 00319 double rise; 00320 double set; 00321 double transit; 00322 }; 00323 00332 struct ln_nutation 00333 { 00334 double longitude; 00335 double obliquity; 00336 double ecliptic; 00337 }; 00338 00339 /* Definitions of POSIX structures for Win32. */ 00340 #ifdef __WIN32__ 00341 00342 #include <time.h> 00343 00344 struct timeval 00345 { 00346 time_t tv_sec; /* count of seconds since Jan. 1, 1970 */ 00347 long tv_usec; /* and microseconds */ 00348 }; 00349 00350 struct timezone 00351 { 00352 int tz_minuteswest; /* Minutes west of GMT */ 00353 int tz_dsttime; /* DST correction offset */ 00354 }; 00355 00356 #endif /* __WIN32__ */ 00357 00358 #ifdef __cplusplus 00359 }; 00360 #endif 00361 00362 #endif 00363
1.7.5.1