libnova  v 0.15.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 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 #if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) || defined( __BCPLUSPLUS__) || defined( __MWERKS__)
27 # if defined( LIBNOVA_STATIC )
28 # define LIBNOVA_EXPORT
29 # elif defined( LIBNOVA_SHARED )
30 # define LIBNOVA_EXPORT __declspec(dllexport)
31 # else
32 # define LIBNOVA_EXPORT
33 # endif
34 #else
35 # define LIBNOVA_EXPORT
36 #endif
37 
38 /* define some useful constants if they are not already defined */
39 #if(!defined(M_PI_2) && (!defined(_MSC_VER) || !defined(_USE_MATH_DEFINES)))
40 #define M_PI_2 1.5707963267948966192313216916398
41 #define M_PI_4 0.78539816339744830961566084581988
42 #define M_PI 3.1415926535897932384626433832795
43 #endif
44 
45 /* sideral day length in seconds and days (for JD)*/
46 #define LN_SIDEREAL_DAY_SEC 86164.09
47 #define LN_SIDEREAL_DAY_DAY LN_SIDEREAL_DAY_SEC/86400
48 
49 /* 1.1.2000 Julian Day & others */
50 #define JD2000 2451545.0
51 #define JD2050 2469807.50
52 
53 #define B1900 2415020.3135
54 #define B1950 2433282.4235
55 
66 struct ln_date
67 {
68  int years;
69  int months;
70  int days;
71  int hours;
72  int minutes;
73  double seconds;
74 };
75 
87 {
88  int years;
89  int months;
90  int days;
91  int hours;
92  int minutes;
93  double seconds;
94  long gmtoff;
95 };
96 
103 struct ln_dms
104 {
105  unsigned short neg;
106  unsigned short degrees;
107  unsigned short minutes;
108  double seconds;
109 };
110 
117 struct ln_hms
118 {
119  unsigned short hours;
120  unsigned short minutes;
121  double seconds;
122 };
123 
131 {
132  struct ln_hms ra;
133  struct ln_dms dec;
134 };
135 
143 {
144  struct ln_dms az;
145  struct ln_dms alt;
146 };
147 
148 
156 {
157  struct ln_dms lng;
158  struct ln_dms lat;
159 };
160 
161 
171 {
172  double ra;
173  double dec;
174 };
175 
185 {
186  double az;
188  double alt;
189 };
190 
191 
201 {
202  double lng;
203  double lat;
204 };
205 
206 
217 {
218  double L;
219  double B;
220  double R;
221 };
222 
238 {
239  double X;
240  double Y;
241  double Z;
242 };
243 
253 {
254  double l;
255  double b;
256 };
257 
266 {
267  double a;
268  double e;
269  double i;
270  double w;
271  double omega;
272  double n;
273  double JD;
274 };
275 
284 {
285  double q;
286  double i;
287  double w;
288  double omega;
289  double JD;
290 };
291 
300 {
301  double q;
302  double e;
303  double i;
304  double w;
305  double omega;
306  double JD;
307 };
308 
318 {
319  double rise;
320  double set;
321  double transit;
322 };
323 
333 {
334  double longitude;
335  double obliquity;
336  double ecliptic;
337 };
338 
339 /* Definitions of POSIX structures for Win32. */
340 #ifdef __WIN32__
341 
342 #include <time.h>
343 
344 struct timeval
345 {
346  time_t tv_sec; /* count of seconds since Jan. 1, 1970 */
347  long tv_usec; /* and microseconds */
348 };
349 
350 struct timezone
351 {
352  int tz_minuteswest; /* Minutes west of GMT */
353  int tz_dsttime; /* DST correction offset */
354 };
355 
356 #endif /* __WIN32__ */
357 
358 #ifdef __cplusplus
359 };
360 #endif
361 
362 #endif
363 
Nutation in longitude, ecliptic and obliquity.
Definition: ln_types.h:332
double JD
Definition: ln_types.h:273
int minutes
Definition: ln_types.h:92
double i
Definition: ln_types.h:303
int months
Definition: ln_types.h:89
double dec
Definition: ln_types.h:173
Elliptic Orbital elements.
Definition: ln_types.h:265
struct ln_dms dec
Definition: ln_types.h:133
double seconds
Definition: ln_types.h:93
double JD
Definition: ln_types.h:306
double n
Definition: ln_types.h:272
double X
Definition: ln_types.h:239
double l
Definition: ln_types.h:254
struct ln_dms az
Definition: ln_types.h:144
Rectangular coordinates.
Definition: ln_types.h:237
double L
Definition: ln_types.h:218
double q
Definition: ln_types.h:301
double e
Definition: ln_types.h:268
unsigned short hours
Definition: ln_types.h:119
double rise
Definition: ln_types.h:319
Human readable Date and time with timezone information used by libnova.
Definition: ln_types.h:86
Horizontal Coordinates.
Definition: ln_types.h:184
struct ln_dms lng
Definition: ln_types.h:157
double ecliptic
Definition: ln_types.h:336
double Z
Definition: ln_types.h:241
Degrees, minutes and seconds.
Definition: ln_types.h:103
Hours, minutes and seconds.
Definition: ln_types.h:117
double seconds
Definition: ln_types.h:73
int months
Definition: ln_types.h:69
double B
Definition: ln_types.h:219
double lat
Definition: ln_types.h:203
struct ln_dms lat
Definition: ln_types.h:158
double R
Definition: ln_types.h:220
double q
Definition: ln_types.h:285
Equatorial Coordinates.
Definition: ln_types.h:170
double w
Definition: ln_types.h:304
double seconds
Definition: ln_types.h:108
struct ln_dms alt
Definition: ln_types.h:145
Hyperbolic Orbital elements.
Definition: ln_types.h:299
double alt
Definition: ln_types.h:188
int days
Definition: ln_types.h:90
unsigned short neg
Definition: ln_types.h:105
double Y
Definition: ln_types.h:240
double longitude
Definition: ln_types.h:334
Ecliptical (or celestial) Longitude and Latitude.
Definition: ln_types.h:200
double w
Definition: ln_types.h:270
Parabolic Orbital elements.
Definition: ln_types.h:283
double obliquity
Definition: ln_types.h:335
Human readable Date and time used by libnova.
Definition: ln_types.h:66
Rise, Set and Transit times.
Definition: ln_types.h:317
double i
Definition: ln_types.h:269
int minutes
Definition: ln_types.h:72
int hours
Definition: ln_types.h:71
double omega
Definition: ln_types.h:288
struct ln_hms ra
Definition: ln_types.h:132
Heliocentric position.
Definition: ln_types.h:216
double e
Definition: ln_types.h:302
Right Ascension and Declination.
Definition: ln_types.h:130
double seconds
Definition: ln_types.h:121
int days
Definition: ln_types.h:70
int years
Definition: ln_types.h:88
unsigned short degrees
Definition: ln_types.h:106
double az
Definition: ln_types.h:186
long gmtoff
Definition: ln_types.h:94
int hours
Definition: ln_types.h:91
double JD
Definition: ln_types.h:289
double ra
Definition: ln_types.h:172
Ecliptical (or celestial) Latitude and Longitude.
Definition: ln_types.h:155
double transit
Definition: ln_types.h:321
double lng
Definition: ln_types.h:202
unsigned short minutes
Definition: ln_types.h:120
double i
Definition: ln_types.h:286
Galactic coordinates.
Definition: ln_types.h:252
Azimuth and Altitude.
Definition: ln_types.h:142
unsigned short minutes
Definition: ln_types.h:107
double b
Definition: ln_types.h:255
int years
Definition: ln_types.h:68
double w
Definition: ln_types.h:287
double omega
Definition: ln_types.h:305
double omega
Definition: ln_types.h:271
double a
Definition: ln_types.h:267