@swisseph/node 1.0.1 → 1.0.3

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/libswe/sweph.h ADDED
@@ -0,0 +1,849 @@
1
+ /************************************************************
2
+ definitions and constants SWISSEPH
3
+
4
+ Authors: Dieter Koch and Alois Treindl, Astrodienst Zurich
5
+
6
+ ************************************************************/
7
+ /* Copyright (C) 1997 - 2021 Astrodienst AG, Switzerland. All rights reserved.
8
+
9
+ License conditions
10
+ ------------------
11
+
12
+ This file is part of Swiss Ephemeris.
13
+
14
+ Swiss Ephemeris is distributed with NO WARRANTY OF ANY KIND. No author
15
+ or distributor accepts any responsibility for the consequences of using it,
16
+ or for whether it serves any particular purpose or works at all, unless he
17
+ or she says so in writing.
18
+
19
+ Swiss Ephemeris is made available by its authors under a dual licensing
20
+ system. The software developer, who uses any part of Swiss Ephemeris
21
+ in his or her software, must choose between one of the two license models,
22
+ which are
23
+ a) GNU Affero General Public License (AGPL)
24
+ b) Swiss Ephemeris Professional License
25
+
26
+ The choice must be made before the software developer distributes software
27
+ containing parts of Swiss Ephemeris to others, and before any public
28
+ service using the developed software is activated.
29
+
30
+ If the developer choses the AGPL software license, he or she must fulfill
31
+ the conditions of that license, which includes the obligation to place his
32
+ or her whole software project under the AGPL or a compatible license.
33
+ See https://www.gnu.org/licenses/agpl-3.0.html
34
+
35
+ If the developer choses the Swiss Ephemeris Professional license,
36
+ he must follow the instructions as found in http://www.astro.com/swisseph/
37
+ and purchase the Swiss Ephemeris Professional Edition from Astrodienst
38
+ and sign the corresponding license contract.
39
+
40
+ The License grants you the right to use, copy, modify and redistribute
41
+ Swiss Ephemeris, but only under certain conditions described in the License.
42
+ Among other things, the License requires that the copyright notices and
43
+ this notice be preserved on all copies.
44
+
45
+ Authors of the Swiss Ephemeris: Dieter Koch and Alois Treindl
46
+
47
+ The authors of Swiss Ephemeris have no control or influence over any of
48
+ the derived works, i.e. over software or services created by other
49
+ programmers which use Swiss Ephemeris functions.
50
+
51
+ The names of the authors or of the copyright holder (Astrodienst) must not
52
+ be used for promoting any software, product or service which uses or contains
53
+ the Swiss Ephemeris. This copyright notice is the ONLY place where the
54
+ names of the authors can legally appear, except in cases where they have
55
+ given special permission in writing.
56
+
57
+ The trademarks 'Swiss Ephemeris' and 'Swiss Ephemeris inside' may be used
58
+ for promoting such software, products or services.
59
+ */
60
+
61
+ /*
62
+ * move over from swephexp.h
63
+ */
64
+
65
+ #define SE_VERSION "2.10.03"
66
+
67
+ #define J2000 2451545.0 /* 2000 January 1.5 */
68
+ #define B1950 2433282.42345905 /* 1950 January 0.923 */
69
+ #define J1900 2415020.0 /* 1900 January 0.5 */
70
+ #define B1850 2396758.2035810 /* 1850 January 16:53 */
71
+
72
+ #define MPC_CERES 1
73
+ #define MPC_PALLAS 2
74
+ #define MPC_JUNO 3
75
+ #define MPC_VESTA 4
76
+ #define MPC_CHIRON 2060
77
+ #define MPC_PHOLUS 5145
78
+
79
+ #define SE_NAME_SUN "Sun"
80
+ #define SE_NAME_MOON "Moon"
81
+ #define SE_NAME_MERCURY "Mercury"
82
+ #define SE_NAME_VENUS "Venus"
83
+ #define SE_NAME_MARS "Mars"
84
+ #define SE_NAME_JUPITER "Jupiter"
85
+ #define SE_NAME_SATURN "Saturn"
86
+ #define SE_NAME_URANUS "Uranus"
87
+ #define SE_NAME_NEPTUNE "Neptune"
88
+ #define SE_NAME_PLUTO "Pluto"
89
+ #define SE_NAME_MEAN_NODE "mean Node"
90
+ #define SE_NAME_TRUE_NODE "true Node"
91
+ #define SE_NAME_MEAN_APOG "mean Apogee"
92
+ #define SE_NAME_OSCU_APOG "osc. Apogee"
93
+ #define SE_NAME_INTP_APOG "intp. Apogee"
94
+ #define SE_NAME_INTP_PERG "intp. Perigee"
95
+ #define SE_NAME_EARTH "Earth"
96
+ #define SE_NAME_CERES "Ceres"
97
+ #define SE_NAME_PALLAS "Pallas"
98
+ #define SE_NAME_JUNO "Juno"
99
+ #define SE_NAME_VESTA "Vesta"
100
+ #define SE_NAME_CHIRON "Chiron"
101
+ #define SE_NAME_PHOLUS "Pholus"
102
+
103
+
104
+ #define SE_NAME_CUPIDO "Cupido"
105
+ #define SE_NAME_HADES "Hades"
106
+ #define SE_NAME_ZEUS "Zeus"
107
+ #define SE_NAME_KRONOS "Kronos"
108
+ #define SE_NAME_APOLLON "Apollon"
109
+ #define SE_NAME_ADMETOS "Admetos"
110
+ #define SE_NAME_VULKANUS "Vulkanus"
111
+ #define SE_NAME_POSEIDON "Poseidon"
112
+ #define SE_NAME_ISIS "Isis"
113
+ #define SE_NAME_NIBIRU "Nibiru"
114
+ #define SE_NAME_HARRINGTON "Harrington"
115
+ #define SE_NAME_NEPTUNE_LEVERRIER "Leverrier"
116
+ #define SE_NAME_NEPTUNE_ADAMS "Adams"
117
+ #define SE_NAME_PLUTO_LOWELL "Lowell"
118
+ #define SE_NAME_PLUTO_PICKERING "Pickering"
119
+ #define SE_NAME_VULCAN "Vulcan"
120
+ #define SE_NAME_WHITE_MOON "White Moon"
121
+
122
+ /*
123
+ * earlier content
124
+ */
125
+
126
+ #define PI M_PI /* 3.14159265358979323846, math.h */
127
+ #define TWOPI (2.0 * PI)
128
+
129
+ #define ENDMARK -99
130
+
131
+ #define SEI_EPSILON -2
132
+ #define SEI_NUTATION -1
133
+ #define SEI_EMB 0
134
+ #define SEI_EARTH 0
135
+ #define SEI_SUN 0
136
+ #define SEI_MOON 1
137
+ #define SEI_MERCURY 2
138
+ #define SEI_VENUS 3
139
+ #define SEI_MARS 4
140
+ #define SEI_JUPITER 5
141
+ #define SEI_SATURN 6
142
+ #define SEI_URANUS 7
143
+ #define SEI_NEPTUNE 8
144
+ #define SEI_PLUTO 9
145
+ #define SEI_SUNBARY 10 /* barycentric sun */
146
+ #define SEI_ANYBODY 11 /* any asteroid */
147
+ #define SEI_CHIRON 12
148
+ #define SEI_PHOLUS 13
149
+ #define SEI_CERES 14
150
+ #define SEI_PALLAS 15
151
+ #define SEI_JUNO 16
152
+ #define SEI_VESTA 17
153
+
154
+ #define SEI_NPLANETS 18
155
+
156
+ #define SEI_MEAN_NODE 0
157
+ #define SEI_TRUE_NODE 1
158
+ #define SEI_MEAN_APOG 2
159
+ #define SEI_OSCU_APOG 3
160
+ #define SEI_INTP_APOG 4
161
+ #define SEI_INTP_PERG 5
162
+
163
+ #define SEI_NNODE_ETC 6
164
+
165
+ #define SEI_FLG_HELIO 1
166
+ #define SEI_FLG_ROTATE 2
167
+ #define SEI_FLG_ELLIPSE 4
168
+ #define SEI_FLG_EMBHEL 8 /* TRUE, if heliocentric earth is given
169
+ * instead of barycentric sun
170
+ * i.e. bary sun is computed from
171
+ * barycentric and heliocentric earth */
172
+
173
+ #define SEI_FILE_PLANET 0
174
+ #define SEI_FILE_MOON 1
175
+ #define SEI_FILE_MAIN_AST 2
176
+ #define SEI_FILE_ANY_AST 3
177
+ #define SEI_FILE_FIXSTAR 4
178
+ #define SEI_FILE_PLMOON 5
179
+
180
+ #if 0
181
+ #define SEI_FILE_TEST_ENDIAN (97L * 65536L + 98L * 256L + 99L) /*abc*/
182
+ #endif
183
+ #define SEI_FILE_TEST_ENDIAN (0x616263L) /* abc*/
184
+ #define SEI_FILE_BIGENDIAN 0
185
+ #define SEI_FILE_NOREORD 0
186
+ #define SEI_FILE_LITENDIAN 1
187
+ #define SEI_FILE_REORD 2
188
+
189
+ #define SEI_FILE_NMAXPLAN 50
190
+ #define SEI_FILE_EFPOSBEGIN 500
191
+
192
+ #define SE_FILE_SUFFIX "se1"
193
+
194
+ #define SEI_NEPHFILES 7
195
+ #define SEI_CURR_FPOS -1
196
+ #define SEI_NMODELS 8
197
+
198
+ #define SEI_ECL_GEOALT_MAX 25000.0
199
+ #define SEI_ECL_GEOALT_MIN (-500.0)
200
+
201
+ /* Chiron's orbit becomes chaotic
202
+ * before 720 AD and after 4606 AD, because of close encounters
203
+ * with Saturn. Accepting a maximum error of 5 degrees,
204
+ * the ephemeris is good between the following dates:
205
+ */
206
+ /*#define CHIRON_START 1958470.5 * 1.1.650 old limit until v. 2.00 */
207
+ #define CHIRON_START 1967601.5 /* 1.1.675 */
208
+ #define CHIRON_END 3419437.5 /* 1.1.4650 */
209
+
210
+ /* Pholus's orbit is unstable as well, because he sometimes
211
+ * approaches Saturn.
212
+ * Accepting a maximum error of 5 degrees,
213
+ * the ephemeris is good after the following date:
214
+ */
215
+ /* #define PHOLUS_START 314845.5 * 1.1.-3850 old limit until v. 2.00 */
216
+ #define PHOLUS_START 640648.5 /* 1.1.-2958 jul */
217
+ #define PHOLUS_END 4390617.5 /* 1.1.7309 */
218
+
219
+ #define MOSHPLEPH_START 625000.5
220
+ #define MOSHPLEPH_END 2818000.5
221
+ #define MOSHLUEPH_START 625000.5
222
+ #define MOSHLUEPH_END 2818000.5
223
+ /*#define MOSHNDEPH_START -254900.5 */ /* 14 Feb -5410 00:00 ET jul.cal.*/
224
+ /*#define MOSHNDEPH_END 3697000.5 */ /* 11 Dec 5409 00:00 ET, greg. cal */
225
+ #define MOSHNDEPH_START -3100015.5 /* 15 Aug -13200 00:00 ET jul.cal.*/
226
+ #define MOSHNDEPH_END 8000016.5 /* 15 Mar 17191 00:00 ET, greg. cal */
227
+ /*
228
+ #define MOSHPLEPH_START -225000.5
229
+ #define MOSHPLEPH_END 3600000.5
230
+ #define MOSHLUEPH_START -225000.5
231
+ #define MOSHLUEPH_END 3600000.5
232
+ */
233
+ #define JPL_DE431_START -3027215.5
234
+ #define JPL_DE431_END 7930192.5
235
+
236
+ #if FALSE /* Alois commented out, not used anywhere */
237
+ #define JPLEPH_START 625307.5 /* about -3000 (DE406) */
238
+ #define JPLEPH_END 2816848.5 /* about 3000 (DE406) */
239
+ #define SWIEPH_START 625614.927151
240
+ #define SWIEPH_END 2813641.5
241
+ #define ALLEPH_START MOSHPLEPH_START
242
+ #define ALLEPH_END MOSHPLEPH_END
243
+ #define BEG_YEAR (-3000)
244
+ #define END_YEAR 3000
245
+ #endif
246
+
247
+ #define MAXORD 40
248
+
249
+ #define NCTIES 6.0 /* number of centuries per eph. file */
250
+
251
+ #define OK (0)
252
+ #define ERR (-1)
253
+ #define NOT_AVAILABLE (-2)
254
+ #define BEYOND_EPH_LIMITS (-3)
255
+
256
+ #define J_TO_J2000 1
257
+ #define J2000_TO_J -1
258
+
259
+ /* we always use Astronomical Almanac constants, if available */
260
+ #define MOON_MEAN_DIST 384400000.0 /* in m, AA 1996, F2 */
261
+ #define MOON_MEAN_INCL 5.1453964 /* AA 1996, D2 */
262
+ #define MOON_MEAN_ECC 0.054900489 /* AA 1996, F2 */
263
+ /* #define SUN_EARTH_MRAT 328900.561400 Su/(Ea+Mo) AA 2006 K7 */
264
+ #define SUN_EARTH_MRAT 332946.050895 /* Su / (Ea only) AA 2006 K7 */
265
+ #define EARTH_MOON_MRAT (1 / 0.0123000383) /* AA 2006, K7 */
266
+ #if 0
267
+ #define EARTH_MOON_MRAT 81.30056907419062 /* de431 */
268
+ #endif
269
+ #if 0
270
+ #define EARTH_MOON_MRAT 81.30056 /* de406 */
271
+ #endif
272
+ //#define AUNIT 1.49597870691e+11 /* au in meters, AA 2006 K6 */
273
+ #define AUNIT 1.49597870700e+11 /* au in meters, DE431 */
274
+ #define CLIGHT 2.99792458e+8 /* m/s, AA 1996 K6 / DE431 */
275
+ #if 0
276
+ #define HELGRAVCONST 1.32712438e+20 /* G * M(sun), m^3/sec^2, AA 1996 K6 */
277
+ #endif
278
+ #define HELGRAVCONST 1.32712440017987e+20 /* G * M(sun), m^3/sec^2, AA 2006 K6 */
279
+ #define GEOGCONST 3.98600448e+14 /* G * M(earth) m^3/sec^2, AA 1996 K6 */
280
+ #define KGAUSS 0.01720209895 /* Gaussian gravitational constant K6 */
281
+ #define SUN_RADIUS (959.63 / 3600 * DEGTORAD) /* Meeus germ. p 391 */
282
+ #define EARTH_RADIUS 6378136.6 /* AA 2006 K6 */
283
+ //#define EARTH_OBLATENESS (1.0/ 298.257223563) /* AA 1998 K13 */
284
+ #define EARTH_OBLATENESS (1.0/ 298.25642) /* AA 2006 K6 */
285
+ #define EARTH_ROT_SPEED (7.2921151467e-5 * 86400) /* in rad/day, expl. suppl., p 162 */
286
+
287
+ #define LIGHTTIME_AUNIT (499.0047838362/3600.0/24.0) /* 8.3167 minutes (days) */
288
+ #define PARSEC_TO_AUNIT 206264.8062471 /* 648000/PI, according to IAU Resolution B2, 2016 */
289
+
290
+ /* node of ecliptic measured on ecliptic 2000 */
291
+ #define SSY_PLANE_NODE_E2000 (107.582569 * DEGTORAD)
292
+ /* node of ecliptic measured on solar system rotation plane */
293
+ #define SSY_PLANE_NODE (107.58883388 * DEGTORAD)
294
+ /* inclination of ecliptic against solar system rotation plane */
295
+ #define SSY_PLANE_INCL (1.578701 * DEGTORAD)
296
+
297
+ #define KM_S_TO_AU_CTY 21.095 /* km/s to AU/century */
298
+ #define MOON_SPEED_INTV 0.00005 /* 4.32 seconds (in days) */
299
+ #define PLAN_SPEED_INTV 0.0001 /* 8.64 seconds (in days) */
300
+ #define MEAN_NODE_SPEED_INTV 0.001
301
+ #define NODE_CALC_INTV 0.0001
302
+ #define NODE_CALC_INTV_MOSH 0.1
303
+ #define NUT_SPEED_INTV 0.0001
304
+ #define DEFL_SPEED_INTV 0.0000005
305
+
306
+ #define SE_LAPSE_RATE 0.0065 /* deg K / m, for refraction */
307
+
308
+ #define square_sum(x) (x[0]*x[0]+x[1]*x[1]+x[2]*x[2])
309
+ #define dot_prod(x,y) (x[0]*y[0]+x[1]*y[1]+x[2]*y[2])
310
+
311
+ #define PNOINT2JPL {J_EARTH, J_MOON, J_MERCURY, J_VENUS, J_MARS, J_JUPITER, J_SATURN, J_URANUS, J_NEPTUNE, J_PLUTO, J_SUN, }
312
+
313
+ /* planetary radii in meters */
314
+ #define NDIAM (SE_VESTA + 1)
315
+ static const double pla_diam[NDIAM] = {1392000000.0, /* Sun */
316
+ 3475000.0, /* Moon */
317
+ 2439400.0 * 2, /* Mercury */
318
+ 6051800.0 * 2, /* Venus */
319
+ 3389500.0 * 2, /* Mars */
320
+ 69911000.0 * 2, /* Jupiter */
321
+ 58232000.0 * 2, /* Saturn */
322
+ 25362000.0 * 2, /* Uranus */
323
+ 24622000.0 * 2, /* Neptune */
324
+ 1188300.0 * 2, /* Pluto */
325
+ 0, 0, 0, 0, /* nodes and apogees */
326
+ 6371008.4 * 2, /* Earth */
327
+ 271370.0, /* Chiron */
328
+ 290000.0, /* Pholus */
329
+ 939400.0, /* Ceres */
330
+ 545000.0, /* Pallas */
331
+ 246596.0, /* Juno */
332
+ 525400.0, /* Vesta */
333
+ };
334
+
335
+
336
+ /* Ayanamsas
337
+ * For each ayanamsa, there are the following values:
338
+ * t0 epoch of ayanamsa, TDT (can be ET or UT)
339
+ * ayan_t0 ayanamsa value at epoch
340
+ * t0_is_UT true, if t0 is UT
341
+ * prec_offset is the precession model for which the ayanamsha
342
+ * has to be corrected by adding/subtracting a constant offset.
343
+ * 0, if no correction is needed
344
+ * -1, if correction is unclear or has not been investigated
345
+ * and therefore is not applied
346
+ */
347
+ struct aya_init {double t0;
348
+ double ayan_t0;
349
+ AS_BOOL t0_is_UT;
350
+ int prec_offset;};
351
+ static const struct aya_init ayanamsa[SE_NSIDM_PREDEF] = {
352
+ /* 0: Fagan/Bradley (Default)
353
+ "The American Sidereal Ephemeris, 1976-2000" (Astro Computing Services, 1981)
354
+ states on S.V.P. ("Synetic Vernal Point"):
355
+ "The S.V.P. is the Sidereal longitude of the Vernal Equinox (the
356
+ Tropical zero-point) in the Fagan-Bradley school of Western Sidereal
357
+ astrology. It was determined empirically, its mean value being defined
358
+ as 335°57'28".64 for the epoch 1950.0."
359
+ Fagan/Firebrace, "Primer of Sidereal Astrology", p. 13:
360
+ "It was during 1957 that Garth Allen .... experimenting ... But when
361
+ progressed for the dates of the calamities, all were found by him to be
362
+ slightly out, the mean error being equivalent to an increase of 0°06'05"
363
+ in the then-adopted sidereal longitude of the vernal point, determined
364
+ from Spica in 29 Virgo (i.e. 29°06'05" Virgo; D.K.), and the proper motion
365
+ having been allowed for. In short, for the epoch 1950.0 he proposed as the
366
+ mean longitude of the vernal point 335°57'28.64", proper motion being
367
+ disregarded."
368
+ If "1950.0" means the standard epoch B1950 = JD 2433282.423, and based
369
+ on the then-used precession model of Newcomb, this ayanamsha leads to
370
+ a true position of 29°06'05.965" Virgo, based on Hipparcos position of
371
+ the star. */
372
+ {2433282.42346, 24.042044444, FALSE, SEMOD_PREC_NEWCOMB}, // 0: Fagan/Bradley
373
+ /*************************/
374
+ /* 1: Standard Lahiri
375
+ according to program NOVA by Robert Hand:
376
+ {J1900, 360 - 337.53953},
377
+ This corresponds to an ayanamsha 22°27'37.69 as given in
378
+ Indian Ephemeris and Nautical Almanac" 1965, p. 459.
379
+ Note, however, this value should only with a precession formula
380
+ where T is measured in tropical centuries. Swiss Ephemeris always
381
+ uses Julian centuries.
382
+ The following definition is according to:
383
+ Calendar Reform Committee 1956; the subtracted value is nutation:
384
+ {2435553.5, 23.25 - 0.00464207, FALSE},
385
+ Lahiri (derived from: Indian Astronomical Ephemeris 1989, p. 556;
386
+ the subtracted value is nutation, according to Wahr 1980) */
387
+ {2435553.5, 23.250182778 - 0.004658035, FALSE, SEMOD_PREC_IAU_1976}, // 1: Lahiri
388
+ /*************************/
389
+ /* 2: Robert DeLuce (Constellational Astrology ... p. 5;
390
+ birth of Jesus assumed on 1 Jan 1 BC (= 0) jul.,
391
+ based on Newcomb precession.
392
+ {J1900, 360 - 333.58695, FALSE, 0},
393
+ Ayanamsha was corrected with SE 2.09 as follows:
394
+ Started at zero ayanamsha epoch with value 0 and
395
+ run with standard precession.
396
+ This makes a difference of 22" compared with previous version: */
397
+ {1721057.5, 0, TRUE, 0}, // 2: DeLuce
398
+ /*************************/
399
+ /* 3: B.V. Raman (Robert Hand)
400
+ See B.V. Raman, "Hindu Predictive Astrology" (1938, Introduction),
401
+ pp. 279, 287.
402
+ This ayanamsha is apparently not based on a valid precession theory (e.g.
403
+ Newcomb). We cannot reproduce precisely the ayanamsha values on p. 287. */
404
+ {J1900, 360 - 338.98556, FALSE, SEMOD_PREC_NEWCOMB}, // 3: Raman
405
+ /*************************/
406
+ /* 4: Usha/Shashi (Robert Hand)
407
+ Usha and Shashi, "Hindu Astrological Calculations" (1978,
408
+ Sagar Publications, New Delhi).
409
+ We do not have this book. */
410
+ {J1900, 360 - 341.33904, FALSE, -1}, // 4: Usha/Shashi
411
+ /*************************/
412
+ /* 5: Krishnamurti (Robert Hand)
413
+ K.S. Krishnamurti, "Reader 1", pp. 55-59.
414
+ Autor does not give precise information. Zero ayanamsha year is said to
415
+ be 291 CE, and there is an ayanamsha table with arc min precision for
416
+ 1840 to 2000 on p. 58.
417
+ This ayanamsha reproduces the table quite well, if 1 Jan of each year
418
+ is taken. (Turn off Newcomb precession in order to verify.)
419
+ However, D. Senthilathiban believes the values are given for the date
420
+ of sidereal Aries ingress of each year. ("Study of KP Ayanamsa with
421
+ Modern Precession Theories", pp. 126f. */
422
+ {J1900, 360 - 337.636111, FALSE, SEMOD_PREC_NEWCOMB}, // 5: Krishnamurti
423
+ /*************************/
424
+ /* 6: Djwhal Khool (Graham Dawson),
425
+ "Channeled" information: Aquarius ingress of VP on 1 July 2117
426
+ See Philipp Lindsay, “The Beginning of the Age of Aquarius: 2,117 A.D.”,
427
+ http://esotericastrologer.org/newsletters/the-age-of-aquarius-ray-and-zodiac-cycles/ */
428
+ /*************************/
429
+ {J1900, 360 - 333.0369024, FALSE, 0}, // 6: Djwhal Khool
430
+ /* 7: Shri Yukteshwar; (David Cochrane)
431
+ This ayanamsha seems to be wrong.
432
+ Swami Sri Yukteswar, "The Holy Science", 1920 (1949, 1957 and 1977,
433
+ partly revised), Yogoda Satsanga Society of India.
434
+ Ayanamsha on the spring equinox 1893 was 20°54'36" (1894 according to
435
+ the revised edition of 1977) At the same time he believed that this was the
436
+ distance of the spring equinox from the star Revati, which he put at the
437
+ initial point of Aries. Unfortunately, this is wrong, because on that date
438
+ Revati was actually 18°23' away from the vernal point. The error is
439
+ explained from the fact that Yukteshwar used the zero ayanamsha year 499 CE
440
+ and an inaccurate Suryasiddhantic precession rate of 360°/24'000 years = 54
441
+ arcsec/year. It is obvious that Yukteshwar actually intended an ayanamsha
442
+ that starts at the star Revati. */
443
+ {J1900, 360 - 338.917778, FALSE, -1}, // 7: Shri Yukteshwar
444
+ //{2412543.5, 20.91, TRUE, -1}, // 7: Shri Yukteshwar; (Holy Science, p. xx)
445
+ /*************************/
446
+ /* 8: J.N. Bhasin; (David Cochrane)
447
+ We don't have any sources or detailed information about this ayanamsha. */
448
+ {J1900, 360 - 338.634444, FALSE, -1}, // Bhasin
449
+ /*************************/
450
+ /* 14 Sept. 2018: the following three ayanamshas have been wrong for
451
+ many years */
452
+ /* 9 - 11: Babylonian, Kugler */
453
+ {1684532.5, -5.66667, TRUE, -1}, /* 9: Babylonian, Kugler 1 */
454
+ {1684532.5, -4.26667, TRUE, -1}, /* 10: Babylonian, Kugler 2 */
455
+ {1684532.5, -3.41667, TRUE, -1}, /* 11: Babylonian, Kugler 3 */
456
+ /*************************/
457
+ /* 12: Babylonian, Huber
458
+ P. Huber, "Über den Nullpunkt der babylonischen Ekliptik", in: Centaurus
459
+ 1958, 5, p. 192-208.
460
+ This ayanamsha had a wrong initial value until 14 Sept. 2018. */
461
+ {1684532.5, -4.46667, TRUE, -1}, // 12: Baylonian, Huber
462
+ /*************************/
463
+ /* 13: Babylonian, Mercier; eta Piscium culminates with zero point */
464
+ {1673941, -5.079167, TRUE, -1}, // 13: Babylonian, Mercier
465
+ /*************************/
466
+ /* 14: t0 is defined by Aldebaran at 15 Taurus in year -100 */
467
+ {1684532.5, -4.44138598, TRUE, 0},
468
+ /*************************/
469
+ /* 15: Hipparchos */
470
+ {1674484.0, -9.33333, TRUE, -1}, // 15: Hipparchos
471
+ /*************************/
472
+ /* 16: Sassanian */
473
+ {1927135.8747793, 0, TRUE, -1}, // 16: Sassanian
474
+ /*************************/
475
+ /* 17: Galactic Center at 0 Sagittarius */
476
+ {0, 0, FALSE, 0}, // 17: Galactic Center at 0 Sagittarius
477
+ /*************************/
478
+ /* 18: J2000 */
479
+ {J2000, 0, FALSE, 0}, /* 18: J2000 */
480
+ /*************************/
481
+ /* 19: J1900 */
482
+ {J1900, 0, FALSE, 0}, /* 19: J1900 */
483
+ /*************************/
484
+ /* 20: B1950 */
485
+ {B1950, 0, FALSE, 0}, /* 20: B1950 */
486
+ /*************************/
487
+ /* 21: Suryasiddhanta, assuming ingress of mean Sun into Aries at point of mean
488
+ equinox of date on 21.3.499, near noon, Ujjain (75.7684565 E)
489
+ = 7:30:31.57 UT = 12:33:36 LMT*/
490
+ {1903396.8128654, 0, TRUE, 0}, // 21:
491
+ /*************************/
492
+ /* 22: Suryasiddhanta, assuming ingress of mean Sun into Aries at true position
493
+ of mean Sun at same epoch */
494
+ {1903396.8128654,-0.21463395, TRUE, 0}, // 22:
495
+ /*************************/
496
+ /* 23: Aryabhata, same date, but UT 6:56:55.57 analogous to 21 */
497
+ {1903396.7895321, 0, TRUE, 0}, // 23:
498
+ /*************************/
499
+ /* 24: Aryabhata, analogous 22 */
500
+ {1903396.7895321,-0.23763238, TRUE, 0}, // 24:
501
+ /*************************/
502
+ /* 25: Suryasiddhanta, Revati/zePsc at polar long. 359°50'*/
503
+ {1903396.8128654,-0.79167046, TRUE, 0}, // 25:
504
+ /*************************/
505
+ /* 26: Suryasiddhanta, Citra/Spica at polar long. 180° */
506
+ {1903396.8128654, 2.11070444, TRUE, 0}, // 26:
507
+ /*************************/
508
+ /* 27: True Citra (Spica exactly at 0 Libra) */
509
+ {0, 0, FALSE, 0}, // 27: True Citra
510
+ /*************************/
511
+ /* 28: True Revati (zeta Psc exactly at 29°50' Pisces) */
512
+ {0, 0, FALSE, 0}, // 28: True Revati
513
+ /*************************/
514
+ /* 29: True Pushya (delta Cnc exactly a 16 Cancer */
515
+ {0, 0, FALSE, 0}, // 29: True Pushya
516
+ /*************************/
517
+ /* 30: R. Gil Brand; Galactic Center at golden section between 0 Sco and 0 Aqu;
518
+ note: 0° Aqu/Leo is the symmetric axis of rulerships */
519
+ {0, 0, FALSE, 0}, // 30: Gil Brand
520
+ /*************************/
521
+ /* 31: Galactic Equator IAU 1958, i.e. galactic/ecliptic intersection point
522
+ based on galactic coordinate system */
523
+ {0, 0, FALSE, 0}, // 31: GE IAU 1958
524
+ /*************************/
525
+ /* 32: Galactic Equator True, i.e. galactic/ecliptic intersection point based
526
+ on the galactic pole as given in: Liu/Zhu/Zhang, „Reconsidering the
527
+ galactic coordinate system“, A & A No. AA2010, Oct. 2010 */
528
+ {0, 0, FALSE, 0}, // 32: GE true
529
+ /*************************/
530
+ /* 33: Galactic Equator Mula, i.e. galactic/ecliptic intersection point in the
531
+ middle of lunar mansion Mula */
532
+ {0, 0, FALSE, 0}, // 33: GE Mula
533
+ /*************************/
534
+ /* 34: Skydram/Galactic Alignment (R. Mardyks); autumn equinox aligned with
535
+ Galactic Equator/Pole */
536
+ {2451079.734892000, 30, FALSE, 0}, // 34: Skydram/Mardyks
537
+ /*************************/
538
+ /* 35: Chandra Hari */
539
+ {0, 0, FALSE, 0}, // 35: Chandra Hari
540
+ /*************************/
541
+ /* 36: Dhruva Galactic Centre Middle of Mula (Ernst Wilhelm) */
542
+ {0, 0, FALSE, 0}, // 36: Ernst Wilhelm
543
+ /*************************/
544
+ /* 37: Kali 3623 = 522 CE, Ujjain (75.7684565), based on Kali midnight and
545
+ year length of Suryasiddhanta */
546
+ {1911797.740782065, 0, TRUE, 0}, // 36: 0 ayanamsha in year 522
547
+ /*************************/
548
+ /* 38: Babylonian (Britton 2010)
549
+ John P. Britton, "Studies in Babylonian lunar theory: part III. The
550
+ introduction of the uniform zodiac", in Arch. Hist. Exact. Sci.
551
+ (2010)64:617-663, p. 630. */
552
+ {1721057.5, -3.2, TRUE, -1}, // 38: Babylonian (Britton 2010)
553
+ /*************************/
554
+ /* 39: Sunil Sheoran ("Vedic")
555
+ S. Sheoran, "The Science of Time and Timeline of World History", 2017. */
556
+ {0, 0, FALSE, 0}, // 39: Sunil Sheoran ("Vedic")
557
+ /*************************/
558
+ /* 40: Galactic Center at 0 Capricon (Cochrane) */
559
+ {0, 0, FALSE, 0}, // 40: Cochrane
560
+ /*************************/
561
+ /* 41: "Galactic Equatorial" (N.A. Fiorenza) */
562
+ {2451544.5, 25.0, TRUE, 0}, // 41: N.A. Fiorenza */
563
+ /*************************/
564
+ /* 42: Vettius Valens (Moon; derived from Holden 1995 p. 12 for epoch of Valens
565
+ 1 Jan. 150 CE julian) */
566
+ {1775845.5, -2.9422, TRUE, -1}, // 42: Vettius Valens
567
+ /*************************/
568
+ /* 43: Lahiri (1940), book "Panchanga darpan":
569
+ 22°26'45".50 + 50".25748T + 0".00011115T^2 */
570
+ {J1900, 22.44597222, FALSE, SEMOD_PREC_NEWCOMB}, // 43: Lahiri (1940)
571
+ /*************************/
572
+ /* 44: Lahiri (VP285), mean sun at 360° in 285CE; epoch for mean sun at 0 acc.
573
+ to Simon 1994, corrected for Vondrak precession
574
+ (Preface to Lahiri's "Indian Ephemeris" 1980) */
575
+ {1825235.2458513028, 0.0, FALSE, 0}, // 44: Lahiri VP285 (1980)
576
+ /*************************/
577
+ /* 45: Krishnamurti from mean equinox 291, based on Newcomb precession,
578
+ according to D. Senthilathiban, "Study of KP Ayanamsa with Modern
579
+ Precession Theories" (2019), but using precession Vondrak 2011 and
580
+ correction base on Newcomb precession. */
581
+ //{1827424.752255678, 0.0, FALSE, SEMOD_PREC_NEWCOMB}, // 45: Krishnamurti VP291
582
+ {1827424.752255678, 0.0, FALSE, 0}, // 45: Krishnamurti VP291
583
+ /*************************/
584
+ /* 46: Lahiri original: Calendar Reform Committee 1956,
585
+ before the correction by 0.658" in IAE 1985.
586
+ The subtracted value is nutation according to Woolard 1953.
587
+ However, nutation Woolard was used by IENA/IAE only from 1960 on,
588
+ so this value is not correct. In order to reproduce mean ayanamshas
589
+ of IENA >=1960, we could choose 23.25 - 0.00464207 + 0.07 / 3600.0
590
+ as initial value in 1956. However this will not help to reproduce
591
+ true ayanamshas. A deviation of around 0.1" remains,
592
+ for unknown reasons. The difference between Lahiri (1) and
593
+ Lahiri ICRC (45) amounts to 1.1". */
594
+ {2435553.5, 23.25 - 0.00464207, FALSE, SEMOD_PREC_NEWCOMB}, // 46: SE_SIDM_LAHIRI_ICRC
595
+ /*************************/
596
+ };
597
+
598
+ #define PLAN_DATA struct plan_data
599
+
600
+ /* obliquity of ecliptic */
601
+ struct epsilon {
602
+ double teps, eps, seps, ceps; /* jd, eps, sin(eps), cos(eps) */
603
+ };
604
+
605
+ /*
606
+ extern struct epsilon oec2000;
607
+ extern struct epsilon oec;
608
+ */
609
+
610
+ struct plan_data {
611
+ /* the following data are read from file only once, immediately after
612
+ * file has been opened */
613
+ int ibdy; /* internal body number */
614
+ int32 iflg; /* contains several bit flags describing the data:
615
+ * SEI_FLG_HELIO: true if helio, false if bary
616
+ * SEI_FLG_ROTATE: TRUE if coefficients are referred
617
+ * to coordinate system of orbital plane
618
+ * SEI_FLG_ELLIPSE: TRUE if reference ellipse */
619
+ int ncoe; /* # of coefficients of ephemeris polynomial,
620
+ is polynomial order + 1 */
621
+ /* where is the segment index on the file */
622
+ int32 lndx0; /* file position of begin of planet's index */
623
+ int32 nndx; /* number of index entries on file: computed */
624
+ double tfstart; /* file contains ephemeris for tfstart thru tfend */
625
+ double tfend; /* for this particular planet !!! */
626
+ double dseg; /* segment size (days covered by a polynomial) */
627
+ /* orbital elements: */
628
+ double telem; /* epoch of elements */
629
+ double prot;
630
+ double qrot;
631
+ double dprot;
632
+ double dqrot;
633
+ double rmax; /* normalisation factor of cheby coefficients */
634
+ /* in addition, if reference ellipse is used: */
635
+ double peri;
636
+ double dperi;
637
+ double *refep; /* pointer to cheby coeffs of reference ellipse,
638
+ * size of data is 2 x ncoe */
639
+ /* unpacked segment information, only updated when a segment is read: */
640
+ double tseg0, tseg1; /* start and end jd of current segment */
641
+ double *segp; /* pointer to unpacked cheby coeffs of segment;
642
+ * the size is 3 x ncoe */
643
+ int neval; /* how many coefficients to evaluate. this may
644
+ * be less than ncoe */
645
+ /* result of most recent data evaluation for this body: */
646
+ double teval; /* time for which previous computation was made */
647
+ int32 iephe; /* which ephemeris was used */
648
+ double x[6]; /* position and speed vectors equatorial J2000 */
649
+ int32 xflgs; /* hel., light-time, aberr., prec. flags etc. */
650
+ double xreturn[24]; /* return positions:
651
+ * xreturn+0 ecliptic polar coordinates
652
+ * xreturn+6 ecliptic cartesian coordinates
653
+ * xreturn+12 equatorial polar coordinates
654
+ * xreturn+18 equatorial cartesian coordinates
655
+ */
656
+ };
657
+
658
+ /*
659
+ * stuff exported from swemplan.c and swemmoon.c
660
+ * and constants used inside these functions.
661
+ ************************************************************/
662
+
663
+ #define STR 4.8481368110953599359e-6 /* radians per arc second */
664
+
665
+ /* moon, s. moshmoon.c */
666
+ extern int swi_mean_node(double jd, double *x, char *serr);
667
+ extern int swi_mean_apog(double jd, double *x, char *serr);
668
+ extern int swi_moshmoon(double tjd, AS_BOOL do_save, double *xpm, char *serr) ;
669
+ extern int swi_moshmoon2(double jd, double *x);
670
+ extern int swi_intp_apsides(double J, double *pol, int ipli);
671
+
672
+ /* planets, s. moshplan.c */
673
+ extern int swi_moshplan(double tjd, int ipli, AS_BOOL do_save, double *xpret, double *xeret, char *serr);
674
+ extern int swi_moshplan2(double J, int iplm, double *pobj);
675
+ extern int swi_osc_el_plan(double tjd, double *xp, int ipl, int ipli, double *xearth, double *xsun, char *serr);
676
+ extern FILE *swi_fopen(int ifno, char *fname, char *ephepath, char *serr);
677
+ extern int32 swi_init_swed_if_start(void);
678
+ extern int32 swi_set_tid_acc(double tjd_ut, int32 iflag, int32 denum, char *serr);
679
+ extern int32 swi_get_tid_acc(double tjd_ut, int32 iflag, int32 denum, int32 *denumret, double *tid_acc, char *serr);
680
+
681
+ extern int32 swi_get_ayanamsa_ex(double tjd_et, int32 iflag, double *daya, char *serr);
682
+ extern int32 swi_get_ayanamsa_ex_ut(double tjd_ut, int32 iflag, double *daya, char *serr);
683
+ extern int32 swi_get_ayanamsa_with_speed(double tjd_et, int32 iflag, double *daya, char *serr);
684
+
685
+ extern double swi_armc_to_mc(double armc, double eps);
686
+
687
+ extern int32 swi_get_denum(int32 ipli, int32 iflag);
688
+
689
+
690
+ /* nutation */
691
+ struct nut {
692
+ double tnut;
693
+ double nutlo[2]; /* nutation in longitude and obliquity */
694
+ double snut, cnut; /* sine and cosine of nutation in obliquity */
695
+ double matrix[3][3];
696
+ };
697
+
698
+ struct plantbl {
699
+ char max_harmonic[9];
700
+ char max_power_of_t;
701
+ signed char *arg_tbl;
702
+ double *lon_tbl;
703
+ double *lat_tbl;
704
+ double *rad_tbl;
705
+ double distance;
706
+ };
707
+
708
+ struct file_data {
709
+ char fnam[AS_MAXCH]; /* ephemeris file name */
710
+ int fversion; /* version number of file */
711
+ char astnam[50]; /* asteroid name, if asteroid file */
712
+ int32 sweph_denum; /* DE number of JPL ephemeris, which this file
713
+ * is derived from. */
714
+ FILE *fptr; /* ephemeris file pointer */
715
+ double tfstart; /* file may be used from this date */
716
+ double tfend; /* through this date */
717
+ int32 iflg; /* byte reorder flag and little/bigendian flag */
718
+ short npl; /* how many planets in file */
719
+ int ipl[SEI_FILE_NMAXPLAN]; /* planet numbers */
720
+ };
721
+
722
+ struct gen_const {
723
+ double clight,
724
+ aunit,
725
+ helgravconst,
726
+ ratme,
727
+ sunradius;
728
+ };
729
+
730
+ struct save_positions {
731
+ int ipl;
732
+ double tsave;
733
+ int32 iflgsave;
734
+ /* position at t = tsave,
735
+ * in ecliptic polar (offset 0),
736
+ * ecliptic cartesian (offset 6),
737
+ * equatorial polar (offset 12),
738
+ * and equatorial cartesian coordinates (offset 18).
739
+ * 6 doubles each for position and speed coordinates.
740
+ */
741
+ double xsaves[24];
742
+ };
743
+
744
+ struct node_data {
745
+ /* result of most recent data evaluation for this body: */
746
+ double teval; /* time for which last computation was made */
747
+ int32 iephe; /* which ephemeris was used */
748
+ double x[6]; /* position and speed vectors equatorial J2000 */
749
+ int32 xflgs; /* hel., light-time, aberr., prec. flags etc. */
750
+ double xreturn[24]; /* return positions:
751
+ * xreturn+0 ecliptic polar coordinates
752
+ * xreturn+6 ecliptic cartesian coordinates
753
+ * xreturn+12 equatorial polar coordinates
754
+ * xreturn+18 equatorial cartesian coordinates
755
+ */
756
+ };
757
+
758
+ struct topo_data {
759
+ double geolon, geolat, geoalt;
760
+ double teval;
761
+ double tjd_ut;
762
+ double xobs[6];
763
+ };
764
+
765
+ struct sid_data {
766
+ int32 sid_mode;
767
+ double ayan_t0;
768
+ double t0;
769
+ AS_BOOL t0_is_UT;
770
+ };
771
+
772
+ #define SWI_STAR_LENGTH 40
773
+ struct fixed_star {
774
+ char skey[SWI_STAR_LENGTH + 2]; // may be prefixed with comma, one char more
775
+ char starname[SWI_STAR_LENGTH + 1];
776
+ char starbayer[SWI_STAR_LENGTH + 1];
777
+ char starno[10];
778
+ double epoch, ra, de, ramot, demot, radvel, parall, mag;
779
+ };
780
+
781
+ /* dpsi and deps loaded for 100 years after 1962 */
782
+ #define SWE_DATA_DPSI_DEPS 36525
783
+
784
+ struct interpol {
785
+ double tjd_nut0, tjd_nut2;
786
+ double nut_dpsi0, nut_dpsi1, nut_dpsi2;
787
+ double nut_deps0, nut_deps1, nut_deps2;
788
+ };
789
+
790
+ /* if this is changed, then also update initialisation in sweph.c */
791
+ struct swe_data {
792
+ AS_BOOL ephe_path_is_set;
793
+ AS_BOOL jpl_file_is_open;
794
+ FILE *fixfp; /* fixed stars file pointer */
795
+ char ephepath[AS_MAXCH];
796
+ char jplfnam[AS_MAXCH];
797
+ int32 jpldenum;
798
+ int32 last_epheflag;
799
+ AS_BOOL geopos_is_set;
800
+ AS_BOOL ayana_is_set;
801
+ AS_BOOL is_old_starfile;
802
+ double eop_tjd_beg;
803
+ double eop_tjd_beg_horizons;
804
+ double eop_tjd_end;
805
+ double eop_tjd_end_add;
806
+ int eop_dpsi_loaded;
807
+ double tid_acc;
808
+ AS_BOOL is_tid_acc_manual;
809
+ AS_BOOL init_dt_done;
810
+ AS_BOOL swed_is_initialised;
811
+ AS_BOOL delta_t_userdef_is_set;
812
+ double delta_t_userdef;
813
+ double ast_G;
814
+ double ast_H;
815
+ double ast_diam;
816
+ char astelem[AS_MAXCH * 10];
817
+ int i_saved_planet_name;
818
+ char saved_planet_name[80];
819
+ //double dpsi[36525]; /* works for 100 years after 1962 */
820
+ //double deps[36525];
821
+ double *dpsi;
822
+ double *deps;
823
+ int32 timeout;
824
+ int32 astro_models[SEI_NMODELS];
825
+ AS_BOOL do_interpolate_nut;
826
+ struct interpol interpol;
827
+ struct file_data fidat[SEI_NEPHFILES];
828
+ struct gen_const gcdat;
829
+ struct plan_data pldat[SEI_NPLANETS];
830
+ #if 0
831
+ struct node_data nddat[SEI_NNODE_ETC];
832
+ #else
833
+ struct plan_data nddat[SEI_NNODE_ETC];
834
+ #endif
835
+ struct save_positions savedat[SE_NPLANETS+1];
836
+ struct epsilon oec;
837
+ struct epsilon oec2000;
838
+ struct nut nut;
839
+ struct nut nut2000;
840
+ struct nut nutv;
841
+ struct topo_data topd;
842
+ struct sid_data sidd;
843
+ AS_BOOL n_fixstars_real; // real number of fixed stars in sefstars.txt
844
+ AS_BOOL n_fixstars_named; // number of fixed stars with tradtional name
845
+ AS_BOOL n_fixstars_records;// number of fixed stars records in fixed_stars
846
+ struct fixed_star *fixed_stars;
847
+ };
848
+
849
+ extern TLS struct swe_data swed;