libnova  v 0.16.0
ln_types.h
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_TYPES_H
20 #define _LN_TYPES_H
21 
22 #if !defined(__WIN32__) && (defined(__WIN32) || defined(WIN32))
23 #define __WIN32__
24 #define ALIGN32
25 #else
26 #define ALIGN32 __attribute__((aligned(32)))
27 #endif
28 
29 /* add a specific macro for mingw */
30 #if defined(__MINGW32__) || defined(__MINGW64__)
31 #define __MINGW__
32 #endif
33 
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 #if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) || defined( __BCPLUSPLUS__) || defined( __MWERKS__)
40 # if defined( LIBNOVA_STATIC )
41 # define LIBNOVA_EXPORT
42 # elif defined( LIBNOVA_SHARED )
43 # define LIBNOVA_EXPORT __declspec(dllexport)
44 # else
45 # define LIBNOVA_EXPORT
46 # endif
47 #else
48 # define LIBNOVA_EXPORT
49 #endif
50 
51 /* define some useful constants if they are not already defined */
52 #if(!defined(M_PI_2) && (!defined(_MSC_VER) || !defined(_USE_MATH_DEFINES)))
53 #define M_PI_2 1.5707963267948966192313216916398
54 #define M_PI_4 0.78539816339744830961566084581988
55 #define M_PI 3.1415926535897932384626433832795
56 #endif
57 
58 /* sidereal day length in seconds and days (for JD)*/
59 #define LN_SIDEREAL_DAY_SEC 86164.09
60 #define LN_SIDEREAL_DAY_DAY (LN_SIDEREAL_DAY_SEC / 86400.0)
61 
62 /* 1.1.2000 Julian Day & others */
63 #define JD2000 2451545.0
64 #define JD2050 2469807.50
65 
66 #define B1900 2415020.3135
67 #define B1950 2433282.4235
68 
79 struct ln_date {
80  int years;
81  int months;
82  int days;
83  int hours;
84  int minutes;
85  double seconds;
86 };
87 
98 struct ln_zonedate {
99  int years;
100  int months;
101  int days;
102  int hours;
103  int minutes;
104  double seconds;
105  long gmtoff;
106 };
107 
114 struct ln_dms {
115  unsigned short neg;
116  unsigned short degrees;
117  unsigned short minutes;
118  double seconds;
119 };
120 
127 struct ln_hms {
128  unsigned short hours;
129  unsigned short minutes;
130  double seconds;
131 };
132 
139 struct lnh_equ_posn {
140  struct ln_hms ra;
141  struct ln_dms dec;
142 };
143 
150 struct lnh_hrz_posn {
151  struct ln_dms az;
152  struct ln_dms alt;
153 };
154 
155 
163  struct ln_dms lng;
164  struct ln_dms lat;
165 };
166 
167 
176 struct ln_equ_posn {
177  double ra;
178  double dec;
179 };
180 
189 struct ln_hrz_posn {
190  double az;
192  double alt;
193 };
194 
195 
205  double lng;
206  double lat;
207 };
208 
209 
220  double L;
221  double B;
222  double R;
223 };
224 
239 struct ln_rect_posn {
240  double X;
241  double Y;
242  double Z;
243 };
244 
253 struct ln_gal_posn {
254  double l;
255  double b;
256 };
257 
265 struct ln_ell_orbit {
266  double a;
267  double e;
268  double i;
269  double w;
270  double omega;
271  double n;
272  double JD;
273 };
274 
282 struct ln_par_orbit {
283  double q;
284  double i;
285  double w;
286  double omega;
287  double JD;
288 };
289 
297 struct ln_hyp_orbit {
298  double q;
299  double e;
300  double i;
301  double w;
302  double omega;
303  double JD;
304 };
305 
314 struct ln_rst_time {
315  double rise;
316  double set;
317  double transit;
318 };
319 
328 struct ln_nutation {
329  double longitude;
330  double obliquity;
331  double ecliptic;
332 };
333 
334 #if defined(__WIN32__) && !defined(__MINGW__)
335 
336 #include <time.h>
337 
338 struct timeval
339 {
340  time_t tv_sec; /* count of seconds since Jan. 1, 1970 */
341  long tv_usec; /* and microseconds */
342 };
343 
344 struct timezone
345 {
346  int tz_minuteswest; /* Minutes west of GMT */
347  int tz_dsttime; /* DST correction offset */
348 };
349 
350 #endif /* __WIN32__ */
351 
352 #ifdef __cplusplus
353 };
354 #endif
355 
356 #endif
357 
Nutation in longitude, ecliptic and obliquity.
Definition: ln_types.h:328
double JD
Definition: ln_types.h:272
int minutes
Definition: ln_types.h:103
double i
Definition: ln_types.h:300
int months
Definition: ln_types.h:100
double dec
Definition: ln_types.h:178
Elliptic Orbital elements.
Definition: ln_types.h:265
struct ln_dms dec
Definition: ln_types.h:141
double seconds
Definition: ln_types.h:104
double JD
Definition: ln_types.h:303
double n
Definition: ln_types.h:271
double X
Definition: ln_types.h:240
double l
Definition: ln_types.h:254
struct ln_dms az
Definition: ln_types.h:151
Rectangular coordinates.
Definition: ln_types.h:239
double L
Definition: ln_types.h:220
double q
Definition: ln_types.h:298
double e
Definition: ln_types.h:267
unsigned short hours
Definition: ln_types.h:128
double rise
Definition: ln_types.h:315
Human readable Date and time with timezone information used by libnova.
Definition: ln_types.h:98
Horizontal Coordinates.
Definition: ln_types.h:189
struct ln_dms lng
Definition: ln_types.h:163
double ecliptic
Definition: ln_types.h:331
double Z
Definition: ln_types.h:242
Degrees, minutes and seconds.
Definition: ln_types.h:114
Hours, minutes and seconds.
Definition: ln_types.h:127
double seconds
Definition: ln_types.h:85
int months
Definition: ln_types.h:81
double B
Definition: ln_types.h:221
double lat
Definition: ln_types.h:206
struct ln_dms lat
Definition: ln_types.h:164
double R
Definition: ln_types.h:222
double q
Definition: ln_types.h:283
Equatorial Coordinates.
Definition: ln_types.h:176
double w
Definition: ln_types.h:301
double seconds
Definition: ln_types.h:118
struct ln_dms alt
Definition: ln_types.h:152
Hyperbolic Orbital elements.
Definition: ln_types.h:297
double alt
Definition: ln_types.h:192
int days
Definition: ln_types.h:101
unsigned short neg
Definition: ln_types.h:115
double Y
Definition: ln_types.h:241
double longitude
Definition: ln_types.h:329
Ecliptical (or celestial) Longitude and Latitude.
Definition: ln_types.h:204
double w
Definition: ln_types.h:269
Parabolic Orbital elements.
Definition: ln_types.h:282
double obliquity
Definition: ln_types.h:330
Human readable Date and time used by libnova.
Definition: ln_types.h:79
Rise, Set and Transit times.
Definition: ln_types.h:314
double i
Definition: ln_types.h:268
int minutes
Definition: ln_types.h:84
int hours
Definition: ln_types.h:83
double omega
Definition: ln_types.h:286
struct ln_hms ra
Definition: ln_types.h:140
Heliocentric position.
Definition: ln_types.h:219
double set
Definition: ln_types.h:316
double e
Definition: ln_types.h:299
Right Ascension and Declination.
Definition: ln_types.h:139
double seconds
Definition: ln_types.h:130
int days
Definition: ln_types.h:82
int years
Definition: ln_types.h:99
unsigned short degrees
Definition: ln_types.h:116
double az
Definition: ln_types.h:190
long gmtoff
Definition: ln_types.h:105
int hours
Definition: ln_types.h:102
double JD
Definition: ln_types.h:287
double ra
Definition: ln_types.h:177
Ecliptical (or celestial) Latitude and Longitude.
Definition: ln_types.h:162
double transit
Definition: ln_types.h:317
double lng
Definition: ln_types.h:205
unsigned short minutes
Definition: ln_types.h:129
double i
Definition: ln_types.h:284
Galactic coordinates.
Definition: ln_types.h:253
Azimuth and Altitude.
Definition: ln_types.h:150
unsigned short minutes
Definition: ln_types.h:117
double b
Definition: ln_types.h:255
int years
Definition: ln_types.h:80
double w
Definition: ln_types.h:285
double omega
Definition: ln_types.h:302
double omega
Definition: ln_types.h:270
double a
Definition: ln_types.h:266