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
23extern "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
65
66struct ln_date
67{
68 int years;
69 int months;
70 int days;
71 int hours;
72 int minutes;
73 double seconds;
74};
75
85
87{
88 int years;
89 int months;
90 int days;
91 int hours;
92 int minutes;
93 double seconds;
94 long gmtoff;
95};
96
102
103struct ln_dms
104{
105 unsigned short neg;
106 unsigned short degrees;
107 unsigned short minutes;
108 double seconds;
109};
110
116
117struct ln_hms
118{
119 unsigned short hours;
120 unsigned short minutes;
121 double seconds;
122};
123
129
131{
132 struct ln_hms ra;
133 struct ln_dms dec;
134};
135
141
143{
144 struct ln_dms az;
145 struct ln_dms alt;
146};
147
148
154
156{
157 struct ln_dms lng;
158 struct ln_dms lat;
159};
160
161
169
171{
172 double ra;
173 double dec;
174};
175
183
185{
186 double az;
188 double alt;
189};
190
191
199
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
344struct timeval
345{
346 time_t tv_sec; /* count of seconds since Jan. 1, 1970 */
347 long tv_usec; /* and microseconds */
348};
349
350struct 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
Human readable Date and time used by libnova.
Definition ln_types.h:67
double seconds
Definition ln_types.h:73
int months
Definition ln_types.h:69
int minutes
Definition ln_types.h:72
int hours
Definition ln_types.h:71
int days
Definition ln_types.h:70
int years
Definition ln_types.h:68
Degrees, minutes and seconds.
Definition ln_types.h:104
unsigned short neg
Definition ln_types.h:105
unsigned short minutes
Definition ln_types.h:107
unsigned short degrees
Definition ln_types.h:106
double seconds
Definition ln_types.h:108
Elliptic Orbital elements.
Definition ln_types.h:266
double w
Definition ln_types.h:270
double a
Definition ln_types.h:267
double JD
Definition ln_types.h:273
double e
Definition ln_types.h:268
double i
Definition ln_types.h:269
double n
Definition ln_types.h:272
double omega
Definition ln_types.h:271
Equatorial Coordinates.
Definition ln_types.h:171
double dec
Definition ln_types.h:173
double ra
Definition ln_types.h:172
Galactic coordinates.
Definition ln_types.h:253
double b
Definition ln_types.h:255
double l
Definition ln_types.h:254
Heliocentric position.
Definition ln_types.h:217
double R
Definition ln_types.h:220
double L
Definition ln_types.h:218
double B
Definition ln_types.h:219
Hours, minutes and seconds.
Definition ln_types.h:118
double seconds
Definition ln_types.h:121
unsigned short minutes
Definition ln_types.h:120
unsigned short hours
Definition ln_types.h:119
Horizontal Coordinates.
Definition ln_types.h:185
double az
Definition ln_types.h:186
double alt
Definition ln_types.h:188
Hyperbolic Orbital elements.
Definition ln_types.h:300
double q
Definition ln_types.h:301
double i
Definition ln_types.h:303
double omega
Definition ln_types.h:305
double w
Definition ln_types.h:304
double e
Definition ln_types.h:302
double JD
Definition ln_types.h:306
Ecliptical (or celestial) Longitude and Latitude.
Definition ln_types.h:201
double lng
Definition ln_types.h:202
double lat
Definition ln_types.h:203
Nutation in longitude, ecliptic and obliquity.
Definition ln_types.h:333
double obliquity
Definition ln_types.h:335
double ecliptic
Definition ln_types.h:336
double longitude
Definition ln_types.h:334
Parabolic Orbital elements.
Definition ln_types.h:284
double JD
Definition ln_types.h:289
double w
Definition ln_types.h:287
double i
Definition ln_types.h:286
double q
Definition ln_types.h:285
double omega
Definition ln_types.h:288
Rectangular coordinates.
Definition ln_types.h:238
double Y
Definition ln_types.h:240
double X
Definition ln_types.h:239
double Z
Definition ln_types.h:241
Rise, Set and Transit times.
Definition ln_types.h:318
double set
Definition ln_types.h:320
double rise
Definition ln_types.h:319
double transit
Definition ln_types.h:321
Human readable Date and time with timezone information used by libnova.
Definition ln_types.h:87
int minutes
Definition ln_types.h:92
int months
Definition ln_types.h:89
int hours
Definition ln_types.h:91
int years
Definition ln_types.h:88
int days
Definition ln_types.h:90
long gmtoff
Definition ln_types.h:94
double seconds
Definition ln_types.h:93
Right Ascension and Declination.
Definition ln_types.h:131
struct ln_dms dec
Definition ln_types.h:133
struct ln_hms ra
Definition ln_types.h:132
Azimuth and Altitude.
Definition ln_types.h:143
struct ln_dms alt
Definition ln_types.h:145
struct ln_dms az
Definition ln_types.h:144
Ecliptical (or celestial) Latitude and Longitude.
Definition ln_types.h:156
struct ln_dms lat
Definition ln_types.h:158
struct ln_dms lng
Definition ln_types.h:157