libnova v 0.16.0
Loading...
Searching...
No Matches
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
36extern "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
79struct ln_date {
80 int years;
81 int months;
82 int days;
83 int hours;
84 int minutes;
85 double seconds;
86};
87
99 int years;
100 int months;
101 int days;
102 int hours;
104 double seconds;
105 long gmtoff;
106};
107
114struct ln_dms {
115 unsigned short neg;
116 unsigned short degrees;
117 unsigned short minutes;
118 double seconds;
119};
120
127struct ln_hms {
128 unsigned short hours;
129 unsigned short minutes;
130 double seconds;
131};
132
140 struct ln_hms ra;
141 struct ln_dms dec;
142};
143
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
177 double ra;
178 double dec;
179};
180
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
240 double X;
241 double Y;
242 double Z;
243};
244
254 double l;
255 double b;
256};
257
266 double a;
267 double e;
268 double i;
269 double w;
270 double omega;
271 double n;
272 double JD;
273};
274
283 double q;
284 double i;
285 double w;
286 double omega;
287 double JD;
288};
289
298 double q;
299 double e;
300 double i;
301 double w;
302 double omega;
303 double JD;
304};
305
315 double rise;
316 double set;
317 double transit;
318};
319
329 double longitude;
330 double obliquity;
331 double ecliptic;
332};
333
334#if defined(__WIN32__) && !defined(__MINGW__)
335
336#include <time.h>
337
338struct timeval
339{
340 time_t tv_sec; /* count of seconds since Jan. 1, 1970 */
341 long tv_usec; /* and microseconds */
342};
343
344struct 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
Human readable Date and time used by libnova.
Definition: ln_types.h:79
double seconds
Definition: ln_types.h:85
int months
Definition: ln_types.h:81
int minutes
Definition: ln_types.h:84
int hours
Definition: ln_types.h:83
int days
Definition: ln_types.h:82
int years
Definition: ln_types.h:80
Degrees, minutes and seconds.
Definition: ln_types.h:114
unsigned short neg
Definition: ln_types.h:115
unsigned short minutes
Definition: ln_types.h:117
unsigned short degrees
Definition: ln_types.h:116
double seconds
Definition: ln_types.h:118
Elliptic Orbital elements.
Definition: ln_types.h:265
double w
Definition: ln_types.h:269
double a
Definition: ln_types.h:266
double JD
Definition: ln_types.h:272
double e
Definition: ln_types.h:267
double i
Definition: ln_types.h:268
double n
Definition: ln_types.h:271
double omega
Definition: ln_types.h:270
Equatorial Coordinates.
Definition: ln_types.h:176
double dec
Definition: ln_types.h:178
double ra
Definition: ln_types.h:177
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:219
double R
Definition: ln_types.h:222
double L
Definition: ln_types.h:220
double B
Definition: ln_types.h:221
Hours, minutes and seconds.
Definition: ln_types.h:127
double seconds
Definition: ln_types.h:130
unsigned short minutes
Definition: ln_types.h:129
unsigned short hours
Definition: ln_types.h:128
Horizontal Coordinates.
Definition: ln_types.h:189
double az
Definition: ln_types.h:190
double alt
Definition: ln_types.h:192
Hyperbolic Orbital elements.
Definition: ln_types.h:297
double q
Definition: ln_types.h:298
double i
Definition: ln_types.h:300
double omega
Definition: ln_types.h:302
double w
Definition: ln_types.h:301
double e
Definition: ln_types.h:299
double JD
Definition: ln_types.h:303
Ecliptical (or celestial) Longitude and Latitude.
Definition: ln_types.h:204
double lng
Definition: ln_types.h:205
double lat
Definition: ln_types.h:206
Nutation in longitude, ecliptic and obliquity.
Definition: ln_types.h:328
double obliquity
Definition: ln_types.h:330
double ecliptic
Definition: ln_types.h:331
double longitude
Definition: ln_types.h:329
Parabolic Orbital elements.
Definition: ln_types.h:282
double JD
Definition: ln_types.h:287
double w
Definition: ln_types.h:285
double i
Definition: ln_types.h:284
double q
Definition: ln_types.h:283
double omega
Definition: ln_types.h:286
Rectangular coordinates.
Definition: ln_types.h:239
double Y
Definition: ln_types.h:241
double X
Definition: ln_types.h:240
double Z
Definition: ln_types.h:242
Rise, Set and Transit times.
Definition: ln_types.h:314
double set
Definition: ln_types.h:316
double rise
Definition: ln_types.h:315
double transit
Definition: ln_types.h:317
Human readable Date and time with timezone information used by libnova.
Definition: ln_types.h:98
int minutes
Definition: ln_types.h:103
int months
Definition: ln_types.h:100
int hours
Definition: ln_types.h:102
int years
Definition: ln_types.h:99
int days
Definition: ln_types.h:101
long gmtoff
Definition: ln_types.h:105
double seconds
Definition: ln_types.h:104
Right Ascension and Declination.
Definition: ln_types.h:139
struct ln_dms dec
Definition: ln_types.h:141
struct ln_hms ra
Definition: ln_types.h:140
Azimuth and Altitude.
Definition: ln_types.h:150
struct ln_dms alt
Definition: ln_types.h:152
struct ln_dms az
Definition: ln_types.h:151
Ecliptical (or celestial) Latitude and Longitude.
Definition: ln_types.h:162
struct ln_dms lat
Definition: ln_types.h:164
struct ln_dms lng
Definition: ln_types.h:163