@swisseph/node 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/binding.gyp +10 -10
- package/libswe/CMakeLists.txt +63 -0
- package/libswe/sefstars.txt +1590 -0
- package/libswe/seleapsec.txt +6 -0
- package/libswe/seorbel.txt +95 -0
- package/libswe/sweasp.c +1881 -0
- package/libswe/swecl.c +6430 -0
- package/libswe/sweclips.c +905 -0
- package/libswe/swedate.c +588 -0
- package/libswe/swedate.h +81 -0
- package/libswe/swedll.h +403 -0
- package/libswe/swedllst.c +690 -0
- package/libswe/sweephe4.c +694 -0
- package/libswe/sweephe4.h +239 -0
- package/libswe/swehel.c +3522 -0
- package/libswe/swehouse.c +3140 -0
- package/libswe/swehouse.h +98 -0
- package/libswe/swejpl.c +952 -0
- package/libswe/swejpl.h +103 -0
- package/libswe/swemini.c +73 -0
- package/libswe/swemmoon.c +1930 -0
- package/libswe/swemplan.c +967 -0
- package/libswe/swemptab.h +10640 -0
- package/libswe/swenut2000a.h +2819 -0
- package/libswe/sweodef.h +345 -0
- package/libswe/sweph.c +8615 -0
- package/libswe/sweph.h +849 -0
- package/libswe/swephexp.h +1025 -0
- package/libswe/swephgen4.c +309 -0
- package/libswe/swephlib.c +4634 -0
- package/libswe/swephlib.h +189 -0
- package/libswe/swetest.c +4079 -0
- package/libswe/swevents.c +2936 -0
- package/libswe/swevents.h +118 -0
- package/package.json +10 -7
|
@@ -0,0 +1,690 @@
|
|
|
1
|
+
/* SWISSEPH
|
|
2
|
+
*
|
|
3
|
+
* Windows DLL interface code for the Astrodienst SWISSEPH package
|
|
4
|
+
*/
|
|
5
|
+
/* Copyright (C) 1997 - 2021 Astrodienst AG, Switzerland. All rights reserved.
|
|
6
|
+
|
|
7
|
+
License conditions
|
|
8
|
+
------------------
|
|
9
|
+
|
|
10
|
+
This file is part of Swiss Ephemeris.
|
|
11
|
+
|
|
12
|
+
Swiss Ephemeris is distributed with NO WARRANTY OF ANY KIND. No author
|
|
13
|
+
or distributor accepts any responsibility for the consequences of using it,
|
|
14
|
+
or for whether it serves any particular purpose or works at all, unless he
|
|
15
|
+
or she says so in writing.
|
|
16
|
+
|
|
17
|
+
Swiss Ephemeris is made available by its authors under a dual licensing
|
|
18
|
+
system. The software developer, who uses any part of Swiss Ephemeris
|
|
19
|
+
in his or her software, must choose between one of the two license models,
|
|
20
|
+
which are
|
|
21
|
+
a) GNU Affero General Public License (AGPL)
|
|
22
|
+
b) Swiss Ephemeris Professional License
|
|
23
|
+
|
|
24
|
+
The choice must be made before the software developer distributes software
|
|
25
|
+
containing parts of Swiss Ephemeris to others, and before any public
|
|
26
|
+
service using the developed software is activated.
|
|
27
|
+
|
|
28
|
+
If the developer choses the AGPL software license, he or she must fulfill
|
|
29
|
+
the conditions of that license, which includes the obligation to place his
|
|
30
|
+
or her whole software project under the AGPL or a compatible license.
|
|
31
|
+
See https://www.gnu.org/licenses/agpl-3.0.html
|
|
32
|
+
|
|
33
|
+
If the developer choses the Swiss Ephemeris Professional license,
|
|
34
|
+
he must follow the instructions as found in http://www.astro.com/swisseph/
|
|
35
|
+
and purchase the Swiss Ephemeris Professional Edition from Astrodienst
|
|
36
|
+
and sign the corresponding license contract.
|
|
37
|
+
|
|
38
|
+
The License grants you the right to use, copy, modify and redistribute
|
|
39
|
+
Swiss Ephemeris, but only under certain conditions described in the License.
|
|
40
|
+
Among other things, the License requires that the copyright notices and
|
|
41
|
+
this notice be preserved on all copies.
|
|
42
|
+
|
|
43
|
+
Authors of the Swiss Ephemeris: Dieter Koch and Alois Treindl
|
|
44
|
+
|
|
45
|
+
The authors of Swiss Ephemeris have no control or influence over any of
|
|
46
|
+
the derived works, i.e. over software or services created by other
|
|
47
|
+
programmers which use Swiss Ephemeris functions.
|
|
48
|
+
|
|
49
|
+
The names of the authors or of the copyright holder (Astrodienst) must not
|
|
50
|
+
be used for promoting any software, product or service which uses or contains
|
|
51
|
+
the Swiss Ephemeris. This copyright notice is the ONLY place where the
|
|
52
|
+
names of the authors can legally appear, except in cases where they have
|
|
53
|
+
given special permission in writing.
|
|
54
|
+
|
|
55
|
+
The trademarks 'Swiss Ephemeris' and 'Swiss Ephemeris inside' may be used
|
|
56
|
+
for promoting such software, products or services.
|
|
57
|
+
*/
|
|
58
|
+
|
|
59
|
+
#include "swephexp.h"
|
|
60
|
+
|
|
61
|
+
/* Export stubs for the 32bit PLACALC DLL as generated using
|
|
62
|
+
Microsoft Developer Studio and Visual C/C++ 4.2 */
|
|
63
|
+
BOOL WINAPI DllMain(HANDLE hInst,
|
|
64
|
+
unsigned long ul_reason_for_call,
|
|
65
|
+
LPVOID lpReserved)
|
|
66
|
+
{
|
|
67
|
+
switch(ul_reason_for_call) {
|
|
68
|
+
case DLL_PROCESS_ATTACH:
|
|
69
|
+
dllhandle = hInst; // used by swe_version()
|
|
70
|
+
break;
|
|
71
|
+
case DLL_PROCESS_DETACH:
|
|
72
|
+
swe_close();
|
|
73
|
+
break;
|
|
74
|
+
default:
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
/* TRUE (1) indicates success */
|
|
78
|
+
return TRUE;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* The GFABASIC DLL interface does not support 8 and 64 bit data types.
|
|
82
|
+
* The following functions avoid problems with doubles by use of
|
|
83
|
+
* pointers of doubles instead of doubles.
|
|
84
|
+
* VOID is not supported either. We declare VOID functions int
|
|
85
|
+
* and ignore the result.
|
|
86
|
+
*/
|
|
87
|
+
|
|
88
|
+
/* planets, moon, nodes etc. */
|
|
89
|
+
extern EXP32 long CALL_CONV swe_calc_d(
|
|
90
|
+
double *tjd, int ipl, long iflag,
|
|
91
|
+
double *xx,
|
|
92
|
+
char *serr);
|
|
93
|
+
|
|
94
|
+
/* planets, moon, nodes etc. */
|
|
95
|
+
extern EXP32 long CALL_CONV swe_calc_ut_d(
|
|
96
|
+
double *tjd_ut, int ipl, long iflag,
|
|
97
|
+
double *xx,
|
|
98
|
+
char *serr);
|
|
99
|
+
|
|
100
|
+
/* fixed stars */
|
|
101
|
+
extern EXP32 long CALL_CONV swe_fixstar_d(
|
|
102
|
+
char *star, double *tjd, long iflag,
|
|
103
|
+
double *xx,
|
|
104
|
+
char *serr);
|
|
105
|
+
|
|
106
|
+
/* fixed stars */
|
|
107
|
+
extern EXP32 long CALL_CONV swe_fixstar_ut_d(
|
|
108
|
+
char *star, double *tjd_ut, long iflag,
|
|
109
|
+
double *xx,
|
|
110
|
+
char *serr);
|
|
111
|
+
|
|
112
|
+
/* close Swiss Ephemeris */
|
|
113
|
+
extern EXP32 int CALL_CONV swe_close_d(int ivoid);
|
|
114
|
+
|
|
115
|
+
/* set directory path of ephemeris files */
|
|
116
|
+
extern EXP32 int CALL_CONV swe_set_ephe_path_d(char *path);
|
|
117
|
+
|
|
118
|
+
/* set file name of JPL file */
|
|
119
|
+
extern EXP32 int CALL_CONV swe_set_jpl_file_d(char *fname);
|
|
120
|
+
|
|
121
|
+
/* get planet name */
|
|
122
|
+
extern EXP32 char *CALL_CONV swe_get_planet_name_d(int ipl, char *spname);
|
|
123
|
+
|
|
124
|
+
/* set sidereal mode */
|
|
125
|
+
extern EXP32 int CALL_CONV swe_set_sid_mode_d(long sid_mode, double *t0, double *ayan_t0);
|
|
126
|
+
|
|
127
|
+
/* get ayanamsa */
|
|
128
|
+
extern EXP32 int CALL_CONV swe_get_ayanamsa_d(double *tjd_et, double *ayan);
|
|
129
|
+
|
|
130
|
+
/* get ayanamsa */
|
|
131
|
+
extern EXP32 int CALL_CONV swe_get_ayanamsa_ut_d(double *tjd_ut, double *ayan);
|
|
132
|
+
|
|
133
|
+
/* delta t */
|
|
134
|
+
extern EXP32 int CALL_CONV swe_deltat_d(double *tjd, double *deltat);
|
|
135
|
+
|
|
136
|
+
/* sidereal time */
|
|
137
|
+
extern EXP32 int CALL_CONV swe_sidtime0_d(
|
|
138
|
+
double *tjd_ut, double *eps, double *nut, double *sidt);
|
|
139
|
+
extern EXP32 int CALL_CONV swe_sidtime_d(
|
|
140
|
+
double *tjd_ut, double *sidt);
|
|
141
|
+
|
|
142
|
+
/* set geographic location for topocentric planet calculation */
|
|
143
|
+
extern EXP32 int CALL_CONV swe_set_topo_d(double *geolon, double *geolat, double *height);
|
|
144
|
+
|
|
145
|
+
/* coordinate transformation polar -> polar */
|
|
146
|
+
extern EXP32 int CALL_CONV swe_cotrans_d(double *xpo, double *xpn, double *eps);
|
|
147
|
+
extern EXP32 int CALL_CONV swe_cotrans_sp_d(double *xpo, double *xpn, double *eps);
|
|
148
|
+
|
|
149
|
+
/* tidal acceleration to be used in swe_deltat() */
|
|
150
|
+
extern EXP32 int CALL_CONV swe_get_tid_acc_d(double *t_acc);
|
|
151
|
+
extern EXP32 int CALL_CONV swe_set_tid_acc_d(double *t_acc);
|
|
152
|
+
|
|
153
|
+
extern EXP32 int CALL_CONV swe_degnorm_d(double *x);
|
|
154
|
+
|
|
155
|
+
extern EXP32 int CALL_CONV swe_date_conversion_d(
|
|
156
|
+
int y , int m , int d , /* year, month, day */
|
|
157
|
+
double *utime, /* universal time in hours (decimal) */
|
|
158
|
+
char *c, /* calendar g[regorian]|j[ulian]|a[stro = greg] */
|
|
159
|
+
double *tjd);
|
|
160
|
+
|
|
161
|
+
extern EXP32 int CALL_CONV swe_julday_d(
|
|
162
|
+
int year, int month, int day, double *hour,
|
|
163
|
+
int gregflag, double *tjd);
|
|
164
|
+
|
|
165
|
+
extern EXP32 int CALL_CONV swe_revjul_d(
|
|
166
|
+
double *tjd,
|
|
167
|
+
int gregflag,
|
|
168
|
+
int *jyear, int *jmon, int *jday, double *jut);
|
|
169
|
+
|
|
170
|
+
extern EXP32 int CALL_CONV swe_time_equ_d(
|
|
171
|
+
double *tjd,
|
|
172
|
+
double *e,
|
|
173
|
+
char *serr);
|
|
174
|
+
|
|
175
|
+
extern EXP32 int CALL_CONV swe_houses_d(
|
|
176
|
+
double *tjd_ut, double *geolat, double *geolon, int hsys,
|
|
177
|
+
double *cusps, double *ascmc);
|
|
178
|
+
|
|
179
|
+
extern EXP32 int CALL_CONV swe_houses_ex_d(
|
|
180
|
+
double *tjd_ut, int32 iflag, double *geolat, double *geolon, int hsys,
|
|
181
|
+
double *hcusps, double *ascmc);
|
|
182
|
+
|
|
183
|
+
extern EXP32 int CALL_CONV swe_houses_armc_d(
|
|
184
|
+
double *armc, double *geolat, double *eps, int hsys,
|
|
185
|
+
double *cusps, double *ascmc);
|
|
186
|
+
|
|
187
|
+
extern EXP32 int CALL_CONV swe_house_pos_d(
|
|
188
|
+
double *armc, double *geolat, double *eps, int hsys, double *xpin,
|
|
189
|
+
double *hpos, char *serr);
|
|
190
|
+
|
|
191
|
+
/* normalize argument into interval [0..DEG360] */
|
|
192
|
+
extern EXP32 centisec CALL_CONV swe_csnorm_d(centisec p);
|
|
193
|
+
|
|
194
|
+
/* distance in centisecs p1 - p2 normalized to [0..360[ */
|
|
195
|
+
extern EXP32 centisec CALL_CONV swe_difcsn_d(centisec p1, centisec p2);
|
|
196
|
+
|
|
197
|
+
extern EXP32 int CALL_CONV swe_difdegn_d(double *p1, double *p2, double *diff);
|
|
198
|
+
|
|
199
|
+
/* distance in centisecs p1 - p2 normalized to [-180..180[ */
|
|
200
|
+
extern EXP32 centisec CALL_CONV swe_difcs2n_d(centisec p1, centisec p2);
|
|
201
|
+
|
|
202
|
+
extern EXP32 int CALL_CONV swe_difdeg2n_d(double *p1, double *p2, double *diff);
|
|
203
|
+
|
|
204
|
+
/* round second, but at 29.5959 always down */
|
|
205
|
+
extern EXP32 centisec CALL_CONV swe_csroundsec_d(centisec x);
|
|
206
|
+
|
|
207
|
+
/* double to long with rounding, no overflow check */
|
|
208
|
+
extern EXP32 long CALL_CONV swe_d2l_d(double *x);
|
|
209
|
+
|
|
210
|
+
extern EXP32 int CALL_CONV swe_split_deg_d(double *ddeg, int32 roundflag, int32 *ideg, int32 *imin, int32 *isec, double *dsecfr, int32 *isgn);
|
|
211
|
+
|
|
212
|
+
/* monday = 0, ... sunday = 6 */
|
|
213
|
+
extern EXP32 int CALL_CONV swe_day_of_week_d(double *jd);
|
|
214
|
+
|
|
215
|
+
extern EXP32 char *CALL_CONV swe_cs2timestr_d(CSEC t, int sep, AS_BOOL suppressZero, char *a);
|
|
216
|
+
|
|
217
|
+
extern EXP32 char *CALL_CONV swe_cs2lonlatstr_d(CSEC t, char *pchar, char *mchar, char *s);
|
|
218
|
+
|
|
219
|
+
extern EXP32 char *CALL_CONV swe_cs2degstr_d(CSEC t, char *a);
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
/****************************
|
|
223
|
+
* from swecl.c
|
|
224
|
+
****************************/
|
|
225
|
+
|
|
226
|
+
/* computes geographic location and attributes of solar
|
|
227
|
+
* eclipse at a given tjd */
|
|
228
|
+
extern EXP32 int32 CALL_CONV swe_sol_eclipse_where_d(double *tjd_ut, int32 ifl, double *geopos, double *attr, char *serr);
|
|
229
|
+
|
|
230
|
+
/* computes attributes of a solar eclipse for given tjd, geolon, geolat */
|
|
231
|
+
extern EXP32 int32 CALL_CONV swe_sol_eclipse_how_d(double *tjd_ut, int32 ifl, double *geopos, double *attr, char *serr);
|
|
232
|
+
/* finds time of next local eclipse */
|
|
233
|
+
|
|
234
|
+
extern EXP32 int32 CALL_CONV swe_sol_eclipse_when_loc_d(double *tjd_start, int32 ifl, double *geopos, double *tret, double *attr, AS_BOOL backward, char *serr);
|
|
235
|
+
|
|
236
|
+
/* finds time of next eclipse globally */
|
|
237
|
+
extern EXP32 int32 CALL_CONV swe_sol_eclipse_when_glob_d(double *tjd_start, int32 ifl, int32 ifltype,
|
|
238
|
+
double *tret, AS_BOOL backward, char *serr);
|
|
239
|
+
|
|
240
|
+
/* computes attributes of a lunar eclipse for given tjd */
|
|
241
|
+
extern EXP32 int32 CALL_CONV swe_lun_eclipse_how_d(
|
|
242
|
+
double *tjd_ut,
|
|
243
|
+
int32 ifl,
|
|
244
|
+
double *geopos,
|
|
245
|
+
double *attr,
|
|
246
|
+
char *serr);
|
|
247
|
+
extern EXP32 int32 CALL_CONV swe_lun_eclipse_when_d(double *tjd_start, int32 ifl, int32 ifltype,
|
|
248
|
+
double *tret, AS_BOOL backward, char *serr);
|
|
249
|
+
|
|
250
|
+
/* planetary phenomena */
|
|
251
|
+
extern EXP32 int32 CALL_CONV swe_pheno_d(double *tjd, int32 ipl, int32 iflag,
|
|
252
|
+
double *attr, char *serr);
|
|
253
|
+
|
|
254
|
+
extern EXP32 int32 CALL_CONV swe_pheno_ut_d(double *tjd_ut, int32 ipl, int32 iflag, double *attr, char *serr);
|
|
255
|
+
|
|
256
|
+
extern EXP32 int CALL_CONV swe_refrac_d(double *inalt, double *atpress, double *attemp, int32 calc_flag, double *retalt);
|
|
257
|
+
|
|
258
|
+
extern EXP32 int CALL_CONV swe_azalt_d(
|
|
259
|
+
double *tjd_ut,
|
|
260
|
+
int32 calc_flag,
|
|
261
|
+
double *geopos,
|
|
262
|
+
double *atpress,
|
|
263
|
+
double *attemp,
|
|
264
|
+
double *xin,
|
|
265
|
+
double *xaz);
|
|
266
|
+
|
|
267
|
+
extern EXP32 int CALL_CONV swe_azalt_rev_d(
|
|
268
|
+
double *tjd_ut,
|
|
269
|
+
int32 calc_flag,
|
|
270
|
+
double *geopos,
|
|
271
|
+
double *xin,
|
|
272
|
+
double *xout);
|
|
273
|
+
|
|
274
|
+
extern EXP32 int32 CALL_CONV swe_rise_trans_d(
|
|
275
|
+
double *tjd_ut, int32 ipl, char *starname,
|
|
276
|
+
int32 epheflag, int32 rsmi,
|
|
277
|
+
double *geopos,
|
|
278
|
+
double *atpress, double *attemp,
|
|
279
|
+
double *tret,
|
|
280
|
+
char *serr);
|
|
281
|
+
|
|
282
|
+
extern EXP32 int32 CALL_CONV swe_nod_aps_d(double *tjd_et, int32 ipl, int32 iflag,
|
|
283
|
+
int32 method,
|
|
284
|
+
double *xnasc, double *xndsc,
|
|
285
|
+
double *xperi, double *xaphe,
|
|
286
|
+
char *serr);
|
|
287
|
+
|
|
288
|
+
extern EXP32 int32 CALL_CONV swe_nod_aps_ut_d(double *tjd_ut, int32 ipl, int32 iflag,
|
|
289
|
+
int32 method,
|
|
290
|
+
double *xnasc, double *xndsc,
|
|
291
|
+
double *xperi, double *xaphe,
|
|
292
|
+
char *serr);
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
/**************************/
|
|
296
|
+
/* modified DLL functions */
|
|
297
|
+
/**************************/
|
|
298
|
+
|
|
299
|
+
/* planets, moon, nodes etc. */
|
|
300
|
+
long CALL_CONV swe_calc_d(
|
|
301
|
+
double *tjd, int ipl, long iflag,
|
|
302
|
+
double *xx,
|
|
303
|
+
char *serr)
|
|
304
|
+
{
|
|
305
|
+
return swe_calc(*tjd, ipl, iflag, xx, serr);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/* planets, moon, nodes etc. */
|
|
309
|
+
long CALL_CONV swe_calc_ut_d(
|
|
310
|
+
double *tjd_ut, int ipl, long iflag,
|
|
311
|
+
double *xx,
|
|
312
|
+
char *serr)
|
|
313
|
+
{
|
|
314
|
+
return swe_calc(*tjd_ut, ipl, iflag, xx, serr);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/* fixed stars */
|
|
318
|
+
long CALL_CONV swe_fixstar_d(
|
|
319
|
+
char *star, double *tjd, long iflag,
|
|
320
|
+
double *xx, char *serr)
|
|
321
|
+
{
|
|
322
|
+
return swe_fixstar(star, *tjd, iflag, xx, serr);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
/* fixed stars */
|
|
326
|
+
long CALL_CONV swe_fixstar_ut_d(
|
|
327
|
+
char *star, double *tjd_ut, long iflag,
|
|
328
|
+
double *xx, char *serr)
|
|
329
|
+
{
|
|
330
|
+
return swe_fixstar(star, *tjd_ut, iflag, xx, serr);
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
/* close Swiss Ephemeris */
|
|
334
|
+
int CALL_CONV swe_close_d(int ivoid)
|
|
335
|
+
{
|
|
336
|
+
swe_close();
|
|
337
|
+
return OK;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/* set directory path of ephemeris files */
|
|
341
|
+
int CALL_CONV swe_set_ephe_path_d(char *path)
|
|
342
|
+
{
|
|
343
|
+
swe_set_ephe_path(path);
|
|
344
|
+
return OK;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
/* set file name of JPL file */
|
|
348
|
+
int CALL_CONV swe_set_jpl_file_d(char *fname)
|
|
349
|
+
{
|
|
350
|
+
swe_set_jpl_file(fname);
|
|
351
|
+
return OK;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/* get planet name */
|
|
355
|
+
char *CALL_CONV swe_get_planet_name_d(int ipl, char *spname)
|
|
356
|
+
{
|
|
357
|
+
return swe_get_planet_name(ipl, spname);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
/* get planet name */
|
|
361
|
+
int CALL_CONV swe_set_sid_mode_d(long sid_mode, double *t0, double *ayan_t0)
|
|
362
|
+
{
|
|
363
|
+
swe_set_sid_mode(sid_mode, *t0, *ayan_t0);
|
|
364
|
+
return OK;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
/* get planet name */
|
|
368
|
+
int CALL_CONV swe_get_ayanamsa_d(double *tjd_et, double *ayan)
|
|
369
|
+
{
|
|
370
|
+
*ayan = swe_get_ayanamsa(*tjd_et);
|
|
371
|
+
return OK;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
/* get planet name */
|
|
375
|
+
int CALL_CONV swe_get_ayanamsa_ut_d(double *tjd_ut, double *ayan)
|
|
376
|
+
{
|
|
377
|
+
*ayan = swe_get_ayanamsa(*tjd_ut);
|
|
378
|
+
return OK;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/* delta t */
|
|
382
|
+
int CALL_CONV swe_deltat_d(double *tjd, double *deltat)
|
|
383
|
+
{
|
|
384
|
+
*deltat = swe_deltat(*tjd);
|
|
385
|
+
return OK;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
/* sidereal time */
|
|
389
|
+
int CALL_CONV swe_sidtime0_d(double *tjd, double *eps,
|
|
390
|
+
double *nut, double *sidt)
|
|
391
|
+
{
|
|
392
|
+
*sidt = swe_sidtime0(*tjd, *eps, *nut);
|
|
393
|
+
return OK;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
/* sidereal time */
|
|
397
|
+
int CALL_CONV swe_sidtime_d(double *tjd, double *sidt)
|
|
398
|
+
{
|
|
399
|
+
*sidt = swe_sidtime(*tjd);
|
|
400
|
+
return OK;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
/* set geographic location for topocentric planet calculation */
|
|
404
|
+
int CALL_CONV swe_set_topo_d(double *geolon, double *geolat, double *height)
|
|
405
|
+
{
|
|
406
|
+
swe_set_topo(*geolon, *geolat, *height);
|
|
407
|
+
return OK;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
/* coordinate transformation polar -> polar */
|
|
411
|
+
int CALL_CONV swe_cotrans_d(double *xpo, double *xpn, double *eps)
|
|
412
|
+
{
|
|
413
|
+
swe_cotrans(xpo, xpn, *eps);
|
|
414
|
+
return OK;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
int CALL_CONV swe_cotrans_sp_d(double *xpo, double *xpn, double *eps)
|
|
418
|
+
{
|
|
419
|
+
swe_cotrans_sp(xpo, xpn, *eps);
|
|
420
|
+
return OK;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
/* tidal acceleration to be used in swe_deltat() */
|
|
424
|
+
int CALL_CONV swe_get_tid_acc_d(double *t_acc)
|
|
425
|
+
{
|
|
426
|
+
*t_acc = swe_get_tid_acc();
|
|
427
|
+
return OK;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
int CALL_CONV swe_set_tid_acc_d(double *t_acc)
|
|
431
|
+
{
|
|
432
|
+
swe_set_tid_acc(*t_acc);
|
|
433
|
+
return OK;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
int CALL_CONV swe_degnorm_d(double *x)
|
|
437
|
+
{
|
|
438
|
+
*x = swe_degnorm(*x);
|
|
439
|
+
return OK;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
int CALL_CONV swe_date_conversion_d(
|
|
443
|
+
int y , int m , int d , /* year, month, day */
|
|
444
|
+
double *utime, /* universal time in hours (decimal) */
|
|
445
|
+
char *c, /* calendar g[regorian]|j[ulian]|a[stro = greg] */
|
|
446
|
+
double *tjd)
|
|
447
|
+
{
|
|
448
|
+
return swe_date_conversion(y, m, d, *utime, *c, tjd);
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
int CALL_CONV swe_julday_d(
|
|
452
|
+
int year, int month, int day, double *hour,
|
|
453
|
+
int gregflag, double *tjd)
|
|
454
|
+
{
|
|
455
|
+
*tjd = swe_julday(year, month, day, *hour, gregflag);
|
|
456
|
+
return OK;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
int CALL_CONV swe_revjul_d(
|
|
460
|
+
double *tjd,
|
|
461
|
+
int gregflag,
|
|
462
|
+
int *jyear, int *jmon, int *jday, double *jut)
|
|
463
|
+
{
|
|
464
|
+
swe_revjul(*tjd, gregflag, jyear, jmon, jday, jut);
|
|
465
|
+
return OK;
|
|
466
|
+
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
int CALL_CONV swe_time_equ_d(
|
|
470
|
+
double *tjd,
|
|
471
|
+
double *e,
|
|
472
|
+
char *serr)
|
|
473
|
+
{
|
|
474
|
+
return swe_time_equ(*tjd, e, serr);
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
int CALL_CONV swe_houses_d(
|
|
478
|
+
double *tjd_ut, double *geolat, double *geolon, int hsys,
|
|
479
|
+
double *cusps, double *ascmc)
|
|
480
|
+
{
|
|
481
|
+
return swe_houses(*tjd_ut, *geolat, *geolon, hsys, cusps, ascmc);
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
int CALL_CONV swe_houses_ex_d(
|
|
485
|
+
double *tjd_ut, int32 iflag, double *geolat, double *geolon, int hsys,
|
|
486
|
+
double *cusps, double *ascmc)
|
|
487
|
+
{
|
|
488
|
+
return swe_houses_ex(*tjd_ut, iflag, *geolat, *geolon, hsys, cusps, ascmc);
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
int CALL_CONV swe_houses_armc_d(
|
|
492
|
+
double *armc, double *geolat, double *eps, int hsys,
|
|
493
|
+
double *cusps, double *ascmc)
|
|
494
|
+
{
|
|
495
|
+
return swe_houses_armc(*armc, *geolat, *eps, hsys, cusps, ascmc);
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
extern EXP32 int CALL_CONV swe_house_pos_d(
|
|
499
|
+
double *armc, double *geolat, double *eps, int hsys, double *xpin,
|
|
500
|
+
double *hpos, char *serr)
|
|
501
|
+
{
|
|
502
|
+
*hpos = swe_house_pos(*armc, *geolat, *eps, hsys, xpin, serr);
|
|
503
|
+
if (*hpos == 0)
|
|
504
|
+
return ERR;
|
|
505
|
+
else
|
|
506
|
+
return OK;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
/* normalize argument into interval [0..DEG360] */
|
|
510
|
+
centisec CALL_CONV swe_csnorm_d(centisec p)
|
|
511
|
+
{
|
|
512
|
+
return swe_csnorm(p);
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
/* distance in centisecs p1 - p2 normalized to [0..360[ */
|
|
516
|
+
centisec CALL_CONV swe_difcsn_d(centisec p1, centisec p2)
|
|
517
|
+
{
|
|
518
|
+
return swe_difcsn(p1, p2);
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
int CALL_CONV swe_difdegn_d(double *p1, double *p2, double *diff)
|
|
522
|
+
{
|
|
523
|
+
*diff = swe_difdegn(*p1, *p2);
|
|
524
|
+
return OK;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
/* distance in centisecs p1 - p2 normalized to [-180..180[ */
|
|
528
|
+
centisec CALL_CONV swe_difcs2n_d(centisec p1, centisec p2)
|
|
529
|
+
{
|
|
530
|
+
return swe_difcs2n(p1, p2);
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
int CALL_CONV swe_difdeg2n_d(double *p1, double *p2, double *diff)
|
|
534
|
+
{
|
|
535
|
+
*diff = swe_difdeg2n(*p1, *p2);
|
|
536
|
+
return OK;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
/* round second, but at 29.5959 always down */
|
|
540
|
+
centisec CALL_CONV swe_csroundsec_d(centisec x)
|
|
541
|
+
{
|
|
542
|
+
return swe_csroundsec(x);
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
/* double to long with rounding, no overflow check */
|
|
546
|
+
long CALL_CONV swe_d2l_d(double *x)
|
|
547
|
+
{
|
|
548
|
+
return swe_d2l(*x);
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
int CALL_CONV swe_split_deg_d(double *ddeg, int32 roundflag, int32 *ideg, int32 *imin, int32 *isec, double *dsecfr, int32 *isgn)
|
|
552
|
+
{
|
|
553
|
+
swe_split_deg(*ddeg, roundflag, ideg, imin, isec, dsecfr, isgn);
|
|
554
|
+
return 0;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
/* monday = 0, ... sunday = 6 */
|
|
558
|
+
int CALL_CONV swe_day_of_week_d(double *jd)
|
|
559
|
+
{
|
|
560
|
+
return swe_day_of_week(*jd);
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
char *CALL_CONV swe_cs2timestr_d(CSEC t, int sep, AS_BOOL suppressZero, char *a)
|
|
564
|
+
{
|
|
565
|
+
return swe_cs2timestr(t, sep, suppressZero, a);
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
char *CALL_CONV swe_cs2lonlatstr_d(CSEC t, char *pchar, char *mchar, char *s)
|
|
569
|
+
{
|
|
570
|
+
return swe_cs2lonlatstr(t, *pchar, *mchar, s);
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
char *CALL_CONV swe_cs2degstr_d(CSEC t, char *a)
|
|
574
|
+
{
|
|
575
|
+
return swe_cs2degstr(t, a);
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
|
|
579
|
+
/* computes geographic location and attributes of solar
|
|
580
|
+
* eclipse at a given tjd */
|
|
581
|
+
int32 CALL_CONV swe_sol_eclipse_where_d(double *tjd_ut, int32 ifl, double *geopos, double *attr, char *serr)
|
|
582
|
+
{
|
|
583
|
+
return swe_sol_eclipse_where(*tjd_ut, ifl, geopos, attr, serr);
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
/* computes attributes of a solar eclipse for given tjd, geolon, geolat */
|
|
587
|
+
int32 CALL_CONV swe_sol_eclipse_how_d(double *tjd_ut, int32 ifl, double *geopos, double *attr, char *serr)
|
|
588
|
+
{
|
|
589
|
+
return swe_sol_eclipse_how(*tjd_ut, ifl, geopos, attr, serr);
|
|
590
|
+
}
|
|
591
|
+
/* finds time of next local eclipse */
|
|
592
|
+
int32 CALL_CONV swe_sol_eclipse_when_loc_d(double *tjd_start, int32 ifl, double *geopos, double *tret, double *attr, AS_BOOL backward, char *serr)
|
|
593
|
+
{
|
|
594
|
+
return swe_sol_eclipse_when_loc(*tjd_start, ifl, geopos, tret, attr, backward, serr);
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
/* finds time of next eclipse globally */
|
|
598
|
+
int32 CALL_CONV swe_sol_eclipse_when_glob_d(double *tjd_start, int32 ifl, int32 ifltype,
|
|
599
|
+
double *tret, AS_BOOL backward, char *serr)
|
|
600
|
+
{
|
|
601
|
+
return swe_sol_eclipse_when_glob(*tjd_start, ifl, ifltype, tret, backward, serr);
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
/* computes attributes of a lunar eclipse for given tjd */
|
|
605
|
+
int32 CALL_CONV swe_lun_eclipse_how_d(
|
|
606
|
+
double *tjd_ut,
|
|
607
|
+
int32 ifl,
|
|
608
|
+
double *geopos,
|
|
609
|
+
double *attr,
|
|
610
|
+
char *serr)
|
|
611
|
+
{
|
|
612
|
+
return swe_lun_eclipse_how(*tjd_ut, ifl, geopos, attr, serr);
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
int32 CALL_CONV swe_lun_eclipse_when_d(double *tjd_start, int32 ifl, int32 ifltype,
|
|
616
|
+
double *tret, AS_BOOL backward, char *serr)
|
|
617
|
+
{
|
|
618
|
+
return swe_lun_eclipse_when(*tjd_start, ifl, ifltype, tret, backward, serr);
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
int32 CALL_CONV swe_pheno_d(double *tjd, int32 ipl, int32 iflag,
|
|
622
|
+
double *attr, char *serr)
|
|
623
|
+
{
|
|
624
|
+
return swe_pheno(*tjd, ipl, iflag, attr, serr);
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
int32 CALL_CONV swe_pheno_ut_d(double *tjd_ut, int32 ipl, int32 iflag, double *attr, char *serr)
|
|
628
|
+
{
|
|
629
|
+
return swe_pheno_ut(*tjd_ut, ipl, iflag, attr, serr);
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
int CALL_CONV swe_refrac_d(double *inalt, double *atpress, double *attemp, int32 calc_flag, double *retalt)
|
|
633
|
+
{
|
|
634
|
+
*retalt = swe_refrac(*inalt, *atpress, *attemp, calc_flag);
|
|
635
|
+
return OK;
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
int CALL_CONV swe_azalt_d(
|
|
639
|
+
double *tjd_ut,
|
|
640
|
+
int32 calc_flag,
|
|
641
|
+
double *geopos,
|
|
642
|
+
double *atpress,
|
|
643
|
+
double *attemp,
|
|
644
|
+
double *xin,
|
|
645
|
+
double *xaz)
|
|
646
|
+
{
|
|
647
|
+
swe_azalt(*tjd_ut, calc_flag, geopos, *atpress, *attemp, xin, xaz);
|
|
648
|
+
return OK;
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
int CALL_CONV swe_azalt_rev_d(
|
|
652
|
+
double *tjd_ut,
|
|
653
|
+
int32 calc_flag,
|
|
654
|
+
double *geopos,
|
|
655
|
+
double *xin,
|
|
656
|
+
double *xout)
|
|
657
|
+
{
|
|
658
|
+
swe_azalt_rev(*tjd_ut, calc_flag, geopos, xin, xout);
|
|
659
|
+
return OK;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
int32 CALL_CONV swe_rise_trans_d(
|
|
663
|
+
double *tjd_ut, int32 ipl, char *starname,
|
|
664
|
+
int32 epheflag, int32 rsmi,
|
|
665
|
+
double *geopos,
|
|
666
|
+
double *atpress, double *attemp,
|
|
667
|
+
double *tret,
|
|
668
|
+
char *serr)
|
|
669
|
+
{
|
|
670
|
+
return swe_rise_trans(*tjd_ut, ipl, starname, epheflag, rsmi,
|
|
671
|
+
geopos, *atpress, *attemp, tret, serr);
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
int32 CALL_CONV swe_nod_aps_d(double *tjd_et, int32 ipl, int32 iflag,
|
|
675
|
+
int32 method,
|
|
676
|
+
double *xnasc, double *xndsc,
|
|
677
|
+
double *xperi, double *xaphe,
|
|
678
|
+
char *serr)
|
|
679
|
+
{
|
|
680
|
+
return swe_nod_aps(*tjd_et, ipl, iflag, method, xnasc, xndsc, xperi, xaphe, serr);
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
int32 CALL_CONV swe_nod_aps_ut_d(double *tjd_ut, int32 ipl, int32 iflag,
|
|
684
|
+
int32 method,
|
|
685
|
+
double *xnasc, double *xndsc,
|
|
686
|
+
double *xperi, double *xaphe,
|
|
687
|
+
char *serr)
|
|
688
|
+
{
|
|
689
|
+
return swe_nod_aps(*tjd_ut, ipl, iflag, method, xnasc, xndsc, xperi, xaphe, serr);
|
|
690
|
+
}
|