@typescriptify/sweph 1.0.0

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.
Files changed (211) hide show
  1. package/README.md +422 -0
  2. package/ephe/semo_18.se1 +0 -0
  3. package/ephe/sepl_18.se1 +0 -0
  4. package/originalCode/.eslintrc.json +124 -0
  5. package/originalCode/.gitattributes +2 -0
  6. package/originalCode/.github/FUNDING.yml +5 -0
  7. package/originalCode/.github/workflows/test.yml +35 -0
  8. package/originalCode/LICENSE +840 -0
  9. package/originalCode/README.md +91 -0
  10. package/originalCode/binding.gyp +41 -0
  11. package/originalCode/constants.js +366 -0
  12. package/originalCode/docs.gif +0 -0
  13. package/originalCode/index.d.ts +5115 -0
  14. package/originalCode/index.js +7 -0
  15. package/originalCode/index.mjs +109 -0
  16. package/originalCode/package.json +55 -0
  17. package/originalCode/src/functions/azalt.cpp +39 -0
  18. package/originalCode/src/functions/azalt_rev.cpp +35 -0
  19. package/originalCode/src/functions/calc.cpp +29 -0
  20. package/originalCode/src/functions/calc_pctr.cpp +31 -0
  21. package/originalCode/src/functions/calc_ut.cpp +29 -0
  22. package/originalCode/src/functions/close.cpp +6 -0
  23. package/originalCode/src/functions/cotrans.cpp +26 -0
  24. package/originalCode/src/functions/cotrans_sp.cpp +26 -0
  25. package/originalCode/src/functions/cs2degstr.cpp +19 -0
  26. package/originalCode/src/functions/cs2lonlatstr.cpp +23 -0
  27. package/originalCode/src/functions/cs2timestr.cpp +23 -0
  28. package/originalCode/src/functions/csnorm.cpp +15 -0
  29. package/originalCode/src/functions/csroundsec.cpp +15 -0
  30. package/originalCode/src/functions/d2l.cpp +15 -0
  31. package/originalCode/src/functions/date_conversion.cpp +30 -0
  32. package/originalCode/src/functions/day_of_week.cpp +15 -0
  33. package/originalCode/src/functions/degnorm.cpp +15 -0
  34. package/originalCode/src/functions/deltat.cpp +15 -0
  35. package/originalCode/src/functions/deltat_ex.cpp +24 -0
  36. package/originalCode/src/functions/difcs2n.cpp +19 -0
  37. package/originalCode/src/functions/difcsn.cpp +19 -0
  38. package/originalCode/src/functions/difdeg2n.cpp +19 -0
  39. package/originalCode/src/functions/difdegn.cpp +19 -0
  40. package/originalCode/src/functions/fixstar.cpp +32 -0
  41. package/originalCode/src/functions/fixstar2.cpp +32 -0
  42. package/originalCode/src/functions/fixstar2_mag.cpp +28 -0
  43. package/originalCode/src/functions/fixstar2_ut.cpp +32 -0
  44. package/originalCode/src/functions/fixstar_mag.cpp +28 -0
  45. package/originalCode/src/functions/fixstar_ut.cpp +32 -0
  46. package/originalCode/src/functions/gauquelin_sector.cpp +44 -0
  47. package/originalCode/src/functions/get_ayanamsa.cpp +15 -0
  48. package/originalCode/src/functions/get_ayanamsa_ex.cpp +27 -0
  49. package/originalCode/src/functions/get_ayanamsa_ex_ut.cpp +27 -0
  50. package/originalCode/src/functions/get_ayanamsa_name.cpp +19 -0
  51. package/originalCode/src/functions/get_ayanamsa_ut.cpp +15 -0
  52. package/originalCode/src/functions/get_current_file_data.cpp +28 -0
  53. package/originalCode/src/functions/get_library_path.cpp +8 -0
  54. package/originalCode/src/functions/get_orbital_elements.cpp +29 -0
  55. package/originalCode/src/functions/get_planet_name.cpp +19 -0
  56. package/originalCode/src/functions/get_tid_acc.cpp +7 -0
  57. package/originalCode/src/functions/heliacal_pheno_ut.cpp +52 -0
  58. package/originalCode/src/functions/heliacal_ut.cpp +52 -0
  59. package/originalCode/src/functions/helio_cross.cpp +33 -0
  60. package/originalCode/src/functions/helio_cross_ut.cpp +33 -0
  61. package/originalCode/src/functions/house_name.cpp +20 -0
  62. package/originalCode/src/functions/house_pos.cpp +36 -0
  63. package/originalCode/src/functions/houses.cpp +35 -0
  64. package/originalCode/src/functions/houses_armc.cpp +38 -0
  65. package/originalCode/src/functions/houses_armc_ex2.cpp +47 -0
  66. package/originalCode/src/functions/houses_ex.cpp +37 -0
  67. package/originalCode/src/functions/houses_ex2.cpp +46 -0
  68. package/originalCode/src/functions/jdet_to_utc.cpp +38 -0
  69. package/originalCode/src/functions/jdut1_to_utc.cpp +38 -0
  70. package/originalCode/src/functions/julday.cpp +25 -0
  71. package/originalCode/src/functions/lat_to_lmt.cpp +27 -0
  72. package/originalCode/src/functions/lmt_to_lat.cpp +27 -0
  73. package/originalCode/src/functions/lun_eclipse_how.cpp +34 -0
  74. package/originalCode/src/functions/lun_eclipse_when.cpp +31 -0
  75. package/originalCode/src/functions/lun_eclipse_when_loc.cpp +39 -0
  76. package/originalCode/src/functions/lun_occult_when_glob.cpp +35 -0
  77. package/originalCode/src/functions/lun_occult_when_loc.cpp +43 -0
  78. package/originalCode/src/functions/lun_occult_where.cpp +34 -0
  79. package/originalCode/src/functions/mooncross.cpp +26 -0
  80. package/originalCode/src/functions/mooncross_node.cpp +30 -0
  81. package/originalCode/src/functions/mooncross_node_ut.cpp +30 -0
  82. package/originalCode/src/functions/mooncross_ut.cpp +26 -0
  83. package/originalCode/src/functions/nod_aps.cpp +42 -0
  84. package/originalCode/src/functions/nod_aps_ut.cpp +42 -0
  85. package/originalCode/src/functions/orbit_max_min_true_distance.cpp +37 -0
  86. package/originalCode/src/functions/pheno.cpp +29 -0
  87. package/originalCode/src/functions/pheno_ut.cpp +29 -0
  88. package/originalCode/src/functions/radnorm.cpp +15 -0
  89. package/originalCode/src/functions/refrac.cpp +23 -0
  90. package/originalCode/src/functions/refrac_extended.cpp +32 -0
  91. package/originalCode/src/functions/revjul.cpp +33 -0
  92. package/originalCode/src/functions/rise_trans.cpp +44 -0
  93. package/originalCode/src/functions/rise_trans_true_hor.cpp +46 -0
  94. package/originalCode/src/functions/set_delta_t_userdef.cpp +14 -0
  95. package/originalCode/src/functions/set_ephe_path.cpp +14 -0
  96. package/originalCode/src/functions/set_jpl_file.cpp +14 -0
  97. package/originalCode/src/functions/set_sid_mode.cpp +20 -0
  98. package/originalCode/src/functions/set_tid_acc.cpp +14 -0
  99. package/originalCode/src/functions/set_topo.cpp +20 -0
  100. package/originalCode/src/functions/sidtime.cpp +15 -0
  101. package/originalCode/src/functions/sidtime0.cpp +21 -0
  102. package/originalCode/src/functions/sol_eclipse_how.cpp +34 -0
  103. package/originalCode/src/functions/sol_eclipse_when_glob.cpp +31 -0
  104. package/originalCode/src/functions/sol_eclipse_when_loc.cpp +39 -0
  105. package/originalCode/src/functions/sol_eclipse_where.cpp +30 -0
  106. package/originalCode/src/functions/solcross.cpp +26 -0
  107. package/originalCode/src/functions/solcross_ut.cpp +26 -0
  108. package/originalCode/src/functions/split_deg.cpp +35 -0
  109. package/originalCode/src/functions/time_equ.cpp +25 -0
  110. package/originalCode/src/functions/utc_time_zone.cpp +48 -0
  111. package/originalCode/src/functions/utc_to_jd.cpp +37 -0
  112. package/originalCode/src/functions/version.cpp +8 -0
  113. package/originalCode/src/functions/vis_limit_mag.cpp +50 -0
  114. package/originalCode/src/sweph.cpp +150 -0
  115. package/originalCode/src/sweph.h +119 -0
  116. package/originalCode/swisseph/swecl.c +6428 -0
  117. package/originalCode/swisseph/swedate.c +588 -0
  118. package/originalCode/swisseph/swedate.h +81 -0
  119. package/originalCode/swisseph/swehel.c +3511 -0
  120. package/originalCode/swisseph/swehouse.c +3143 -0
  121. package/originalCode/swisseph/swehouse.h +98 -0
  122. package/originalCode/swisseph/swejpl.c +958 -0
  123. package/originalCode/swisseph/swejpl.h +103 -0
  124. package/originalCode/swisseph/swemmoon.c +1930 -0
  125. package/originalCode/swisseph/swemplan.c +967 -0
  126. package/originalCode/swisseph/swemptab.h +10640 -0
  127. package/originalCode/swisseph/swenut2000a.h +2819 -0
  128. package/originalCode/swisseph/sweodef.h +326 -0
  129. package/originalCode/swisseph/sweph.c +8614 -0
  130. package/originalCode/swisseph/sweph.h +849 -0
  131. package/originalCode/swisseph/swephexp.h +1020 -0
  132. package/originalCode/swisseph/swephlib.c +4634 -0
  133. package/originalCode/swisseph/swephlib.h +189 -0
  134. package/package.json +28 -0
  135. package/scripts/gen-swemptab.js +177 -0
  136. package/scripts/gen-swenut2000a.js +106 -0
  137. package/src/SwissEph/README.md +268 -0
  138. package/src/SwissEph/UseCases/Ayanamsa.md +363 -0
  139. package/src/SwissEph/UseCases/AzimuthAltitude.md +408 -0
  140. package/src/SwissEph/UseCases/CoordinateSystems.md +337 -0
  141. package/src/SwissEph/UseCases/DateAndTime.md +368 -0
  142. package/src/SwissEph/UseCases/DeltaT.md +258 -0
  143. package/src/SwissEph/UseCases/EphemerisFiles.md +338 -0
  144. package/src/SwissEph/UseCases/FixedStars.md +300 -0
  145. package/src/SwissEph/UseCases/GauquelinSectors.md +304 -0
  146. package/src/SwissEph/UseCases/HeliacalEvents.md +396 -0
  147. package/src/SwissEph/UseCases/HelioCrossings.md +325 -0
  148. package/src/SwissEph/UseCases/HousePosition.md +254 -0
  149. package/src/SwissEph/UseCases/HouseSystems.md +279 -0
  150. package/src/SwissEph/UseCases/LunarEclipse.md +326 -0
  151. package/src/SwissEph/UseCases/MeridianTransit.md +279 -0
  152. package/src/SwissEph/UseCases/MoonCrossings.md +373 -0
  153. package/src/SwissEph/UseCases/NodesAndApsides.md +307 -0
  154. package/src/SwissEph/UseCases/Occultation.md +352 -0
  155. package/src/SwissEph/UseCases/OrbitalElements.md +469 -0
  156. package/src/SwissEph/UseCases/Phenomena.md +328 -0
  157. package/src/SwissEph/UseCases/PlanetPositions.md +366 -0
  158. package/src/SwissEph/UseCases/Planetocentric.md +278 -0
  159. package/src/SwissEph/UseCases/Refraction.md +314 -0
  160. package/src/SwissEph/UseCases/RiseAndSet.md +433 -0
  161. package/src/SwissEph/UseCases/SiderealTime.md +302 -0
  162. package/src/SwissEph/UseCases/SolarEclipse.md +379 -0
  163. package/src/SwissEph/UseCases/SunCrossings.md +275 -0
  164. package/src/SwissEph/UseCases/TopocentricCorrection.md +335 -0
  165. package/src/SwissEph/errors.ts +10 -0
  166. package/src/SwissEph/index.ts +823 -0
  167. package/src/SwissEph/types.ts +291 -0
  168. package/src/constants.ts +762 -0
  169. package/src/file-reader.ts +147 -0
  170. package/src/index.ts +10 -0
  171. package/src/swecl.ts +4526 -0
  172. package/src/swedate.ts +376 -0
  173. package/src/swehel.ts +1939 -0
  174. package/src/swehouse.ts +2167 -0
  175. package/src/swejpl.ts +470 -0
  176. package/src/swemmoon.ts +1318 -0
  177. package/src/swemplan.ts +585 -0
  178. package/src/swemptab.ts +4448 -0
  179. package/src/swenut2000a.ts +2763 -0
  180. package/src/sweph.ts +3993 -0
  181. package/src/swephlib.ts +2720 -0
  182. package/src/types.ts +490 -0
  183. package/tests/c-style/ayanamsa.test.ts +63 -0
  184. package/tests/c-style/config.test.ts +96 -0
  185. package/tests/c-style/crossings.test.ts +81 -0
  186. package/tests/c-style/date-time.test.ts +114 -0
  187. package/tests/c-style/eclipses.test.ts +84 -0
  188. package/tests/c-style/fixed-stars.test.ts +66 -0
  189. package/tests/c-style/heliacal.test.ts +34 -0
  190. package/tests/c-style/houses.test.ts +135 -0
  191. package/tests/c-style/math-utils.test.ts +160 -0
  192. package/tests/c-style/orbital.test.ts +78 -0
  193. package/tests/c-style/phenomena.test.ts +42 -0
  194. package/tests/c-style/planetocentric.test.ts +26 -0
  195. package/tests/c-style/planets.test.ts +117 -0
  196. package/tests/c-style/rise-set.test.ts +71 -0
  197. package/tests/helpers.ts +21 -0
  198. package/tests/modern/ayanamsa.test.ts +47 -0
  199. package/tests/modern/calc.test.ts +113 -0
  200. package/tests/modern/config.test.ts +46 -0
  201. package/tests/modern/crossings.test.ts +45 -0
  202. package/tests/modern/eclipses.test.ts +81 -0
  203. package/tests/modern/errors.test.ts +71 -0
  204. package/tests/modern/heliacal.test.ts +30 -0
  205. package/tests/modern/houses.test.ts +87 -0
  206. package/tests/modern/orbital.test.ts +79 -0
  207. package/tests/modern/phenomena.test.ts +41 -0
  208. package/tests/modern/rise-set.test.ts +60 -0
  209. package/tests/modern/statics.test.ts +99 -0
  210. package/tests/modern/utilities.test.ts +70 -0
  211. package/tsconfig.json +20 -0
@@ -0,0 +1,762 @@
1
+ /*************************************************************
2
+ * Swiss Ephemeris constants — translated from swephexp.h, sweph.h, sweodef.h
3
+ *
4
+ * Copyright (C) 1997 - 2021 Astrodienst AG, Switzerland.
5
+ * All rights reserved.
6
+ *
7
+ * This file is part of Swiss Ephemeris (AGPL).
8
+ *************************************************************/
9
+
10
+ export const SE_VERSION = "2.10.03";
11
+
12
+ /* ---- Mathematical constants ---- */
13
+ export const PI = Math.PI;
14
+ export const TWOPI = 2.0 * PI;
15
+ export const RADTODEG = 180.0 / PI;
16
+ export const DEGTORAD = PI / 180.0;
17
+
18
+ /* ---- Centisecond angle constants ---- */
19
+ export const DEG = 360000; // 1 degree in centiseconds
20
+ export const DEG7_30 = 2700000; // 7.5 degrees
21
+ export const DEG15 = 15 * DEG;
22
+ export const DEG24 = 24 * DEG;
23
+ export const DEG30 = 30 * DEG;
24
+ export const DEG60 = 60 * DEG;
25
+ export const DEG90 = 90 * DEG;
26
+ export const DEG120 = 120 * DEG;
27
+ export const DEG150 = 150 * DEG;
28
+ export const DEG180 = 180 * DEG;
29
+ export const DEG270 = 270 * DEG;
30
+ export const DEG360 = 360 * DEG;
31
+ export const CSTORAD = DEGTORAD / 360000.0;
32
+ export const RADTOCS = RADTODEG * 360000.0;
33
+ export const CS2DEG = 1.0 / 360000.0;
34
+
35
+ /* ---- Calendar flags for julDay() / revJul() ---- */
36
+ export const SE_JUL_CAL = 0;
37
+ export const SE_GREG_CAL = 1;
38
+
39
+ /* ---- Epoch constants ---- */
40
+ export const J2000 = 2451545.0; // 2000 January 1.5
41
+ export const B1950 = 2433282.42345905;
42
+ export const J1900 = 2415020.0; // 1900 January 0.5
43
+ export const B1850 = 2396758.2035810;
44
+
45
+ /* ---- Planet numbers for swe_calc() ipl parameter ---- */
46
+ export const SE_ECL_NUT = -1;
47
+
48
+ export const SE_SUN = 0;
49
+ export const SE_MOON = 1;
50
+ export const SE_MERCURY = 2;
51
+ export const SE_VENUS = 3;
52
+ export const SE_MARS = 4;
53
+ export const SE_JUPITER = 5;
54
+ export const SE_SATURN = 6;
55
+ export const SE_URANUS = 7;
56
+ export const SE_NEPTUNE = 8;
57
+ export const SE_PLUTO = 9;
58
+ export const SE_MEAN_NODE = 10;
59
+ export const SE_TRUE_NODE = 11;
60
+ export const SE_MEAN_APOG = 12; // mean Lilith
61
+ export const SE_OSCU_APOG = 13; // osculating Lilith
62
+ export const SE_EARTH = 14;
63
+ export const SE_CHIRON = 15;
64
+ export const SE_PHOLUS = 16;
65
+ export const SE_CERES = 17;
66
+ export const SE_PALLAS = 18;
67
+ export const SE_JUNO = 19;
68
+ export const SE_VESTA = 20;
69
+ export const SE_INTP_APOG = 21; // interpolated Lilith
70
+ export const SE_INTP_PERG = 22; // interpolated Perigee
71
+
72
+ export const SE_NPLANETS = 23;
73
+
74
+ export const SE_PLMOON_OFFSET = 9000;
75
+ export const SE_AST_OFFSET = 10000;
76
+ export const SE_VARUNA = SE_AST_OFFSET + 20000;
77
+
78
+ export const SE_FICT_OFFSET = 40;
79
+ export const SE_FICT_OFFSET_1 = 39;
80
+ export const SE_FICT_MAX = 999;
81
+ export const SE_NFICT_ELEM = 15;
82
+
83
+ export const SE_COMET_OFFSET = 1000;
84
+
85
+ export const SE_NALL_NAT_POINTS = SE_NPLANETS + SE_NFICT_ELEM;
86
+
87
+ /* Hamburger / Uranian "planets" */
88
+ export const SE_CUPIDO = 40;
89
+ export const SE_HADES = 41;
90
+ export const SE_ZEUS = 42;
91
+ export const SE_KRONOS = 43;
92
+ export const SE_APOLLON = 44;
93
+ export const SE_ADMETOS = 45;
94
+ export const SE_VULKANUS = 46;
95
+ export const SE_POSEIDON = 47;
96
+ /* other fictitious bodies */
97
+ export const SE_ISIS = 48;
98
+ export const SE_NIBIRU = 49;
99
+ export const SE_HARRINGTON = 50;
100
+ export const SE_NEPTUNE_LEVERRIER = 51;
101
+ export const SE_NEPTUNE_ADAMS = 52;
102
+ export const SE_PLUTO_LOWELL = 53;
103
+ export const SE_PLUTO_PICKERING = 54;
104
+ export const SE_VULCAN = 55;
105
+ export const SE_WHITE_MOON = 56;
106
+ export const SE_PROSERPINA = 57;
107
+ export const SE_WALDEMATH = 58;
108
+
109
+ export const SE_FIXSTAR = -10;
110
+
111
+ /* ---- House-related angle indices ---- */
112
+ export const SE_ASC = 0;
113
+ export const SE_MC = 1;
114
+ export const SE_ARMC = 2;
115
+ export const SE_VERTEX = 3;
116
+ export const SE_EQUASC = 4; // equatorial ascendant
117
+ export const SE_COASC1 = 5; // co-ascendant (W. Koch)
118
+ export const SE_COASC2 = 6; // co-ascendant (M. Munkasey)
119
+ export const SE_POLASC = 7; // polar ascendant (M. Munkasey)
120
+ export const SE_NASCMC = 8;
121
+
122
+ /* ---- Calculation flags for swe_calc() iflag parameter ---- */
123
+ export const SEFLG_JPLEPH = 1;
124
+ export const SEFLG_SWIEPH = 2;
125
+ export const SEFLG_MOSEPH = 4;
126
+
127
+ export const SEFLG_HELCTR = 8; // heliocentric position
128
+ export const SEFLG_TRUEPOS = 16; // true/geometric position
129
+ export const SEFLG_J2000 = 32; // no precession, J2000 equinox
130
+ export const SEFLG_NONUT = 64; // no nutation, mean equinox of date
131
+ export const SEFLG_SPEED3 = 128; // speed from 3 positions (avoid)
132
+ export const SEFLG_SPEED = 256; // high precision speed
133
+ export const SEFLG_NOGDEFL = 512; // turn off gravitational deflection
134
+ export const SEFLG_NOABERR = 1024; // turn off aberration of light
135
+ export const SEFLG_ASTROMETRIC = SEFLG_NOABERR | SEFLG_NOGDEFL;
136
+ export const SEFLG_EQUATORIAL = 2 * 1024; // 2048
137
+ export const SEFLG_XYZ = 4 * 1024; // 4096
138
+ export const SEFLG_RADIANS = 8 * 1024; // 8192
139
+ export const SEFLG_BARYCTR = 16 * 1024; // 16384
140
+ export const SEFLG_TOPOCTR = 32 * 1024; // 32768
141
+ export const SEFLG_ORBEL_AA = SEFLG_TOPOCTR;
142
+ export const SEFLG_TROPICAL = 0;
143
+ export const SEFLG_SIDEREAL = 64 * 1024; // 65536
144
+ export const SEFLG_ICRS = 128 * 1024; // 131072
145
+ export const SEFLG_DPSIDEPS_1980 = 256 * 1024;
146
+ export const SEFLG_JPLHOR = SEFLG_DPSIDEPS_1980;
147
+ export const SEFLG_JPLHOR_APPROX = 512 * 1024;
148
+ export const SEFLG_CENTER_BODY = 1024 * 1024;
149
+ export const SEFLG_TEST_PLMOON = 2 * 1024 * 1024 | SEFLG_J2000 | SEFLG_ICRS | SEFLG_HELCTR | SEFLG_TRUEPOS;
150
+
151
+ /* default ephemeris when no flag bit is set */
152
+ export const SEFLG_DEFAULTEPH = SEFLG_SWIEPH;
153
+
154
+ /* ---- Sidereal mode bits ---- */
155
+ export const SE_SIDBITS = 256;
156
+ export const SE_SIDBIT_ECL_T0 = 256;
157
+ export const SE_SIDBIT_SSY_PLANE = 512;
158
+ export const SE_SIDBIT_USER_UT = 1024;
159
+ export const SE_SIDBIT_ECL_DATE = 2048;
160
+ export const SE_SIDBIT_NO_PREC_OFFSET = 4096;
161
+ export const SE_SIDBIT_PREC_ORIG = 8192;
162
+
163
+ /* ---- Sidereal modes (ayanamsas) ---- */
164
+ export const SE_SIDM_FAGAN_BRADLEY = 0;
165
+ export const SE_SIDM_LAHIRI = 1;
166
+ export const SE_SIDM_DELUCE = 2;
167
+ export const SE_SIDM_RAMAN = 3;
168
+ export const SE_SIDM_USHASHASHI = 4;
169
+ export const SE_SIDM_KRISHNAMURTI = 5;
170
+ export const SE_SIDM_DJWHAL_KHUL = 6;
171
+ export const SE_SIDM_YUKTESHWAR = 7;
172
+ export const SE_SIDM_JN_BHASIN = 8;
173
+ export const SE_SIDM_BABYL_KUGLER1 = 9;
174
+ export const SE_SIDM_BABYL_KUGLER2 = 10;
175
+ export const SE_SIDM_BABYL_KUGLER3 = 11;
176
+ export const SE_SIDM_BABYL_HUBER = 12;
177
+ export const SE_SIDM_BABYL_ETPSC = 13;
178
+ export const SE_SIDM_ALDEBARAN_15TAU = 14;
179
+ export const SE_SIDM_HIPPARCHOS = 15;
180
+ export const SE_SIDM_SASSANIAN = 16;
181
+ export const SE_SIDM_GALCENT_0SAG = 17;
182
+ export const SE_SIDM_J2000 = 18;
183
+ export const SE_SIDM_J1900 = 19;
184
+ export const SE_SIDM_B1950 = 20;
185
+ export const SE_SIDM_SURYASIDDHANTA = 21;
186
+ export const SE_SIDM_SURYASIDDHANTA_MSUN = 22;
187
+ export const SE_SIDM_ARYABHATA = 23;
188
+ export const SE_SIDM_ARYABHATA_MSUN = 24;
189
+ export const SE_SIDM_SS_REVATI = 25;
190
+ export const SE_SIDM_SS_CITRA = 26;
191
+ export const SE_SIDM_TRUE_CITRA = 27;
192
+ export const SE_SIDM_TRUE_REVATI = 28;
193
+ export const SE_SIDM_TRUE_PUSHYA = 29;
194
+ export const SE_SIDM_GALCENT_RGILBRAND = 30;
195
+ export const SE_SIDM_GALEQU_IAU1958 = 31;
196
+ export const SE_SIDM_GALEQU_TRUE = 32;
197
+ export const SE_SIDM_GALEQU_MULA = 33;
198
+ export const SE_SIDM_GALALIGN_MARDYKS = 34;
199
+ export const SE_SIDM_TRUE_MULA = 35;
200
+ export const SE_SIDM_GALCENT_MULA_WILHELM = 36;
201
+ export const SE_SIDM_ARYABHATA_522 = 37;
202
+ export const SE_SIDM_BABYL_BRITTON = 38;
203
+ export const SE_SIDM_TRUE_SHEORAN = 39;
204
+ export const SE_SIDM_GALCENT_COCHRANE = 40;
205
+ export const SE_SIDM_GALEQU_FIORENZA = 41;
206
+ export const SE_SIDM_VALENS_MOON = 42;
207
+ export const SE_SIDM_LAHIRI_1940 = 43;
208
+ export const SE_SIDM_LAHIRI_VP285 = 44;
209
+ export const SE_SIDM_KRISHNAMURTI_VP291 = 45;
210
+ export const SE_SIDM_LAHIRI_ICRC = 46;
211
+ export const SE_SIDM_USER = 255;
212
+
213
+ export const SE_NSIDM_PREDEF = 47;
214
+
215
+ /* ---- Node / apside calculation modes ---- */
216
+ export const SE_NODBIT_MEAN = 1;
217
+ export const SE_NODBIT_OSCU = 2;
218
+ export const SE_NODBIT_OSCU_BAR = 4;
219
+ export const SE_NODBIT_FOPOINT = 256;
220
+
221
+ /* ---- Eclipse defines ---- */
222
+ export const SE_ECL_CENTRAL = 1;
223
+ export const SE_ECL_NONCENTRAL = 2;
224
+ export const SE_ECL_TOTAL = 4;
225
+ export const SE_ECL_ANNULAR = 8;
226
+ export const SE_ECL_PARTIAL = 16;
227
+ export const SE_ECL_ANNULAR_TOTAL = 32;
228
+ export const SE_ECL_HYBRID = 32;
229
+ export const SE_ECL_PENUMBRAL = 64;
230
+ export const SE_ECL_ALLTYPES_SOLAR = SE_ECL_CENTRAL | SE_ECL_NONCENTRAL | SE_ECL_TOTAL | SE_ECL_ANNULAR | SE_ECL_PARTIAL | SE_ECL_ANNULAR_TOTAL;
231
+ export const SE_ECL_ALLTYPES_LUNAR = SE_ECL_TOTAL | SE_ECL_PARTIAL | SE_ECL_PENUMBRAL;
232
+ export const SE_ECL_VISIBLE = 128;
233
+ export const SE_ECL_MAX_VISIBLE = 256;
234
+ export const SE_ECL_1ST_VISIBLE = 512;
235
+ export const SE_ECL_PARTBEG_VISIBLE = 512;
236
+ export const SE_ECL_2ND_VISIBLE = 1024;
237
+ export const SE_ECL_TOTBEG_VISIBLE = 1024;
238
+ export const SE_ECL_3RD_VISIBLE = 2048;
239
+ export const SE_ECL_TOTEND_VISIBLE = 2048;
240
+ export const SE_ECL_4TH_VISIBLE = 4096;
241
+ export const SE_ECL_PARTEND_VISIBLE = 4096;
242
+ export const SE_ECL_PENUMBBEG_VISIBLE = 8192;
243
+ export const SE_ECL_PENUMBEND_VISIBLE = 16384;
244
+ export const SE_ECL_OCC_BEG_DAYLIGHT = 8192;
245
+ export const SE_ECL_OCC_END_DAYLIGHT = 16384;
246
+ export const SE_ECL_ONE_TRY = 32 * 1024;
247
+
248
+ /* ---- Rise / Transit ---- */
249
+ export const SE_CALC_RISE = 1;
250
+ export const SE_CALC_SET = 2;
251
+ export const SE_CALC_MTRANSIT = 4;
252
+ export const SE_CALC_ITRANSIT = 8;
253
+ export const SE_BIT_DISC_CENTER = 256;
254
+ export const SE_BIT_DISC_BOTTOM = 8192;
255
+ export const SE_BIT_GEOCTR_NO_ECL_LAT = 128;
256
+ export const SE_BIT_NO_REFRACTION = 512;
257
+ export const SE_BIT_CIVIL_TWILIGHT = 1024;
258
+ export const SE_BIT_NAUTIC_TWILIGHT = 2048;
259
+ export const SE_BIT_ASTRO_TWILIGHT = 4096;
260
+ export const SE_BIT_FIXED_DISC_SIZE = 16384;
261
+ export const SE_BIT_FORCE_SLOW_METHOD = 32768;
262
+ export const SE_BIT_HINDU_RISING = SE_BIT_DISC_CENTER | SE_BIT_NO_REFRACTION | SE_BIT_GEOCTR_NO_ECL_LAT;
263
+
264
+ /* ---- Coordinate transformation ---- */
265
+ export const SE_ECL2HOR = 0;
266
+ export const SE_EQU2HOR = 1;
267
+ export const SE_HOR2ECL = 0;
268
+ export const SE_HOR2EQU = 1;
269
+
270
+ /* ---- Refraction ---- */
271
+ export const SE_TRUE_TO_APP = 0;
272
+ export const SE_APP_TO_TRUE = 1;
273
+
274
+ /* ---- split_deg flags ---- */
275
+ export const SE_SPLIT_DEG_ROUND_SEC = 1;
276
+ export const SE_SPLIT_DEG_ROUND_MIN = 2;
277
+ export const SE_SPLIT_DEG_ROUND_DEG = 4;
278
+ export const SE_SPLIT_DEG_ZODIACAL = 8;
279
+ export const SE_SPLIT_DEG_NAKSHATRA = 1024;
280
+ export const SE_SPLIT_DEG_KEEP_SIGN = 16;
281
+ export const SE_SPLIT_DEG_KEEP_DEG = 32;
282
+
283
+ /* ---- Tidal acceleration values ---- */
284
+ export const SE_TIDAL_DE200 = -23.8946;
285
+ export const SE_TIDAL_DE403 = -25.580;
286
+ export const SE_TIDAL_DE404 = -25.580;
287
+ export const SE_TIDAL_DE405 = -25.826;
288
+ export const SE_TIDAL_DE406 = -25.826;
289
+ export const SE_TIDAL_DE421 = -25.85;
290
+ export const SE_TIDAL_DE422 = -25.85;
291
+ export const SE_TIDAL_DE430 = -25.82;
292
+ export const SE_TIDAL_DE431 = -25.80;
293
+ export const SE_TIDAL_DE441 = -25.936;
294
+ export const SE_TIDAL_26 = -26.0;
295
+ export const SE_TIDAL_STEPHENSON_2016 = -25.85;
296
+ export const SE_TIDAL_DEFAULT = SE_TIDAL_DE431;
297
+ export const SE_TIDAL_AUTOMATIC = 999999;
298
+ export const SE_TIDAL_MOSEPH = SE_TIDAL_DE404;
299
+ export const SE_TIDAL_SWIEPH = SE_TIDAL_DEFAULT;
300
+ export const SE_TIDAL_JPLEPH = SE_TIDAL_DEFAULT;
301
+
302
+ export const SE_DELTAT_AUTOMATIC = -1E-10;
303
+
304
+ /* ---- Astro model indices ---- */
305
+ export const SE_MODEL_DELTAT = 0;
306
+ export const SE_MODEL_PREC_LONGTERM = 1;
307
+ export const SE_MODEL_PREC_SHORTTERM = 2;
308
+ export const SE_MODEL_NUT = 3;
309
+ export const SE_MODEL_BIAS = 4;
310
+ export const SE_MODEL_JPLHOR_MODE = 5;
311
+ export const SE_MODEL_JPLHORA_MODE = 6;
312
+ export const SE_MODEL_SIDT = 7;
313
+ export const NSE_MODELS = 8;
314
+
315
+ /* ---- Precession models ---- */
316
+ export const SEMOD_NPREC = 11;
317
+ export const SEMOD_PREC_IAU_1976 = 1;
318
+ export const SEMOD_PREC_LASKAR_1986 = 2;
319
+ export const SEMOD_PREC_WILL_EPS_LASK = 3;
320
+ export const SEMOD_PREC_WILLIAMS_1994 = 4;
321
+ export const SEMOD_PREC_SIMON_1994 = 5;
322
+ export const SEMOD_PREC_IAU_2000 = 6;
323
+ export const SEMOD_PREC_BRETAGNON_2003 = 7;
324
+ export const SEMOD_PREC_IAU_2006 = 8;
325
+ export const SEMOD_PREC_VONDRAK_2011 = 9;
326
+ export const SEMOD_PREC_OWEN_1990 = 10;
327
+ export const SEMOD_PREC_NEWCOMB = 11;
328
+ export const SEMOD_PREC_DEFAULT = SEMOD_PREC_VONDRAK_2011;
329
+ export const SEMOD_PREC_DEFAULT_SHORT = SEMOD_PREC_VONDRAK_2011;
330
+
331
+ /* ---- Nutation models ---- */
332
+ export const SEMOD_NNUT = 5;
333
+ export const SEMOD_NUT_IAU_1980 = 1;
334
+ export const SEMOD_NUT_IAU_CORR_1987 = 2;
335
+ export const SEMOD_NUT_IAU_2000A = 3;
336
+ export const SEMOD_NUT_IAU_2000B = 4;
337
+ export const SEMOD_NUT_WOOLARD = 5;
338
+ export const SEMOD_NUT_DEFAULT = SEMOD_NUT_IAU_2000B;
339
+
340
+ /* ---- Sidereal time models ---- */
341
+ export const SEMOD_NSIDT = 4;
342
+ export const SEMOD_SIDT_IAU_1976 = 1;
343
+ export const SEMOD_SIDT_IAU_2006 = 2;
344
+ export const SEMOD_SIDT_IERS_CONV_2010 = 3;
345
+ export const SEMOD_SIDT_LONGTERM = 4;
346
+ export const SEMOD_SIDT_DEFAULT = SEMOD_SIDT_LONGTERM;
347
+
348
+ /* ---- Frame bias models ---- */
349
+ export const SEMOD_NBIAS = 3;
350
+ export const SEMOD_BIAS_NONE = 1;
351
+ export const SEMOD_BIAS_IAU2000 = 2;
352
+ export const SEMOD_BIAS_IAU2006 = 3;
353
+ export const SEMOD_BIAS_DEFAULT = SEMOD_BIAS_IAU2006;
354
+
355
+ /* ---- JPL Horizons models ---- */
356
+ export const SEMOD_NJPLHOR = 2;
357
+ export const SEMOD_JPLHOR_LONG_AGREEMENT = 1;
358
+ export const SEMOD_JPLHOR_DEFAULT = SEMOD_JPLHOR_LONG_AGREEMENT;
359
+
360
+ export const SEMOD_NJPLHORA = 3;
361
+ export const SEMOD_JPLHORA_1 = 1;
362
+ export const SEMOD_JPLHORA_2 = 2;
363
+ export const SEMOD_JPLHORA_3 = 3;
364
+ export const SEMOD_JPLHORA_DEFAULT = SEMOD_JPLHORA_3;
365
+
366
+ /* ---- Delta T models ---- */
367
+ export const SEMOD_NDELTAT = 5;
368
+ export const SEMOD_DELTAT_STEPHENSON_MORRISON_1984 = 1;
369
+ export const SEMOD_DELTAT_STEPHENSON_1997 = 2;
370
+ export const SEMOD_DELTAT_STEPHENSON_MORRISON_2004 = 3;
371
+ export const SEMOD_DELTAT_ESPENAK_MEEUS_2006 = 4;
372
+ export const SEMOD_DELTAT_STEPHENSON_ETC_2016 = 5;
373
+ export const SEMOD_DELTAT_DEFAULT = SEMOD_DELTAT_STEPHENSON_ETC_2016;
374
+
375
+ /* ---- Ephemeris flag mask ---- */
376
+ export const SEFLG_EPHMASK = (SEFLG_JPLEPH | SEFLG_SWIEPH | SEFLG_MOSEPH);
377
+
378
+ /* ---- JPL Horizons frame-bias constants (from swephlib.h) ---- */
379
+ export const DPSI_DEPS_IAU1980_TJD0_HORIZONS = 2437684.5;
380
+ export const HORIZONS_TJD0_DPSI_DEPS_IAU1980 = 2437684.5;
381
+ export const DPSI_IAU1980_TJD0 = 64.284 / 1000.0; // arcsec
382
+ export const DEPS_IAU1980_TJD0 = 6.151 / 1000.0; // arcsec
383
+
384
+ /* ---- Unit conversions ---- */
385
+ export const SE_AUNIT_TO_KM = 149597870.700;
386
+ export const SE_AUNIT_TO_LIGHTYEAR = 1.0 / 63241.07708427;
387
+ export const SE_AUNIT_TO_PARSEC = 1.0 / 206264.8062471;
388
+
389
+ export const SE_MAX_STNAME = 256;
390
+
391
+ /* ---- DE number ---- */
392
+ export const SE_DE_NUMBER = 431;
393
+
394
+ /* ---- House system codes ---- */
395
+ export const HOUSE_PLACIDUS = 'P';
396
+ export const HOUSE_KOCH = 'K';
397
+ export const HOUSE_EQUAL = 'E';
398
+ export const HOUSE_WHOLE_SIGN = 'W';
399
+ export const HOUSE_CAMPANUS = 'C';
400
+ export const HOUSE_REGIOMONTANUS = 'R';
401
+ export const HOUSE_TOPOCENTRIC = 'T';
402
+
403
+ /* ====================================================================
404
+ * Internal constants (from sweph.h) — used by the engine, not public API
405
+ * ==================================================================== */
406
+
407
+ export const ENDMARK = -99;
408
+
409
+ /* internal body indices */
410
+ export const SEI_EPSILON = -2;
411
+ export const SEI_NUTATION = -1;
412
+ export const SEI_EMB = 0;
413
+ export const SEI_EARTH = 0;
414
+ export const SEI_SUN = 0;
415
+ export const SEI_MOON = 1;
416
+ export const SEI_MERCURY = 2;
417
+ export const SEI_VENUS = 3;
418
+ export const SEI_MARS = 4;
419
+ export const SEI_JUPITER = 5;
420
+ export const SEI_SATURN = 6;
421
+ export const SEI_URANUS = 7;
422
+ export const SEI_NEPTUNE = 8;
423
+ export const SEI_PLUTO = 9;
424
+ export const SEI_SUNBARY = 10; // barycentric sun
425
+ export const SEI_ANYBODY = 11;
426
+ export const SEI_CHIRON = 12;
427
+ export const SEI_PHOLUS = 13;
428
+ export const SEI_CERES = 14;
429
+ export const SEI_PALLAS = 15;
430
+ export const SEI_JUNO = 16;
431
+ export const SEI_VESTA = 17;
432
+
433
+ export const SEI_NPLANETS = 18;
434
+
435
+ export const SEI_MEAN_NODE = 0;
436
+ export const SEI_TRUE_NODE = 1;
437
+ export const SEI_MEAN_APOG = 2;
438
+ export const SEI_OSCU_APOG = 3;
439
+ export const SEI_INTP_APOG = 4;
440
+ export const SEI_INTP_PERG = 5;
441
+
442
+ export const SEI_NNODE_ETC = 6;
443
+
444
+ export const SEI_FLG_HELIO = 1;
445
+ export const SEI_FLG_ROTATE = 2;
446
+ export const SEI_FLG_ELLIPSE = 4;
447
+ export const SEI_FLG_EMBHEL = 8;
448
+
449
+ /* file types */
450
+ export const SEI_FILE_PLANET = 0;
451
+ export const SEI_FILE_MOON = 1;
452
+ export const SEI_FILE_MAIN_AST = 2;
453
+ export const SEI_FILE_ANY_AST = 3;
454
+ export const SEI_FILE_FIXSTAR = 4;
455
+ export const SEI_FILE_PLMOON = 5;
456
+
457
+ export const SEI_FILE_TEST_ENDIAN = 0x616263; // "abc"
458
+ export const SEI_FILE_BIGENDIAN = 0;
459
+ export const SEI_FILE_NOREORD = 0;
460
+ export const SEI_FILE_LITENDIAN = 1;
461
+ export const SEI_FILE_REORD = 2;
462
+
463
+ export const SEI_FILE_NMAXPLAN = 50;
464
+ export const SEI_FILE_EFPOSBEGIN = 500;
465
+
466
+ export const SE_FILE_SUFFIX = "se1";
467
+
468
+ export const SEI_NEPHFILES = 7;
469
+ export const SEI_CURR_FPOS = -1;
470
+ export const SEI_NMODELS = 8;
471
+
472
+ export const SEI_ECL_GEOALT_MAX = 25000.0;
473
+ export const SEI_ECL_GEOALT_MIN = -500.0;
474
+
475
+ /* MPC asteroid numbers */
476
+ export const MPC_CERES = 1;
477
+ export const MPC_PALLAS = 2;
478
+ export const MPC_JUNO = 3;
479
+ export const MPC_VESTA = 4;
480
+ export const MPC_CHIRON = 2060;
481
+ export const MPC_PHOLUS = 5145;
482
+
483
+ /* ephemeris time ranges */
484
+ export const CHIRON_START = 1967601.5; // 1.1.675
485
+ export const CHIRON_END = 3419437.5; // 1.1.4650
486
+ export const PHOLUS_START = 640648.5; // 1.1.-2958 jul
487
+ export const PHOLUS_END = 4390617.5; // 1.1.7309
488
+ export const MOSHPLEPH_START = 625000.5;
489
+ export const MOSHPLEPH_END = 2818000.5;
490
+ export const MOSHLUEPH_START = 625000.5;
491
+ export const MOSHLUEPH_END = 2818000.5;
492
+ export const MOSHNDEPH_START = -3100015.5;
493
+ export const MOSHNDEPH_END = 8000016.5;
494
+ export const JPL_DE431_START = -3027215.5;
495
+ export const JPL_DE431_END = 7930192.5;
496
+
497
+ export const MAXORD = 40;
498
+ export const NCTIES = 6.0; // number of centuries per ephemeris file
499
+
500
+ export const OK = 0;
501
+ export const ERR = -1;
502
+ export const NOT_AVAILABLE = -2;
503
+ export const BEYOND_EPH_LIMITS = -3;
504
+
505
+ export const J_TO_J2000 = 1;
506
+ export const J2000_TO_J = -1;
507
+
508
+ /* ---- Physical constants ---- */
509
+ export const MOON_MEAN_DIST = 384400000.0; // in m, AA 1996
510
+ export const MOON_MEAN_INCL = 5.1453964;
511
+ export const MOON_MEAN_ECC = 0.054900489;
512
+ export const SUN_EARTH_MRAT = 332946.050895; // Su / (Ea only) AA 2006 K7
513
+ export const EARTH_MOON_MRAT = 1 / 0.0123000383; // AA 2006, K7
514
+ export const AUNIT = 1.49597870700e+11; // AU in meters, DE431
515
+ export const CLIGHT = 2.99792458e+8; // m/s
516
+ export const HELGRAVCONST = 1.32712440017987e+20; // G * M(sun) m^3/sec^2
517
+ export const GEOGCONST = 3.98600448e+14; // G * M(earth) m^3/sec^2
518
+ export const KGAUSS = 0.01720209895; // Gaussian gravitational constant
519
+ export const SUN_RADIUS = 959.63 / 3600 * DEGTORAD;
520
+ export const EARTH_RADIUS = 6378136.6;
521
+ export const EARTH_OBLATENESS = 1.0 / 298.25642;
522
+ export const EARTH_ROT_SPEED = 7.2921151467e-5 * 86400; // in rad/day
523
+
524
+ export const LIGHTTIME_AUNIT = 499.0047838362 / 3600.0 / 24.0; // ~8.3167 min (days)
525
+ export const PARSEC_TO_AUNIT = 206264.8062471;
526
+
527
+ /* solar system plane */
528
+ export const SSY_PLANE_NODE_E2000 = 107.582569 * DEGTORAD;
529
+ export const SSY_PLANE_NODE = 107.58883388 * DEGTORAD;
530
+ export const SSY_PLANE_INCL = 1.578701 * DEGTORAD;
531
+
532
+ export const KM_S_TO_AU_CTY = 21.095;
533
+
534
+ /* speed computation intervals */
535
+ export const MOON_SPEED_INTV = 0.00005; // 4.32 seconds (in days)
536
+ export const PLAN_SPEED_INTV = 0.0001; // 8.64 seconds (in days)
537
+ export const MEAN_NODE_SPEED_INTV = 0.001;
538
+ export const NODE_CALC_INTV = 0.0001;
539
+ export const NODE_CALC_INTV_MOSH = 0.1;
540
+ export const NUT_SPEED_INTV = 0.0001;
541
+ export const DEFL_SPEED_INTV = 0.0000005;
542
+
543
+ export const SE_LAPSE_RATE = 0.0065; // deg K / m, for refraction
544
+
545
+ export const NDIAM = SE_VESTA + 1; // 21
546
+
547
+ export const STR = 4.8481368110953599359e-6; // radians per arc second
548
+
549
+ export const AS_MAXCH = 256;
550
+ export const HUGE_VAL = 1.7e+308;
551
+
552
+ export const SWI_STAR_LENGTH = 40;
553
+
554
+ /* ---- Eclipse geometry constants ---- */
555
+ export const DSUN = 1392000000.0 / AUNIT;
556
+ export const DMOON = 3476300.0 / AUNIT;
557
+ export const DEARTH_ECL = 6378140.0 * 2 / AUNIT;
558
+ export const RSUN_ECL = DSUN / 2;
559
+ export const RMOON = DMOON / 2;
560
+ export const REARTH_ECL = DEARTH_ECL / 2;
561
+ export const SAROS_CYCLE = 6585.3213;
562
+ export const NSAROS_SOLAR = 181;
563
+ export const NSAROS_LUNAR = 180;
564
+
565
+ /* dpsi and deps loaded for 100 years after 1962 */
566
+ export const SWE_DATA_DPSI_DEPS = 36525;
567
+
568
+ /* precession time range constants */
569
+ export const PREC_IAU_1976_CTIES = 2.0;
570
+ export const PREC_IAU_2000_CTIES = 2.0;
571
+ export const PREC_IAU_2006_CTIES = 75.0;
572
+
573
+ /* ---- Planet name table ---- */
574
+ export const SE_PLANET_NAMES: readonly string[] = [
575
+ "Sun", // 0
576
+ "Moon", // 1
577
+ "Mercury", // 2
578
+ "Venus", // 3
579
+ "Mars", // 4
580
+ "Jupiter", // 5
581
+ "Saturn", // 6
582
+ "Uranus", // 7
583
+ "Neptune", // 8
584
+ "Pluto", // 9
585
+ "mean Node", // 10
586
+ "true Node", // 11
587
+ "mean Apogee", // 12
588
+ "osc. Apogee", // 13
589
+ "Earth", // 14
590
+ "Chiron", // 15
591
+ "Pholus", // 16
592
+ "Ceres", // 17
593
+ "Pallas", // 18
594
+ "Juno", // 19
595
+ "Vesta", // 20
596
+ "intp. Apogee", // 21
597
+ "intp. Perigee", // 22
598
+ ];
599
+
600
+ export const SE_FICTITIOUS_NAMES: readonly string[] = [
601
+ "Cupido",
602
+ "Hades",
603
+ "Zeus",
604
+ "Kronos",
605
+ "Apollon",
606
+ "Admetos",
607
+ "Vulkanus",
608
+ "Poseidon",
609
+ "Isis",
610
+ "Nibiru",
611
+ "Harrington",
612
+ "Leverrier",
613
+ "Adams",
614
+ "Lowell",
615
+ "Pickering",
616
+ "Vulcan",
617
+ "White Moon",
618
+ "Proserpina",
619
+ "Waldemath",
620
+ ];
621
+
622
+ /* ---- Planetary radii in meters (index = SE_* planet number) ---- */
623
+ export const PLA_DIAM: readonly number[] = [
624
+ 1392000000.0, // Sun
625
+ 3475000.0, // Moon
626
+ 2439400.0 * 2, // Mercury
627
+ 6051800.0 * 2, // Venus
628
+ 3389500.0 * 2, // Mars
629
+ 69911000.0 * 2, // Jupiter
630
+ 58232000.0 * 2, // Saturn
631
+ 25362000.0 * 2, // Uranus
632
+ 24622000.0 * 2, // Neptune
633
+ 1188300.0 * 2, // Pluto
634
+ 0, 0, 0, 0, // nodes and apogees
635
+ 6371008.4 * 2, // Earth
636
+ 271370.0, // Chiron
637
+ 290000.0, // Pholus
638
+ 939400.0, // Ceres
639
+ 545000.0, // Pallas
640
+ 246596.0, // Juno
641
+ 525400.0, // Vesta
642
+ ];
643
+
644
+ /* ---- Ayanamsa initialization data ---- */
645
+ export interface AyaInit {
646
+ t0: number;
647
+ ayanT0: number;
648
+ t0IsUT: boolean;
649
+ precOffset: number; // 0 = no correction, -1 = unclear/not applied
650
+ }
651
+
652
+ export const AYANAMSA: readonly AyaInit[] = [
653
+ { t0: 2433282.42346, ayanT0: 24.042044444, t0IsUT: false, precOffset: SEMOD_PREC_NEWCOMB }, // 0: Fagan/Bradley
654
+ { t0: 2435553.5, ayanT0: 23.250182778 - 0.004658035, t0IsUT: false, precOffset: SEMOD_PREC_IAU_1976 }, // 1: Lahiri
655
+ { t0: 1721057.5, ayanT0: 0, t0IsUT: true, precOffset: 0 }, // 2: DeLuce
656
+ { t0: J1900, ayanT0: 360 - 338.98556, t0IsUT: false, precOffset: SEMOD_PREC_NEWCOMB }, // 3: Raman
657
+ { t0: J1900, ayanT0: 360 - 341.33904, t0IsUT: false, precOffset: -1 }, // 4: Usha/Shashi
658
+ { t0: J1900, ayanT0: 360 - 337.636111, t0IsUT: false, precOffset: SEMOD_PREC_NEWCOMB }, // 5: Krishnamurti
659
+ { t0: J1900, ayanT0: 360 - 333.0369024, t0IsUT: false, precOffset: 0 }, // 6: Djwhal Khul
660
+ { t0: J1900, ayanT0: 360 - 338.917778, t0IsUT: false, precOffset: -1 }, // 7: Yukteshwar
661
+ { t0: J1900, ayanT0: 360 - 338.634444, t0IsUT: false, precOffset: -1 }, // 8: Bhasin
662
+ { t0: 1684532.5, ayanT0: -5.66667, t0IsUT: true, precOffset: -1 }, // 9: Kugler 1
663
+ { t0: 1684532.5, ayanT0: -4.26667, t0IsUT: true, precOffset: -1 }, // 10: Kugler 2
664
+ { t0: 1684532.5, ayanT0: -3.41667, t0IsUT: true, precOffset: -1 }, // 11: Kugler 3
665
+ { t0: 1684532.5, ayanT0: -4.46667, t0IsUT: true, precOffset: -1 }, // 12: Huber
666
+ { t0: 1673941, ayanT0: -5.079167, t0IsUT: true, precOffset: -1 }, // 13: Mercier
667
+ { t0: 1684532.5, ayanT0: -4.44138598, t0IsUT: true, precOffset: 0 }, // 14: Aldebaran=15Tau
668
+ { t0: 1674484.0, ayanT0: -9.33333, t0IsUT: true, precOffset: -1 }, // 15: Hipparchos
669
+ { t0: 1927135.8747793, ayanT0: 0, t0IsUT: true, precOffset: -1 }, // 16: Sassanian
670
+ { t0: 0, ayanT0: 0, t0IsUT: false, precOffset: 0 }, // 17: Gal.Ctr 0 Sag
671
+ { t0: J2000, ayanT0: 0, t0IsUT: false, precOffset: 0 }, // 18: J2000
672
+ { t0: J1900, ayanT0: 0, t0IsUT: false, precOffset: 0 }, // 19: J1900
673
+ { t0: B1950, ayanT0: 0, t0IsUT: false, precOffset: 0 }, // 20: B1950
674
+ { t0: 1903396.8128654, ayanT0: 0, t0IsUT: true, precOffset: 0 }, // 21: Suryasiddhanta
675
+ { t0: 1903396.8128654, ayanT0: -0.21463395, t0IsUT: true, precOffset: 0 }, // 22: Suryasiddhanta, mean Sun
676
+ { t0: 1903396.7895321, ayanT0: 0, t0IsUT: true, precOffset: 0 }, // 23: Aryabhata
677
+ { t0: 1903396.7895321, ayanT0: -0.23763238, t0IsUT: true, precOffset: 0 }, // 24: Aryabhata, mean Sun
678
+ { t0: 1903396.8128654, ayanT0: -0.79167046, t0IsUT: true, precOffset: 0 }, // 25: SS Revati
679
+ { t0: 1903396.8128654, ayanT0: 2.11070444, t0IsUT: true, precOffset: 0 }, // 26: SS Citra
680
+ { t0: 0, ayanT0: 0, t0IsUT: false, precOffset: 0 }, // 27: True Citra
681
+ { t0: 0, ayanT0: 0, t0IsUT: false, precOffset: 0 }, // 28: True Revati
682
+ { t0: 0, ayanT0: 0, t0IsUT: false, precOffset: 0 }, // 29: True Pushya
683
+ { t0: 0, ayanT0: 0, t0IsUT: false, precOffset: 0 }, // 30: Gil Brand
684
+ { t0: 0, ayanT0: 0, t0IsUT: false, precOffset: 0 }, // 31: GE IAU 1958
685
+ { t0: 0, ayanT0: 0, t0IsUT: false, precOffset: 0 }, // 32: GE true
686
+ { t0: 0, ayanT0: 0, t0IsUT: false, precOffset: 0 }, // 33: GE Mula
687
+ { t0: 2451079.734892000, ayanT0: 30, t0IsUT: false, precOffset: 0 }, // 34: Skydram/Mardyks
688
+ { t0: 0, ayanT0: 0, t0IsUT: false, precOffset: 0 }, // 35: Chandra Hari
689
+ { t0: 0, ayanT0: 0, t0IsUT: false, precOffset: 0 }, // 36: Ernst Wilhelm
690
+ { t0: 1911797.740782065, ayanT0: 0, t0IsUT: true, precOffset: 0 }, // 37: Aryabhata 522
691
+ { t0: 1721057.5, ayanT0: -3.2, t0IsUT: true, precOffset: -1 }, // 38: Britton
692
+ { t0: 0, ayanT0: 0, t0IsUT: false, precOffset: 0 }, // 39: Sheoran
693
+ { t0: 0, ayanT0: 0, t0IsUT: false, precOffset: 0 }, // 40: Cochrane
694
+ { t0: 2451544.5, ayanT0: 25.0, t0IsUT: true, precOffset: 0 }, // 41: Fiorenza
695
+ { t0: 1775845.5, ayanT0: -2.9422, t0IsUT: true, precOffset: -1 }, // 42: Valens
696
+ { t0: J1900, ayanT0: 22.44597222, t0IsUT: false, precOffset: SEMOD_PREC_NEWCOMB }, // 43: Lahiri 1940
697
+ { t0: 1825235.2458513028, ayanT0: 0.0, t0IsUT: false, precOffset: 0 }, // 44: Lahiri VP285
698
+ { t0: 1827424.752255678, ayanT0: 0.0, t0IsUT: false, precOffset: 0 }, // 45: Krishnamurti VP291
699
+ { t0: 2435553.5, ayanT0: 23.25 - 0.00464207, t0IsUT: false, precOffset: SEMOD_PREC_NEWCOMB }, // 46: Lahiri ICRC
700
+ ];
701
+
702
+ /* ---- Heliacal event types ---- */
703
+ export const SE_HELIACAL_RISING = 1;
704
+ export const SE_HELIACAL_SETTING = 2;
705
+ export const SE_MORNING_FIRST = 1;
706
+ export const SE_EVENING_LAST = 2;
707
+ export const SE_EVENING_FIRST = 3;
708
+ export const SE_MORNING_LAST = 4;
709
+ export const SE_ACRONYCHAL_RISING = 5;
710
+ export const SE_ACRONYCHAL_SETTING = 6;
711
+ export const SE_COSMICAL_SETTING = 6;
712
+
713
+ /* ---- Heliacal flags ---- */
714
+ export const SE_HELFLAG_LONG_SEARCH = 128;
715
+ export const SE_HELFLAG_HIGH_PRECISION = 256;
716
+ export const SE_HELFLAG_OPTICAL_PARAMS = 512;
717
+ export const SE_HELFLAG_NO_DETAILS = 1024;
718
+ export const SE_HELFLAG_SEARCH_1_PERIOD = 2048;
719
+ export const SE_HELFLAG_VISLIM_DARK = 4096;
720
+ export const SE_HELFLAG_VISLIM_NOMOON = 8192;
721
+ export const SE_HELFLAG_VISLIM_PHOTOPIC = 16384;
722
+ export const SE_HELFLAG_VISLIM_SCOTOPIC = 32768;
723
+ export const SE_HELFLAG_AVKIND_VR = 65536;
724
+ export const SE_HELFLAG_AVKIND_PTO = 131072;
725
+ export const SE_HELFLAG_AVKIND_MIN7 = 262144;
726
+ export const SE_HELFLAG_AVKIND_MIN9 = 524288;
727
+ export const SE_HELFLAG_AVKIND = SE_HELFLAG_AVKIND_VR | SE_HELFLAG_AVKIND_PTO | SE_HELFLAG_AVKIND_MIN7 | SE_HELFLAG_AVKIND_MIN9;
728
+
729
+ /* ---- Photopic/scotopic flags ---- */
730
+ export const SE_PHOTOPIC_FLAG = 0;
731
+ export const SE_SCOTOPIC_FLAG = 1;
732
+ export const SE_MIXEDOPIC_FLAG = 2;
733
+
734
+ /* ---- JPL body indices (from swejpl.h) ---- */
735
+ export const J_MERCURY = 0;
736
+ export const J_VENUS = 1;
737
+ export const J_EARTH = 2;
738
+ export const J_MARS = 3;
739
+ export const J_JUPITER = 4;
740
+ export const J_SATURN = 5;
741
+ export const J_URANUS = 6;
742
+ export const J_NEPTUNE = 7;
743
+ export const J_PLUTO = 8;
744
+ export const J_MOON = 9;
745
+ export const J_SUN = 10;
746
+ export const J_SBARY = 11;
747
+ export const J_EMB = 12;
748
+ export const J_NUT = 13;
749
+ export const J_LIB = 14;
750
+
751
+ /** Maps SEI internal planet index → JPL body number */
752
+ export const PNOINT2JPL: readonly number[] = [
753
+ J_EARTH, J_MOON, J_MERCURY, J_VENUS, J_MARS,
754
+ J_JUPITER, J_SATURN, J_URANUS, J_NEPTUNE, J_PLUTO, J_SUN,
755
+ ];
756
+
757
+ /* ---- Default JPL file names ---- */
758
+ export const SE_FNAME_DFT = "de431.eph";
759
+ export const SE_FNAME_DFT2 = "de406.eph";
760
+
761
+ /* ---- Invalid TJD marker ---- */
762
+ export const TJD_INVALID = -99999999.0;