swe4r 0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/ext/swe4r/extconf.rb +3 -0
- data/ext/swe4r/src/swemptab.c +10642 -0
- data/ext/swe4r/swe4r.c +129 -0
- data/ext/swe4r/swecl.c +4948 -0
- data/ext/swe4r/swedate.c +590 -0
- data/ext/swe4r/swedate.h +82 -0
- data/ext/swe4r/swehel.c +3445 -0
- data/ext/swe4r/swehouse.c +1727 -0
- data/ext/swe4r/swehouse.h +85 -0
- data/ext/swe4r/swejpl.c +937 -0
- data/ext/swe4r/swejpl.h +105 -0
- data/ext/swe4r/swemmoon.c +1824 -0
- data/ext/swe4r/swemplan.c +959 -0
- data/ext/swe4r/swenut2000a.h +2820 -0
- data/ext/swe4r/sweodef.h +325 -0
- data/ext/swe4r/sweph.c +6241 -0
- data/ext/swe4r/sweph.h +556 -0
- data/ext/swe4r/swephexp.h +749 -0
- data/ext/swe4r/swephlib.c +2581 -0
- data/ext/swe4r/swephlib.h +177 -0
- data/lib/swe4r.rb +2 -0
- metadata +66 -0
@@ -0,0 +1,749 @@
|
|
1
|
+
/************************************************************
|
2
|
+
$Header: /home/dieter/sweph/RCS/swephexp.h,v 1.75 2009/04/08 07:19:08 dieter Exp $
|
3
|
+
SWISSEPH: exported definitions and constants
|
4
|
+
|
5
|
+
This file represents the standard application interface (API)
|
6
|
+
to the Swiss Ephemeris.
|
7
|
+
|
8
|
+
A C programmer needs only to include this file, and link his code
|
9
|
+
with the SwissEph library.
|
10
|
+
|
11
|
+
The function calls are documented in the Programmer's documentation,
|
12
|
+
which is online in HTML format.
|
13
|
+
|
14
|
+
Structure of this file:
|
15
|
+
Public API definitions
|
16
|
+
Internal developer's definitions
|
17
|
+
Public API functions.
|
18
|
+
|
19
|
+
Authors: Dieter Koch and Alois Treindl, Astrodienst Zurich
|
20
|
+
|
21
|
+
************************************************************/
|
22
|
+
/* Copyright (C) 1997 - 2008 Astrodienst AG, Switzerland. All rights reserved.
|
23
|
+
|
24
|
+
License conditions
|
25
|
+
------------------
|
26
|
+
|
27
|
+
This file is part of Swiss Ephemeris.
|
28
|
+
|
29
|
+
Swiss Ephemeris is distributed with NO WARRANTY OF ANY KIND. No author
|
30
|
+
or distributor accepts any responsibility for the consequences of using it,
|
31
|
+
or for whether it serves any particular purpose or works at all, unless he
|
32
|
+
or she says so in writing.
|
33
|
+
|
34
|
+
Swiss Ephemeris is made available by its authors under a dual licensing
|
35
|
+
system. The software developer, who uses any part of Swiss Ephemeris
|
36
|
+
in his or her software, must choose between one of the two license models,
|
37
|
+
which are
|
38
|
+
a) GNU public license version 2 or later
|
39
|
+
b) Swiss Ephemeris Professional License
|
40
|
+
|
41
|
+
The choice must be made before the software developer distributes software
|
42
|
+
containing parts of Swiss Ephemeris to others, and before any public
|
43
|
+
service using the developed software is activated.
|
44
|
+
|
45
|
+
If the developer choses the GNU GPL software license, he or she must fulfill
|
46
|
+
the conditions of that license, which includes the obligation to place his
|
47
|
+
or her whole software project under the GNU GPL or a compatible license.
|
48
|
+
See http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
49
|
+
|
50
|
+
If the developer choses the Swiss Ephemeris Professional license,
|
51
|
+
he must follow the instructions as found in http://www.astro.com/swisseph/
|
52
|
+
and purchase the Swiss Ephemeris Professional Edition from Astrodienst
|
53
|
+
and sign the corresponding license contract.
|
54
|
+
|
55
|
+
The License grants you the right to use, copy, modify and redistribute
|
56
|
+
Swiss Ephemeris, but only under certain conditions described in the License.
|
57
|
+
Among other things, the License requires that the copyright notices and
|
58
|
+
this notice be preserved on all copies.
|
59
|
+
|
60
|
+
Authors of the Swiss Ephemeris: Dieter Koch and Alois Treindl
|
61
|
+
|
62
|
+
The authors of Swiss Ephemeris have no control or influence over any of
|
63
|
+
the derived works, i.e. over software or services created by other
|
64
|
+
programmers which use Swiss Ephemeris functions.
|
65
|
+
|
66
|
+
The names of the authors or of the copyright holder (Astrodienst) must not
|
67
|
+
be used for promoting any software, product or service which uses or contains
|
68
|
+
the Swiss Ephemeris. This copyright notice is the ONLY place where the
|
69
|
+
names of the authors can legally appear, except in cases where they have
|
70
|
+
given special permission in writing.
|
71
|
+
|
72
|
+
The trademarks 'Swiss Ephemeris' and 'Swiss Ephemeris inside' may be used
|
73
|
+
for promoting such software, products or services.
|
74
|
+
*/
|
75
|
+
|
76
|
+
#ifdef __cplusplus
|
77
|
+
extern "C" {
|
78
|
+
#endif
|
79
|
+
|
80
|
+
#ifndef _SWEPHEXP_INCLUDED /* allow multiple #includes of swephexp.h */
|
81
|
+
#define _SWEPHEXP_INCLUDED
|
82
|
+
|
83
|
+
#include "sweodef.h"
|
84
|
+
|
85
|
+
/***********************************************************
|
86
|
+
* definitions for use also by non-C programmers
|
87
|
+
***********************************************************/
|
88
|
+
|
89
|
+
/* values for gregflag in swe_julday() and swe_revjul() */
|
90
|
+
# define SE_JUL_CAL 0
|
91
|
+
# define SE_GREG_CAL 1
|
92
|
+
|
93
|
+
/*
|
94
|
+
* planet numbers for the ipl parameter in swe_calc()
|
95
|
+
*/
|
96
|
+
#define SE_ECL_NUT -1
|
97
|
+
|
98
|
+
#define SE_SUN 0
|
99
|
+
#define SE_MOON 1
|
100
|
+
#define SE_MERCURY 2
|
101
|
+
#define SE_VENUS 3
|
102
|
+
#define SE_MARS 4
|
103
|
+
#define SE_JUPITER 5
|
104
|
+
#define SE_SATURN 6
|
105
|
+
#define SE_URANUS 7
|
106
|
+
#define SE_NEPTUNE 8
|
107
|
+
#define SE_PLUTO 9
|
108
|
+
#define SE_MEAN_NODE 10
|
109
|
+
#define SE_TRUE_NODE 11
|
110
|
+
#define SE_MEAN_APOG 12
|
111
|
+
#define SE_OSCU_APOG 13
|
112
|
+
#define SE_EARTH 14
|
113
|
+
#define SE_CHIRON 15
|
114
|
+
#define SE_PHOLUS 16
|
115
|
+
#define SE_CERES 17
|
116
|
+
#define SE_PALLAS 18
|
117
|
+
#define SE_JUNO 19
|
118
|
+
#define SE_VESTA 20
|
119
|
+
#define SE_INTP_APOG 21
|
120
|
+
#define SE_INTP_PERG 22
|
121
|
+
|
122
|
+
#define SE_NPLANETS 23
|
123
|
+
|
124
|
+
#define SE_AST_OFFSET 10000
|
125
|
+
#define SE_VARUNA (SE_AST_OFFSET + 20000)
|
126
|
+
|
127
|
+
#define SE_FICT_OFFSET 40
|
128
|
+
#define SE_FICT_OFFSET_1 39
|
129
|
+
#define SE_FICT_MAX 999
|
130
|
+
#define SE_NFICT_ELEM 15
|
131
|
+
|
132
|
+
#define SE_COMET_OFFSET 1000
|
133
|
+
|
134
|
+
#define SE_NALL_NAT_POINTS (SE_NPLANETS + SE_NFICT_ELEM)
|
135
|
+
|
136
|
+
/* Hamburger or Uranian "planets" */
|
137
|
+
#define SE_CUPIDO 40
|
138
|
+
#define SE_HADES 41
|
139
|
+
#define SE_ZEUS 42
|
140
|
+
#define SE_KRONOS 43
|
141
|
+
#define SE_APOLLON 44
|
142
|
+
#define SE_ADMETOS 45
|
143
|
+
#define SE_VULKANUS 46
|
144
|
+
#define SE_POSEIDON 47
|
145
|
+
/* other fictitious bodies */
|
146
|
+
#define SE_ISIS 48
|
147
|
+
#define SE_NIBIRU 49
|
148
|
+
#define SE_HARRINGTON 50
|
149
|
+
#define SE_NEPTUNE_LEVERRIER 51
|
150
|
+
#define SE_NEPTUNE_ADAMS 52
|
151
|
+
#define SE_PLUTO_LOWELL 53
|
152
|
+
#define SE_PLUTO_PICKERING 54
|
153
|
+
#define SE_VULCAN 55
|
154
|
+
#define SE_WHITE_MOON 56
|
155
|
+
#define SE_PROSERPINA 57
|
156
|
+
#define SE_WALDEMATH 58
|
157
|
+
|
158
|
+
#define SE_FIXSTAR -10
|
159
|
+
|
160
|
+
#define SE_ASC 0
|
161
|
+
#define SE_MC 1
|
162
|
+
#define SE_ARMC 2
|
163
|
+
#define SE_VERTEX 3
|
164
|
+
#define SE_EQUASC 4 /* "equatorial ascendant" */
|
165
|
+
#define SE_COASC1 5 /* "co-ascendant" (W. Koch) */
|
166
|
+
#define SE_COASC2 6 /* "co-ascendant" (M. Munkasey) */
|
167
|
+
#define SE_POLASC 7 /* "polar ascendant" (M. Munkasey) */
|
168
|
+
#define SE_NASCMC 8
|
169
|
+
|
170
|
+
/*
|
171
|
+
* flag bits for parameter iflag in function swe_calc()
|
172
|
+
* The flag bits are defined in such a way that iflag = 0 delivers what one
|
173
|
+
* usually wants:
|
174
|
+
* - the default ephemeris (SWISS EPHEMERIS) is used,
|
175
|
+
* - apparent geocentric positions referring to the true equinox of date
|
176
|
+
* are returned.
|
177
|
+
* If not only coordinates, but also speed values are required, use
|
178
|
+
* flag = SEFLG_SPEED.
|
179
|
+
*
|
180
|
+
* The 'L' behind the number indicates that 32-bit integers (Long) are used.
|
181
|
+
*/
|
182
|
+
#define SEFLG_JPLEPH 1 /* use JPL ephemeris */
|
183
|
+
#define SEFLG_SWIEPH 2 /* use SWISSEPH ephemeris */
|
184
|
+
#define SEFLG_MOSEPH 4 /* use Moshier ephemeris */
|
185
|
+
|
186
|
+
#define SEFLG_HELCTR 8 /* return heliocentric position */
|
187
|
+
#define SEFLG_TRUEPOS 16 /* return true positions, not apparent */
|
188
|
+
#define SEFLG_J2000 32 /* no precession, i.e. give J2000 equinox */
|
189
|
+
#define SEFLG_NONUT 64 /* no nutation, i.e. mean equinox of date */
|
190
|
+
#define SEFLG_SPEED3 128 /* speed from 3 positions (do not use it,
|
191
|
+
SEFLG_SPEED is faster and more precise.) */
|
192
|
+
#define SEFLG_SPEED 256 /* high precision speed */
|
193
|
+
#define SEFLG_NOGDEFL 512 /* turn off gravitational deflection */
|
194
|
+
#define SEFLG_NOABERR 1024 /* turn off 'annual' aberration of light */
|
195
|
+
#define SEFLG_EQUATORIAL (2*1024) /* equatorial positions are wanted */
|
196
|
+
#define SEFLG_XYZ (4*1024) /* cartesian, not polar, coordinates */
|
197
|
+
#define SEFLG_RADIANS (8*1024) /* coordinates in radians, not degrees */
|
198
|
+
#define SEFLG_BARYCTR (16*1024) /* barycentric positions */
|
199
|
+
#define SEFLG_TOPOCTR (32*1024) /* topocentric positions */
|
200
|
+
#define SEFLG_SIDEREAL (64*1024) /* sidereal positions */
|
201
|
+
#define SEFLG_ICRS (128*1024) /* ICRS (DE406 reference frame) */
|
202
|
+
|
203
|
+
#define SE_SIDBITS 256
|
204
|
+
/* for projection onto ecliptic of t0 */
|
205
|
+
#define SE_SIDBIT_ECL_T0 256
|
206
|
+
/* for projection onto solar system plane */
|
207
|
+
#define SE_SIDBIT_SSY_PLANE 512
|
208
|
+
|
209
|
+
/* sidereal modes (ayanamsas) */
|
210
|
+
#define SE_SIDM_FAGAN_BRADLEY 0
|
211
|
+
#define SE_SIDM_LAHIRI 1
|
212
|
+
#define SE_SIDM_DELUCE 2
|
213
|
+
#define SE_SIDM_RAMAN 3
|
214
|
+
#define SE_SIDM_USHASHASHI 4
|
215
|
+
#define SE_SIDM_KRISHNAMURTI 5
|
216
|
+
#define SE_SIDM_DJWHAL_KHUL 6
|
217
|
+
#define SE_SIDM_YUKTESHWAR 7
|
218
|
+
#define SE_SIDM_JN_BHASIN 8
|
219
|
+
#define SE_SIDM_BABYL_KUGLER1 9
|
220
|
+
#define SE_SIDM_BABYL_KUGLER2 10
|
221
|
+
#define SE_SIDM_BABYL_KUGLER3 11
|
222
|
+
#define SE_SIDM_BABYL_HUBER 12
|
223
|
+
#define SE_SIDM_BABYL_ETPSC 13
|
224
|
+
#define SE_SIDM_ALDEBARAN_15TAU 14
|
225
|
+
#define SE_SIDM_HIPPARCHOS 15
|
226
|
+
#define SE_SIDM_SASSANIAN 16
|
227
|
+
#define SE_SIDM_GALCENT_0SAG 17
|
228
|
+
#define SE_SIDM_J2000 18
|
229
|
+
#define SE_SIDM_J1900 19
|
230
|
+
#define SE_SIDM_B1950 20
|
231
|
+
#define SE_SIDM_USER 255
|
232
|
+
|
233
|
+
#define SE_NSIDM_PREDEF 21
|
234
|
+
|
235
|
+
/* used for swe_nod_aps(): */
|
236
|
+
#define SE_NODBIT_MEAN 1 /* mean nodes/apsides */
|
237
|
+
#define SE_NODBIT_OSCU 2 /* osculating nodes/apsides */
|
238
|
+
#define SE_NODBIT_OSCU_BAR 4 /* same, but motion about solar system barycenter is considered */
|
239
|
+
#define SE_NODBIT_FOPOINT 256 /* focal point of orbit instead of aphelion */
|
240
|
+
|
241
|
+
/* default ephemeris used when no ephemeris flagbit is set */
|
242
|
+
#define SEFLG_DEFAULTEPH SEFLG_SWIEPH
|
243
|
+
|
244
|
+
#define SE_MAX_STNAME 256 /* maximum size of fixstar name;
|
245
|
+
* the parameter star in swe_fixstar
|
246
|
+
* must allow twice this space for
|
247
|
+
* the returned star name.
|
248
|
+
*/
|
249
|
+
|
250
|
+
/* defines for eclipse computations */
|
251
|
+
|
252
|
+
#define SE_ECL_CENTRAL 1
|
253
|
+
#define SE_ECL_NONCENTRAL 2
|
254
|
+
#define SE_ECL_TOTAL 4
|
255
|
+
#define SE_ECL_ANNULAR 8
|
256
|
+
#define SE_ECL_PARTIAL 16
|
257
|
+
#define SE_ECL_ANNULAR_TOTAL 32
|
258
|
+
#define SE_ECL_PENUMBRAL 64
|
259
|
+
#define SE_ECL_ALLTYPES_SOLAR (SE_ECL_CENTRAL|SE_ECL_NONCENTRAL|SE_ECL_TOTAL|SE_ECL_ANNULAR|SE_ECL_PARTIAL|SE_ECL_ANNULAR_TOTAL)
|
260
|
+
#define SE_ECL_ALLTYPES_LUNAR (SE_ECL_TOTAL|SE_ECL_PARTIAL|SE_ECL_PENUMBRAL)
|
261
|
+
#define SE_ECL_VISIBLE 128
|
262
|
+
#define SE_ECL_MAX_VISIBLE 256
|
263
|
+
#define SE_ECL_1ST_VISIBLE 512
|
264
|
+
#define SE_ECL_2ND_VISIBLE 1024
|
265
|
+
#define SE_ECL_3RD_VISIBLE 2048
|
266
|
+
#define SE_ECL_4TH_VISIBLE 4096
|
267
|
+
#define SE_ECL_ONE_TRY (32*1024)
|
268
|
+
/* check if the next conjunction of the moon with
|
269
|
+
* a planet is an occultation; don't search further */
|
270
|
+
|
271
|
+
/* for swe_rise_transit() */
|
272
|
+
#define SE_CALC_RISE 1
|
273
|
+
#define SE_CALC_SET 2
|
274
|
+
#define SE_CALC_MTRANSIT 4
|
275
|
+
#define SE_CALC_ITRANSIT 8
|
276
|
+
#define SE_BIT_DISC_CENTER 256 /* to be or'ed to SE_CALC_RISE/SET,
|
277
|
+
* if rise or set of disc center is
|
278
|
+
* required */
|
279
|
+
#define SE_BIT_DISC_BOTTOM 8192 /* to be or'ed to SE_CALC_RISE/SET,
|
280
|
+
* if rise or set of lower limb of
|
281
|
+
* disc is requried */
|
282
|
+
#define SE_BIT_NO_REFRACTION 512 /* to be or'ed to SE_CALC_RISE/SET,
|
283
|
+
* if refraction is to be ignored */
|
284
|
+
#define SE_BIT_CIVIL_TWILIGHT 1024 /* to be or'ed to SE_CALC_RISE/SET */
|
285
|
+
#define SE_BIT_NAUTIC_TWILIGHT 2048 /* to be or'ed to SE_CALC_RISE/SET */
|
286
|
+
#define SE_BIT_ASTRO_TWILIGHT 4096 /* to be or'ed to SE_CALC_RISE/SET */
|
287
|
+
#define SE_BIT_FIXED_DISC_SIZE (16*1024) /* or'ed to SE_CALC_RISE/SET:
|
288
|
+
* neglect the effect of distance on
|
289
|
+
* disc size */
|
290
|
+
|
291
|
+
|
292
|
+
/* for swe_azalt() and swe_azalt_rev() */
|
293
|
+
#define SE_ECL2HOR 0
|
294
|
+
#define SE_EQU2HOR 1
|
295
|
+
#define SE_HOR2ECL 0
|
296
|
+
#define SE_HOR2EQU 1
|
297
|
+
|
298
|
+
/* for swe_refrac() */
|
299
|
+
#define SE_TRUE_TO_APP 0
|
300
|
+
#define SE_APP_TO_TRUE 1
|
301
|
+
|
302
|
+
/*
|
303
|
+
* only used for experimenting with various JPL ephemeris files
|
304
|
+
* which are available at Astrodienst's internal network
|
305
|
+
*/
|
306
|
+
#define SE_DE_NUMBER 406
|
307
|
+
#define SE_FNAME_DE200 "de200.eph"
|
308
|
+
#define SE_FNAME_DE403 "de403.eph"
|
309
|
+
#define SE_FNAME_DE404 "de404.eph"
|
310
|
+
#define SE_FNAME_DE405 "de405.eph"
|
311
|
+
#define SE_FNAME_DE406 "de406.eph"
|
312
|
+
#define SE_FNAME_DFT SE_FNAME_DE406
|
313
|
+
#define SE_STARFILE_OLD "fixstars.cat"
|
314
|
+
#define SE_STARFILE "sefstars.txt"
|
315
|
+
#define SE_ASTNAMFILE "seasnam.txt"
|
316
|
+
#define SE_FICTFILE "seorbel.txt"
|
317
|
+
|
318
|
+
/*
|
319
|
+
* ephemeris path
|
320
|
+
* this defines where ephemeris files are expected if the function
|
321
|
+
* swe_set_ephe_path() is not called by the application.
|
322
|
+
* Normally, every application should make this call to define its
|
323
|
+
* own place for the ephemeris files.
|
324
|
+
*/
|
325
|
+
|
326
|
+
#if MSDOS
|
327
|
+
#ifdef PAIR_SWEPH
|
328
|
+
# define SE_EPHE_PATH "\\pair\\ephe\\"
|
329
|
+
#else
|
330
|
+
# define SE_EPHE_PATH "\\sweph\\ephe\\"
|
331
|
+
#endif
|
332
|
+
#else
|
333
|
+
# ifdef MACOS
|
334
|
+
# define SE_EPHE_PATH ":ephe:"
|
335
|
+
# else
|
336
|
+
# define SE_EPHE_PATH ".:/users/ephe2/:/users/ephe/"
|
337
|
+
/* At Astrodienst, we maintain two ephemeris areas for
|
338
|
+
the thousands of asteroid files:
|
339
|
+
the short files in /users/ephe/ast*,
|
340
|
+
the long file in /users/ephe2/ast*. */
|
341
|
+
# endif
|
342
|
+
#endif
|
343
|
+
|
344
|
+
/* defines for function swe_split_deg() (in swephlib.c) */
|
345
|
+
# define SE_SPLIT_DEG_ROUND_SEC 1
|
346
|
+
# define SE_SPLIT_DEG_ROUND_MIN 2
|
347
|
+
# define SE_SPLIT_DEG_ROUND_DEG 4
|
348
|
+
# define SE_SPLIT_DEG_ZODIACAL 8
|
349
|
+
# define SE_SPLIT_DEG_KEEP_SIGN 16 /* don't round to next sign,
|
350
|
+
* e.g. 29.9999999 will be rounded
|
351
|
+
* to 29d59'59" (or 29d59' or 29d) */
|
352
|
+
# define SE_SPLIT_DEG_KEEP_DEG 32 /* don't round to next degree
|
353
|
+
* e.g. 13.9999999 will be rounded
|
354
|
+
* to 13d59'59" (or 13d59' or 13d) */
|
355
|
+
|
356
|
+
/* for heliacal functions */
|
357
|
+
#define SE_HELIACAL_RISING 1
|
358
|
+
#define SE_HELIACAL_SETTING 2
|
359
|
+
#define SE_MORNING_FIRST SE_HELIACAL_RISING
|
360
|
+
#define SE_EVENING_LAST SE_HELIACAL_SETTING
|
361
|
+
#define SE_EVENING_FIRST 3
|
362
|
+
#define SE_MORNING_LAST 4
|
363
|
+
#define SE_ACRONYCHAL_RISING 5 /* still not implemented */
|
364
|
+
#define SE_ACRONYCHAL_SETTING 6 /* still not implemented */
|
365
|
+
#define SE_COSMICAL_SETTING SE_ACRONYCHAL_SETTING
|
366
|
+
|
367
|
+
#define SE_HELFLAG_LONG_SEARCH 128
|
368
|
+
#define SE_HELFLAG_HIGH_PRECISION 256
|
369
|
+
#define SE_HELFLAG_OPTICAL_PARAMS 512
|
370
|
+
#define SE_HELFLAG_NO_DETAILS 1024
|
371
|
+
#define SE_HELFLAG_SEARCH_1_PERIOD (1 << 11) /* 2048 */
|
372
|
+
#define SE_HELFLAG_VISLIM_DARK (1 << 12) /* 4096 */
|
373
|
+
#define SE_HELFLAG_VISLIM_NOMOON (1 << 13) /* 8192 */
|
374
|
+
#define SE_HELFLAG_VISLIM_PHOTOPIC (1 << 14) /* 16384 */
|
375
|
+
#define SE_HELFLAG_AVKIND_VR (1 << 15) /* 32768 */
|
376
|
+
#define SE_HELFLAG_AVKIND_PTO (1 << 16)
|
377
|
+
#define SE_HELFLAG_AVKIND_MIN7 (1 << 17)
|
378
|
+
#define SE_HELFLAG_AVKIND_MIN9 (1 << 18)
|
379
|
+
#define SE_HELFLAG_AVKIND (SE_HELFLAG_AVKIND_VR|SE_HELFLAG_AVKIND_PTO|SE_HELFLAG_AVKIND_MIN7|SE_HELFLAG_AVKIND_MIN9)
|
380
|
+
#define TJD_INVALID 99999999.0
|
381
|
+
#define SIMULATE_VICTORVB 1
|
382
|
+
|
383
|
+
#define SE_PHOTOPIC_FLAG 0
|
384
|
+
#define SE_SCOTOPIC_FLAG 1
|
385
|
+
#define SE_MIXEDOPIC_FLAG 2
|
386
|
+
|
387
|
+
/*
|
388
|
+
* by compiling with -DPAIR_SWEPH in the compiler options it
|
389
|
+
* is possible to create a more compact version of SwissEph which
|
390
|
+
* contains no code for the JPL ephemeris file and for the builtin
|
391
|
+
* Moshier ephemeris.
|
392
|
+
* This is quite useful for MSDOS real mode applications which need to
|
393
|
+
* run within 640 kb.
|
394
|
+
* The option is called PAIR_SWEPH because it was introduced for
|
395
|
+
* Astrodienst's partner software PAIR.
|
396
|
+
*/
|
397
|
+
#ifdef PAIR_SWEPH
|
398
|
+
# define NO_JPL
|
399
|
+
#endif
|
400
|
+
|
401
|
+
/**************************************************************
|
402
|
+
* here follow some ugly definitions which are only required
|
403
|
+
* if SwissEphemeris is compiled on Windows, either to use a DLL
|
404
|
+
* or to create a DLL.
|
405
|
+
* Unix users can savely ignore his section
|
406
|
+
* and skip to the export function decarations below.
|
407
|
+
************************************************************/
|
408
|
+
#if defined(MAKE_DLL) || defined(USE_DLL) || defined(_WINDOWS)
|
409
|
+
# include <windows.h>
|
410
|
+
#endif
|
411
|
+
|
412
|
+
#ifdef USE_DLL
|
413
|
+
# include "swedll.h"
|
414
|
+
#endif
|
415
|
+
|
416
|
+
#if defined(DOS32) || !MSDOS || defined(WIN32)
|
417
|
+
/* use compiler switch to define DOS32 */
|
418
|
+
# ifndef FAR
|
419
|
+
# define FAR
|
420
|
+
# endif
|
421
|
+
# define MALLOC malloc
|
422
|
+
# define CALLOC calloc
|
423
|
+
# define FREE free
|
424
|
+
#else
|
425
|
+
# ifndef FAR
|
426
|
+
# define FAR far
|
427
|
+
# endif
|
428
|
+
# ifdef __BORLANDC__
|
429
|
+
# include <alloc.h>
|
430
|
+
# define MALLOC farmalloc
|
431
|
+
# define CALLOC farcalloc
|
432
|
+
# define FREE farfree
|
433
|
+
# else
|
434
|
+
# define MALLOC _fmalloc
|
435
|
+
# define CALLOC _fcalloc
|
436
|
+
# define FREE _ffree
|
437
|
+
# endif
|
438
|
+
#endif
|
439
|
+
|
440
|
+
/* DLL defines */
|
441
|
+
#ifdef MAKE_DLL
|
442
|
+
#if defined (PASCAL)
|
443
|
+
#define PASCAL_CONV PASCAL
|
444
|
+
#else
|
445
|
+
#define PASCAL_CONV
|
446
|
+
#endif
|
447
|
+
#ifdef MAKE_DLL16 /* 16bit DLL */
|
448
|
+
/* We compiled the 16bit DLL for Windows 3.x using Borland C/C++ Ver:3.x
|
449
|
+
and the -WD or -WDE compiler switch. */
|
450
|
+
#define EXP16 __export
|
451
|
+
#define EXP32
|
452
|
+
#else /* 32bit DLL */
|
453
|
+
/* To export symbols in the new DLL model of Win32, Microsoft
|
454
|
+
recommends the following approach */
|
455
|
+
#define EXP16
|
456
|
+
#define EXP32 __declspec( dllexport )
|
457
|
+
#endif
|
458
|
+
#else
|
459
|
+
#define PASCAL_CONV
|
460
|
+
#define EXP16
|
461
|
+
#define EXP32
|
462
|
+
#endif
|
463
|
+
|
464
|
+
#ifndef _SWEDLL_H
|
465
|
+
|
466
|
+
/***********************************************************
|
467
|
+
* exported functions
|
468
|
+
***********************************************************/
|
469
|
+
|
470
|
+
#define ext_def(x) extern EXP32 x FAR PASCAL_CONV EXP16
|
471
|
+
/* ext_def(x) evaluates to x on Unix */
|
472
|
+
|
473
|
+
ext_def(int32) swe_heliacal_ut(double tjdstart_ut, double *geopos, double *datm, double *dobs, char *ObjectName, int32 TypeEvent, int32 iflag, double *dret, char *serr);
|
474
|
+
ext_def(int32) swe_heliacal_pheno_ut(double tjd_ut, double *geopos, double *datm, double *dobs, char *ObjectName, int32 TypeEvent, int32 helflag, double *darr, char *serr);
|
475
|
+
ext_def(int32) swe_vis_limit_mag(double tjdut, double *geopos, double *datm, double *dobs, char *ObjectName, int32 helflag, double *dret, char *serr);
|
476
|
+
/* the following are secret, for Victor Reijs' */
|
477
|
+
ext_def(int32) swe_heliacal_angle(double tjdut, double *dgeo, double *datm, double *dobs, int32 helflag, double mag, double azi_obj, double azi_sun, double azi_moon, double alt_moon, double *dret, char *serr);
|
478
|
+
ext_def(int32) swe_topo_arcus_visionis(double tjdut, double *dgeo, double *datm, double *dobs, int32 helflag, double mag, double azi_obj, double alt_obj, double azi_sun, double azi_moon, double alt_moon, double *dret, char *serr);
|
479
|
+
|
480
|
+
/****************************
|
481
|
+
* exports from sweph.c
|
482
|
+
****************************/
|
483
|
+
|
484
|
+
ext_def(char *) swe_version(char *);
|
485
|
+
|
486
|
+
/* planets, moon, nodes etc. */
|
487
|
+
ext_def( int32 ) swe_calc(
|
488
|
+
double tjd, int ipl, int32 iflag,
|
489
|
+
double *xx,
|
490
|
+
char *serr);
|
491
|
+
|
492
|
+
ext_def(int32) swe_calc_ut(double tjd_ut, int32 ipl, int32 iflag,
|
493
|
+
double *xx, char *serr);
|
494
|
+
|
495
|
+
/* fixed stars */
|
496
|
+
ext_def( int32 ) swe_fixstar(
|
497
|
+
char *star, double tjd, int32 iflag,
|
498
|
+
double *xx,
|
499
|
+
char *serr);
|
500
|
+
|
501
|
+
ext_def(int32) swe_fixstar_ut(char *star, double tjd_ut, int32 iflag,
|
502
|
+
double *xx, char *serr);
|
503
|
+
|
504
|
+
ext_def(int32) swe_fixstar_mag(char *star, double *mag, char *serr);
|
505
|
+
|
506
|
+
/* close Swiss Ephemeris */
|
507
|
+
ext_def( void ) swe_close(void);
|
508
|
+
|
509
|
+
/* set directory path of ephemeris files */
|
510
|
+
ext_def( void ) swe_set_ephe_path(char *path);
|
511
|
+
|
512
|
+
/* set file name of JPL file */
|
513
|
+
ext_def( void ) swe_set_jpl_file(char *fname);
|
514
|
+
|
515
|
+
/* get planet name */
|
516
|
+
ext_def( char *) swe_get_planet_name(int ipl, char *spname);
|
517
|
+
|
518
|
+
/* set geographic position of observer */
|
519
|
+
ext_def (void) swe_set_topo(double geolon, double geolat, double geoalt);
|
520
|
+
|
521
|
+
/* set sidereal mode */
|
522
|
+
ext_def(void) swe_set_sid_mode(int32 sid_mode, double t0, double ayan_t0);
|
523
|
+
|
524
|
+
/* get ayanamsa */
|
525
|
+
ext_def(double) swe_get_ayanamsa(double tjd_et);
|
526
|
+
|
527
|
+
ext_def(double) swe_get_ayanamsa_ut(double tjd_ut);
|
528
|
+
|
529
|
+
ext_def( char *) swe_get_ayanamsa_name(int32 isidmode);
|
530
|
+
|
531
|
+
/****************************
|
532
|
+
* exports from swedate.c
|
533
|
+
****************************/
|
534
|
+
|
535
|
+
ext_def( int ) swe_date_conversion(
|
536
|
+
int y , int m , int d , /* year, month, day */
|
537
|
+
double utime, /* universal time in hours (decimal) */
|
538
|
+
char c, /* calendar g[regorian]|j[ulian] */
|
539
|
+
double *tjd);
|
540
|
+
|
541
|
+
ext_def( double ) swe_julday(
|
542
|
+
int year, int month, int day, double hour,
|
543
|
+
int gregflag);
|
544
|
+
|
545
|
+
ext_def( void ) swe_revjul (
|
546
|
+
double jd,
|
547
|
+
int gregflag,
|
548
|
+
int *jyear, int *jmon, int *jday, double *jut);
|
549
|
+
|
550
|
+
ext_def(int32) swe_utc_to_jd(
|
551
|
+
int32 iyear, int32 imonth, int32 iday,
|
552
|
+
int32 ihour, int32 imin, double dsec,
|
553
|
+
int32 gregflag, double *dret, char *serr);
|
554
|
+
|
555
|
+
ext_def(void) swe_jdet_to_utc(
|
556
|
+
double tjd_et, int32 gregflag,
|
557
|
+
int32 *iyear, int32 *imonth, int32 *iday,
|
558
|
+
int32 *ihour, int32 *imin, double *dsec);
|
559
|
+
|
560
|
+
ext_def(void) swe_jdut1_to_utc(
|
561
|
+
double tjd_ut, int32 gregflag,
|
562
|
+
int32 *iyear, int32 *imonth, int32 *iday,
|
563
|
+
int32 *ihour, int32 *imin, double *dsec);
|
564
|
+
|
565
|
+
ext_def(void) swe_utc_time_zone(
|
566
|
+
int32 iyear, int32 imonth, int32 iday,
|
567
|
+
int32 ihour, int32 imin, double dsec,
|
568
|
+
double d_timezone,
|
569
|
+
int32 *iyear_out, int32 *imonth_out, int32 *iday_out,
|
570
|
+
int32 *ihour_out, int32 *imin_out, double *dsec_out);
|
571
|
+
|
572
|
+
/****************************
|
573
|
+
* exports from swehouse.c
|
574
|
+
****************************/
|
575
|
+
|
576
|
+
ext_def( int ) swe_houses(
|
577
|
+
double tjd_ut, double geolat, double geolon, int hsys,
|
578
|
+
double *cusps, double *ascmc);
|
579
|
+
|
580
|
+
ext_def( int ) swe_houses_ex(
|
581
|
+
double tjd_ut, int32 iflag, double geolat, double geolon, int hsys,
|
582
|
+
double *cusps, double *ascmc);
|
583
|
+
|
584
|
+
ext_def( int ) swe_houses_armc(
|
585
|
+
double armc, double geolat, double eps, int hsys,
|
586
|
+
double *cusps, double *ascmc);
|
587
|
+
|
588
|
+
ext_def(double) swe_house_pos(
|
589
|
+
double armc, double geolat, double eps, int hsys, double *xpin, char *serr);
|
590
|
+
|
591
|
+
/****************************
|
592
|
+
* exports from swecl.c
|
593
|
+
****************************/
|
594
|
+
|
595
|
+
ext_def(int32) swe_gauquelin_sector(double t_ut, int32 ipl, char *starname, int32 iflag, int32 imeth, double *geopos, double atpress, double attemp, double *dgsect, char *serr);
|
596
|
+
|
597
|
+
/* computes geographic location and attributes of solar
|
598
|
+
* eclipse at a given tjd */
|
599
|
+
ext_def (int32) swe_sol_eclipse_where(double tjd, int32 ifl, double *geopos, double *attr, char *serr);
|
600
|
+
|
601
|
+
ext_def (int32) swe_lun_occult_where(double tjd, int32 ipl, char *starname, int32 ifl, double *geopos, double *attr, char *serr);
|
602
|
+
|
603
|
+
/* computes attributes of a solar eclipse for given tjd, geolon, geolat */
|
604
|
+
ext_def (int32) swe_sol_eclipse_how(double tjd, int32 ifl, double *geopos, double *attr, char *serr);
|
605
|
+
|
606
|
+
/* finds time of next local eclipse */
|
607
|
+
ext_def (int32) swe_sol_eclipse_when_loc(double tjd_start, int32 ifl, double *geopos, double *tret, double *attr, int32 backward, char *serr);
|
608
|
+
|
609
|
+
ext_def (int32) swe_lun_occult_when_loc(double tjd_start, int32 ipl, char *starname, int32 ifl,
|
610
|
+
double *geopos, double *tret, double *attr, int32 backward, char *serr);
|
611
|
+
|
612
|
+
/* finds time of next eclipse globally */
|
613
|
+
ext_def (int32) swe_sol_eclipse_when_glob(double tjd_start, int32 ifl, int32 ifltype,
|
614
|
+
double *tret, int32 backward, char *serr);
|
615
|
+
|
616
|
+
/* finds time of next occultation globally */
|
617
|
+
ext_def (int32) swe_lun_occult_when_glob(double tjd_start, int32 ipl, char *starname, int32 ifl, int32 ifltype,
|
618
|
+
double *tret, int32 backward, char *serr);
|
619
|
+
|
620
|
+
/* computes attributes of a lunar eclipse for given tjd */
|
621
|
+
ext_def (int32) swe_lun_eclipse_how(
|
622
|
+
double tjd_ut,
|
623
|
+
int32 ifl,
|
624
|
+
double *geopos,
|
625
|
+
double *attr,
|
626
|
+
char *serr);
|
627
|
+
|
628
|
+
ext_def (int32) swe_lun_eclipse_when(double tjd_start, int32 ifl, int32 ifltype,
|
629
|
+
double *tret, int32 backward, char *serr);
|
630
|
+
|
631
|
+
/* planetary phenomena */
|
632
|
+
ext_def (int32) swe_pheno(double tjd, int32 ipl, int32 iflag, double *attr, char *serr);
|
633
|
+
|
634
|
+
ext_def(int32) swe_pheno_ut(double tjd_ut, int32 ipl, int32 iflag, double *attr, char *serr);
|
635
|
+
|
636
|
+
ext_def (double) swe_refrac(double inalt, double atpress, double attemp, int32 calc_flag);
|
637
|
+
|
638
|
+
ext_def (double) swe_refrac_extended(double inalt, double geoalt, double atpress, double attemp, double lapse_rate, int32 calc_flag, double *dret);
|
639
|
+
|
640
|
+
ext_def (void) swe_set_lapse_rate(double lapse_rate);
|
641
|
+
|
642
|
+
ext_def (void) swe_azalt(
|
643
|
+
double tjd_ut,
|
644
|
+
int32 calc_flag,
|
645
|
+
double *geopos,
|
646
|
+
double atpress,
|
647
|
+
double attemp,
|
648
|
+
double *xin,
|
649
|
+
double *xaz);
|
650
|
+
|
651
|
+
ext_def (void) swe_azalt_rev(
|
652
|
+
double tjd_ut,
|
653
|
+
int32 calc_flag,
|
654
|
+
double *geopos,
|
655
|
+
double *xin,
|
656
|
+
double *xout);
|
657
|
+
|
658
|
+
ext_def (int32) swe_rise_trans(
|
659
|
+
double tjd_ut, int32 ipl, char *starname,
|
660
|
+
int32 epheflag, int32 rsmi,
|
661
|
+
double *geopos,
|
662
|
+
double atpress, double attemp,
|
663
|
+
double *tret,
|
664
|
+
char *serr);
|
665
|
+
|
666
|
+
ext_def (int32) swe_nod_aps(double tjd_et, int32 ipl, int32 iflag,
|
667
|
+
int32 method,
|
668
|
+
double *xnasc, double *xndsc,
|
669
|
+
double *xperi, double *xaphe,
|
670
|
+
char *serr);
|
671
|
+
|
672
|
+
ext_def (int32) swe_nod_aps_ut(double tjd_ut, int32 ipl, int32 iflag,
|
673
|
+
int32 method,
|
674
|
+
double *xnasc, double *xndsc,
|
675
|
+
double *xperi, double *xaphe,
|
676
|
+
char *serr);
|
677
|
+
|
678
|
+
|
679
|
+
/****************************
|
680
|
+
* exports from swephlib.c
|
681
|
+
****************************/
|
682
|
+
|
683
|
+
/* delta t */
|
684
|
+
ext_def( double ) swe_deltat(double tjd);
|
685
|
+
|
686
|
+
/* equation of time */
|
687
|
+
ext_def( int ) swe_time_equ(double tjd, double *te, char *serr);
|
688
|
+
|
689
|
+
/* sidereal time */
|
690
|
+
ext_def( double ) swe_sidtime0(double tjd_ut, double eps, double nut);
|
691
|
+
ext_def( double ) swe_sidtime(double tjd_ut);
|
692
|
+
|
693
|
+
/* coordinate transformation polar -> polar */
|
694
|
+
ext_def( void ) swe_cotrans(double *xpo, double *xpn, double eps);
|
695
|
+
ext_def( void ) swe_cotrans_sp(double *xpo, double *xpn, double eps);
|
696
|
+
|
697
|
+
/* tidal acceleration to be used in swe_deltat() */
|
698
|
+
ext_def( double ) swe_get_tid_acc(void);
|
699
|
+
ext_def( void ) swe_set_tid_acc(double t_acc);
|
700
|
+
|
701
|
+
ext_def( double ) swe_degnorm(double x);
|
702
|
+
ext_def( double ) swe_radnorm(double x);
|
703
|
+
ext_def( double ) swe_rad_midp(double x1, double x0);
|
704
|
+
ext_def( double ) swe_deg_midp(double x1, double x0);
|
705
|
+
|
706
|
+
ext_def( void ) swe_split_deg(double ddeg, int32 roundflag, int32 *ideg, int32 *imin, int32 *isec, double *dsecfr, int32 *isgn);
|
707
|
+
|
708
|
+
/*******************************************************
|
709
|
+
* other functions from swephlib.c;
|
710
|
+
* they are not needed for Swiss Ephemeris,
|
711
|
+
* but may be useful to former Placalc users.
|
712
|
+
********************************************************/
|
713
|
+
|
714
|
+
/* normalize argument into interval [0..DEG360] */
|
715
|
+
ext_def( centisec ) swe_csnorm(centisec p);
|
716
|
+
|
717
|
+
/* distance in centisecs p1 - p2 normalized to [0..360[ */
|
718
|
+
ext_def( centisec ) swe_difcsn (centisec p1, centisec p2);
|
719
|
+
|
720
|
+
ext_def( double ) swe_difdegn (double p1, double p2);
|
721
|
+
|
722
|
+
/* distance in centisecs p1 - p2 normalized to [-180..180[ */
|
723
|
+
ext_def( centisec ) swe_difcs2n(centisec p1, centisec p2);
|
724
|
+
|
725
|
+
ext_def( double ) swe_difdeg2n(double p1, double p2);
|
726
|
+
ext_def( double ) swe_difrad2n(double p1, double p2);
|
727
|
+
|
728
|
+
/* round second, but at 29.5959 always down */
|
729
|
+
ext_def( centisec ) swe_csroundsec(centisec x);
|
730
|
+
|
731
|
+
/* double to int32 with rounding, no overflow check */
|
732
|
+
ext_def( int32 ) swe_d2l(double x);
|
733
|
+
|
734
|
+
/* monday = 0, ... sunday = 6 */
|
735
|
+
ext_def( int ) swe_day_of_week(double jd);
|
736
|
+
|
737
|
+
ext_def( char *) swe_cs2timestr(CSEC t, int sep, AS_BOOL suppressZero, char *a);
|
738
|
+
|
739
|
+
ext_def( char *) swe_cs2lonlatstr(CSEC t, char pchar, char mchar, char *s);
|
740
|
+
|
741
|
+
ext_def( char *) swe_cs2degstr(CSEC t, char *a);
|
742
|
+
|
743
|
+
#endif /* #ifndef _SWEDLL_H */
|
744
|
+
|
745
|
+
#endif /* #ifndef _SWEPHEXP_INCLUDED */
|
746
|
+
|
747
|
+
#ifdef __cplusplus
|
748
|
+
} /* extern C */
|
749
|
+
#endif
|