@zodiacs/engine 2.0.0-rc.3 → 2.1.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.
- package/CHANGELOG.md +367 -0
- package/LICENSING.md +38 -13
- package/NOTICE +13 -5
- package/README.md +68 -35
- package/dist/calc.d.ts +62 -1
- package/dist/calc.js +791 -898
- package/dist/{chunk-PU4HNPRX.js → chunk-BPZVUBFC.js} +10 -4
- package/dist/{chunk-FXNA2TJM.js → chunk-HBC2ZX6N.js} +1 -1
- package/dist/{chunk-XINOD63H.js → chunk-JRMBVSRS.js} +1 -1
- package/dist/{chunk-QLQRN6RY.js → chunk-OWF2QKB4.js} +1 -1
- package/dist/{chunk-EEKVS6W7.js → chunk-RRZYCXWT.js} +6 -3
- package/dist/{chunk-TSS2SZWQ.js → chunk-U5P32ZD3.js} +34 -36
- package/dist/core.js +44 -40
- package/dist/crossings.js +1 -1
- package/dist/esm-only.cjs +3 -0
- package/dist/geo.js +1 -1
- package/dist/index.js +5 -5
- package/dist/internal-math.js +1 -1
- package/dist/internal.js +2 -2
- package/dist/receipt.js +1 -1
- package/dist/sky.js +3 -3
- package/dist/techniques.js +4 -4
- package/dist/timing.js +5 -5
- package/dist/vedic.js +5 -5
- package/dist/window.js +2 -2
- package/package.json +43 -22
package/dist/calc.js
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
userAyanamsa,
|
|
8
8
|
wholeSignCusps,
|
|
9
9
|
wrap360
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-JRMBVSRS.js";
|
|
11
11
|
import {
|
|
12
12
|
eclipticRows,
|
|
13
13
|
equatorRows
|
|
@@ -26,14 +26,14 @@ import {
|
|
|
26
26
|
meanNodeLongitude,
|
|
27
27
|
onChartClock,
|
|
28
28
|
refuseUnderSource
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-BPZVUBFC.js";
|
|
30
30
|
import {
|
|
31
31
|
dateFrom
|
|
32
32
|
} from "./chunk-CPALRSPC.js";
|
|
33
33
|
import {
|
|
34
34
|
ENGINE_VERSION,
|
|
35
35
|
EPHEMERIS
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-OWF2QKB4.js";
|
|
37
37
|
import {
|
|
38
38
|
eclipticFrame,
|
|
39
39
|
eclipticOfDate,
|
|
@@ -47,8 +47,9 @@ import {
|
|
|
47
47
|
timeBasis
|
|
48
48
|
} from "./chunk-M65JXRFN.js";
|
|
49
49
|
import {
|
|
50
|
+
sampleCrossings,
|
|
50
51
|
searchLongitudeCrossingsWith
|
|
51
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-U5P32ZD3.js";
|
|
52
53
|
import "./chunk-UXY4RU57.js";
|
|
53
54
|
import "./chunk-HNVGWN3S.js";
|
|
54
55
|
import {
|
|
@@ -75,7 +76,7 @@ import {
|
|
|
75
76
|
} from "./chunk-4RCOOAGI.js";
|
|
76
77
|
|
|
77
78
|
// src/calc.ts
|
|
78
|
-
import { AstroTime, GeoMoonState, KM_PER_AU as
|
|
79
|
+
import { AstroTime as Fn, GeoMoonState as qn, KM_PER_AU as en } from "astronomy-engine";
|
|
79
80
|
|
|
80
81
|
// src/calc-bounds.ts
|
|
81
82
|
var SWEPT_BASIS = "largest difference from JPL's DE440 found at noon TT on each of 146,097 days, JD 2378497.0 to 2524593.0 (TT), in all eight frames; docs/evidence/de440-sweep-20261111";
|
|
@@ -83,89 +84,89 @@ var SWEPT = ["geocentric/apparent", "geocentric/astrometric", "geocentric/geomet
|
|
|
83
84
|
var MEASURED_BASIS = "largest difference from JPL Horizons (DE441) over 32 instants from JD 2379457.498125 to 2520522.646618 (TT), in all eight frames; docs/evidence/calc-api/rc16";
|
|
84
85
|
var MEAN_POINTS_BASIS = "largest difference from the same definition evaluated with ERFA's fundamental arguments (faom03, faf03, fal03) and nut06a's nutation in longitude, over 32 instants from JD 2379457.498125 to 2520522.646618 (TT), in all eight frames: a check of the implementation, not of an ephemeris; docs/evidence/calc-api/rc16";
|
|
85
86
|
var MEAN_POINTS_SPEED_BASIS = "largest difference from the rate of the same definition evaluated with ERFA's fundamental arguments (faom03, faf03, fal03) and nut06a's nutation in longitude, taken over 0.0001 day either side, over 32 instants from JD 2379457.498125 to 2520522.646618 (TT), in the true ecliptic of date only: a check of the implementation, not of an ephemeris; docs/evidence/calc-api/rc16";
|
|
86
|
-
var
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
87
|
+
var e = {
|
|
88
|
+
Earth: [3, 14e-6, 0.18],
|
|
89
|
+
Jupiter: [13, 4e-5, 0.025],
|
|
90
|
+
Mars: [4.4, 21e-6, 0.08],
|
|
91
|
+
Mercury: [23, 77e-6, 5.4],
|
|
92
|
+
Moon: [3, 14e-6, 0.18],
|
|
93
|
+
Neptune: [21, 44e-6, 63e-4],
|
|
94
|
+
Pluto: [25, 61e-6, 14e-4],
|
|
95
|
+
Saturn: [19, 65e-6, 0.023],
|
|
96
|
+
Uranus: [19, 43e-6, 86e-4],
|
|
97
|
+
Venus: [7.4, 15e-6, 0.22]
|
|
97
98
|
};
|
|
98
|
-
var
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
99
|
+
var n = {
|
|
100
|
+
Jupiter: [17, 79e-6, 0.11],
|
|
101
|
+
Mars: [23, 87e-6, 0.74],
|
|
102
|
+
Mercury: [17, 78e-6, 3.6],
|
|
103
|
+
Moon: [12, 48e-6, 2.9],
|
|
104
|
+
Neptune: [22, 47e-6, 0.019],
|
|
105
|
+
Pluto: [30, 63e-6, 0.018],
|
|
106
|
+
Saturn: [24, 77e-6, 0.06],
|
|
107
|
+
Sun: [3.4, 17e-6, 0.24],
|
|
108
|
+
Uranus: [20, 56e-6, 0.03],
|
|
109
|
+
Venus: [24, 83e-6, 1.4]
|
|
109
110
|
};
|
|
110
|
-
var
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
111
|
+
var t = {
|
|
112
|
+
Earth: [3, 15e-6, 0.18],
|
|
113
|
+
Jupiter: [13, 4e-5, 0.025],
|
|
114
|
+
Mars: [4.3, 23e-6, 0.079],
|
|
115
|
+
Mercury: [23, 87e-6, 5.4],
|
|
116
|
+
Moon: [3, 15e-6, 0.18],
|
|
117
|
+
Neptune: [21, 44e-6, 63e-4],
|
|
118
|
+
Pluto: [25, 6e-5, 17e-4],
|
|
119
|
+
Saturn: [18, 65e-6, 0.023],
|
|
120
|
+
Uranus: [19, 42e-6, 91e-4],
|
|
121
|
+
Venus: [6.6, 12e-6, 0.21]
|
|
121
122
|
};
|
|
122
123
|
var MEASURED = {
|
|
123
|
-
"barycentric/apparent":
|
|
124
|
-
"barycentric/astrometric":
|
|
124
|
+
"barycentric/apparent": e,
|
|
125
|
+
"barycentric/astrometric": e,
|
|
125
126
|
"barycentric/geometric": {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
127
|
+
Earth: [3, 14e-6, 0.18],
|
|
128
|
+
Jupiter: [13, 4e-5, 0.025],
|
|
129
|
+
Mars: [4.4, 21e-6, 0.08],
|
|
130
|
+
Mercury: [23, 77e-6, 5.4],
|
|
131
|
+
Moon: [3, 14e-6, 0.18],
|
|
132
|
+
Neptune: [21, 44e-6, 63e-4],
|
|
133
|
+
Pluto: [25, 61e-6, 18e-4],
|
|
134
|
+
Saturn: [19, 65e-6, 0.023],
|
|
135
|
+
Uranus: [19, 43e-6, 86e-4],
|
|
136
|
+
Venus: [7.4, 15e-6, 0.22]
|
|
136
137
|
},
|
|
137
138
|
"geocentric/apparent": {
|
|
138
139
|
"Black Moon Lilith": [23e-4, null, 32e-4],
|
|
139
|
-
|
|
140
|
-
|
|
140
|
+
Jupiter: [17, 79e-6, 0.11],
|
|
141
|
+
Mars: [23, 87e-6, 0.74],
|
|
141
142
|
"Mean Node": [23e-4, null, 81e-5],
|
|
142
143
|
"Mean South Node": [23e-4, null, 81e-5],
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
144
|
+
Mercury: [17, 78e-6, 3.6],
|
|
145
|
+
Moon: [12, 15e-5, 2.9],
|
|
146
|
+
Neptune: [22, 47e-6, 0.019],
|
|
146
147
|
"North Node": [33, null, null],
|
|
147
|
-
|
|
148
|
-
|
|
148
|
+
Pluto: [30, 63e-6, 0.018],
|
|
149
|
+
Saturn: [24, 77e-6, 0.06],
|
|
149
150
|
"South Node": [33, null, null],
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
151
|
+
Sun: [3.4, 17e-6, 0.24],
|
|
152
|
+
Uranus: [20, 56e-6, 0.03],
|
|
153
|
+
Venus: [24, 83e-6, 1.4]
|
|
153
154
|
},
|
|
154
|
-
"geocentric/astrometric":
|
|
155
|
-
"geocentric/geometric":
|
|
156
|
-
"heliocentric/apparent":
|
|
157
|
-
"heliocentric/astrometric":
|
|
155
|
+
"geocentric/astrometric": n,
|
|
156
|
+
"geocentric/geometric": n,
|
|
157
|
+
"heliocentric/apparent": t,
|
|
158
|
+
"heliocentric/astrometric": t,
|
|
158
159
|
"heliocentric/geometric": {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
160
|
+
Earth: [3, 15e-6, 0.18],
|
|
161
|
+
Jupiter: [13, 4e-5, 0.025],
|
|
162
|
+
Mars: [4.3, 23e-6, 0.079],
|
|
163
|
+
Mercury: [23, 87e-6, 5.4],
|
|
164
|
+
Moon: [3, 15e-6, 0.18],
|
|
165
|
+
Neptune: [21, 44e-6, 62e-4],
|
|
166
|
+
Pluto: [25, 6e-5, 2e-3],
|
|
167
|
+
Saturn: [18, 65e-6, 0.023],
|
|
168
|
+
Uranus: [19, 42e-6, 9e-3],
|
|
169
|
+
Venus: [6.6, 12e-6, 0.21]
|
|
169
170
|
}
|
|
170
171
|
};
|
|
171
172
|
|
|
@@ -199,186 +200,198 @@ var CALC_FRAMES = [
|
|
|
199
200
|
"equatorial-j2000",
|
|
200
201
|
"equatorial-icrs"
|
|
201
202
|
];
|
|
202
|
-
var
|
|
203
|
-
var
|
|
204
|
-
var
|
|
205
|
-
var
|
|
206
|
-
function apply(
|
|
207
|
-
return [
|
|
208
|
-
}
|
|
209
|
-
function
|
|
210
|
-
const
|
|
211
|
-
return [
|
|
212
|
-
}
|
|
213
|
-
function transpose(
|
|
214
|
-
return [
|
|
215
|
-
}
|
|
216
|
-
function
|
|
217
|
-
const
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
var BIAS = product(
|
|
234
|
-
r1(68192e-7 * ARCSEC),
|
|
235
|
-
product(r2(-0.041775 * ARCSEC * Math.sin(84381.448 * ARCSEC)), r3(-0.0146 * ARCSEC))
|
|
203
|
+
var c = Math.PI / 180;
|
|
204
|
+
var s = 180 / Math.PI;
|
|
205
|
+
var i = c / 3600;
|
|
206
|
+
var o = (t2, e2) => t2[e2];
|
|
207
|
+
function apply(t2, [e2, r, a]) {
|
|
208
|
+
return [t2[0] * e2 + t2[1] * r + t2[2] * a, t2[3] * e2 + t2[4] * r + t2[5] * a, t2[6] * e2 + t2[7] * r + t2[8] * a];
|
|
209
|
+
}
|
|
210
|
+
function p(t2, e2) {
|
|
211
|
+
const r = (a, n2) => o(t2, 3 * a) * o(e2, n2) + o(t2, 3 * a + 1) * o(e2, 3 + n2) + o(t2, 3 * a + 2) * o(e2, 6 + n2);
|
|
212
|
+
return [r(0, 0), r(0, 1), r(0, 2), r(1, 0), r(1, 1), r(1, 2), r(2, 0), r(2, 1), r(2, 2)];
|
|
213
|
+
}
|
|
214
|
+
function transpose(t2) {
|
|
215
|
+
return [t2[0], t2[3], t2[6], t2[1], t2[4], t2[7], t2[2], t2[5], t2[8]];
|
|
216
|
+
}
|
|
217
|
+
function b(t2) {
|
|
218
|
+
const e2 = Math.cos(t2), r = Math.sin(t2);
|
|
219
|
+
return [1, 0, 0, 0, e2, r, 0, -r, e2];
|
|
220
|
+
}
|
|
221
|
+
function C(t2) {
|
|
222
|
+
const e2 = Math.cos(t2), r = Math.sin(t2);
|
|
223
|
+
return [e2, 0, -r, 0, 1, 0, r, 0, e2];
|
|
224
|
+
}
|
|
225
|
+
function I(t2) {
|
|
226
|
+
const e2 = Math.cos(t2), r = Math.sin(t2);
|
|
227
|
+
return [e2, r, 0, -r, e2, 0, 0, 0, 1];
|
|
228
|
+
}
|
|
229
|
+
var j = [1, 0, 0, 0, 1, 0, 0, 0, 1];
|
|
230
|
+
var h = b(84381.406 * i);
|
|
231
|
+
var A = p(
|
|
232
|
+
b(68192e-7 * i),
|
|
233
|
+
p(C(-0.041775 * i * Math.sin(84381.448 * i)), I(-0.0146 * i))
|
|
236
234
|
);
|
|
237
|
-
var
|
|
238
|
-
function frameMatrix(
|
|
239
|
-
switch (
|
|
235
|
+
var d = transpose(A);
|
|
236
|
+
function frameMatrix(t2, e2) {
|
|
237
|
+
switch (t2) {
|
|
240
238
|
case "ecliptic-true-of-date":
|
|
241
|
-
return eclipticRows(
|
|
239
|
+
return eclipticRows(e2.tt, "true");
|
|
242
240
|
case "equatorial-true-of-date":
|
|
243
|
-
return equatorRows(
|
|
241
|
+
return equatorRows(e2.tt, "true");
|
|
244
242
|
case "ecliptic-mean-of-date":
|
|
245
|
-
return eclipticRows(
|
|
243
|
+
return eclipticRows(e2.tt, "mean");
|
|
246
244
|
case "equatorial-mean-of-date":
|
|
247
|
-
return equatorRows(
|
|
245
|
+
return equatorRows(e2.tt, "mean");
|
|
248
246
|
case "ecliptic-j2000":
|
|
249
|
-
return
|
|
247
|
+
return h;
|
|
250
248
|
case "equatorial-j2000":
|
|
251
|
-
return
|
|
249
|
+
return j;
|
|
252
250
|
case "ecliptic-icrs":
|
|
253
|
-
return
|
|
251
|
+
return p(h, d);
|
|
254
252
|
case "equatorial-icrs":
|
|
255
|
-
return
|
|
253
|
+
return d;
|
|
256
254
|
}
|
|
257
255
|
}
|
|
258
|
-
function inertial(
|
|
259
|
-
return
|
|
256
|
+
function inertial(t2) {
|
|
257
|
+
return t2.endsWith("j2000") || t2.endsWith("icrs");
|
|
260
258
|
}
|
|
261
|
-
function toSpherical([
|
|
262
|
-
return { lon: normalizeLongitude(Math.atan2(
|
|
259
|
+
function toSpherical([t2, e2, r]) {
|
|
260
|
+
return { lon: normalizeLongitude(Math.atan2(e2, t2) * s), lat: Math.asin(r / Math.hypot(t2, e2, r)) * s };
|
|
263
261
|
}
|
|
264
|
-
function fromSpherical(
|
|
265
|
-
const
|
|
262
|
+
function fromSpherical(t2, e2, r) {
|
|
263
|
+
const a = Math.cos(e2 * c);
|
|
266
264
|
return [
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
265
|
+
r * a * Math.cos(t2 * c),
|
|
266
|
+
r * a * Math.sin(t2 * c),
|
|
267
|
+
r * Math.sin(e2 * c)
|
|
270
268
|
];
|
|
271
269
|
}
|
|
272
|
-
function sphericalRates([
|
|
273
|
-
const
|
|
274
|
-
const square = plane + z * z;
|
|
270
|
+
function sphericalRates([t2, e2, r], [a, n2, l]) {
|
|
271
|
+
const u = t2 * t2 + e2 * e2, M2 = u + r * r;
|
|
275
272
|
return {
|
|
276
|
-
lon: (
|
|
277
|
-
lat: (
|
|
278
|
-
dist: (
|
|
273
|
+
lon: (t2 * n2 - e2 * a) / u * s,
|
|
274
|
+
lat: (l * u - r * (t2 * a + e2 * n2)) / (M2 * Math.sqrt(u)) * s,
|
|
275
|
+
dist: (t2 * a + e2 * n2 + r * l) / Math.sqrt(M2)
|
|
279
276
|
};
|
|
280
277
|
}
|
|
281
278
|
|
|
282
279
|
// src/calc-reduce.ts
|
|
283
280
|
import {
|
|
284
|
-
BaryState,
|
|
285
|
-
Body,
|
|
286
|
-
CorrectLightTravel,
|
|
287
|
-
DEG2RAD,
|
|
288
|
-
GeoMoon,
|
|
289
|
-
GeoVector,
|
|
290
|
-
HelioState,
|
|
291
|
-
HelioVector,
|
|
292
|
-
KM_PER_AU,
|
|
293
|
-
Vector
|
|
281
|
+
BaryState as V,
|
|
282
|
+
Body as d2,
|
|
283
|
+
CorrectLightTravel as B,
|
|
284
|
+
DEG2RAD as R,
|
|
285
|
+
GeoMoon as S,
|
|
286
|
+
GeoVector as H,
|
|
287
|
+
HelioState as x,
|
|
288
|
+
HelioVector as h2,
|
|
289
|
+
KM_PER_AU as v,
|
|
290
|
+
Vector as N
|
|
294
291
|
} from "astronomy-engine";
|
|
295
|
-
var
|
|
296
|
-
var
|
|
297
|
-
var
|
|
298
|
-
var
|
|
299
|
-
var length = ([
|
|
300
|
-
var
|
|
301
|
-
var
|
|
292
|
+
var K = [0, 0, 0];
|
|
293
|
+
var s2 = ({ x: t2, y: e2, z: n2 }) => [t2, e2, n2];
|
|
294
|
+
var y = (t2, e2) => [t2[0] + e2[0], t2[1] + e2[1], t2[2] + e2[2]];
|
|
295
|
+
var p2 = (t2, e2) => [t2[0] - e2[0], t2[1] - e2[1], t2[2] - e2[2]];
|
|
296
|
+
var length = ([t2, e2, n2]) => Math.hypot(t2, e2, n2);
|
|
297
|
+
var g = 0.996647180302104;
|
|
298
|
+
var O = g * g;
|
|
302
299
|
var EARTH_EQUATORIAL_RADIUS_KM = 6378.1366;
|
|
303
300
|
var ANGVEL = 7292115e-11;
|
|
304
|
-
function
|
|
305
|
-
const
|
|
306
|
-
const sinphi = Math.sin(phi);
|
|
307
|
-
const cosphi = Math.cos(phi);
|
|
308
|
-
const c = 1 / Math.hypot(cosphi, EARTH_FLATTENING * sinphi);
|
|
309
|
-
const s = EARTH_FLATTENING_SQUARED * c;
|
|
310
|
-
const heightKm = site.height / 1e3;
|
|
311
|
-
const ach = EARTH_EQUATORIAL_RADIUS_KM * c + heightKm;
|
|
312
|
-
const ash = EARTH_EQUATORIAL_RADIUS_KM * s + heightKm;
|
|
313
|
-
const stlocl = (15 * st + site.longitude) * DEG2RAD;
|
|
314
|
-
const sinst = Math.sin(stlocl);
|
|
315
|
-
const cosst = Math.cos(stlocl);
|
|
301
|
+
function w(t2, e2) {
|
|
302
|
+
const n2 = t2.latitude * R, r = Math.sin(n2), o2 = Math.cos(n2), i2 = 1 / Math.hypot(o2, g * r), f = O * i2, m = t2.height / 1e3, a = EARTH_EQUATORIAL_RADIUS_KM * i2 + m, u = EARTH_EQUATORIAL_RADIUS_KM * f + m, A2 = (15 * e2 + t2.longitude) * R, c2 = Math.sin(A2), l = Math.cos(A2);
|
|
316
303
|
return {
|
|
317
|
-
pos: [
|
|
318
|
-
vel: [-ANGVEL *
|
|
304
|
+
pos: [a * o2 * l / v, a * o2 * c2 / v, u * r / v],
|
|
305
|
+
vel: [-ANGVEL * a * o2 * c2 * 86400 / v, ANGVEL * a * o2 * l * 86400 / v, 0]
|
|
319
306
|
};
|
|
320
307
|
}
|
|
321
|
-
function
|
|
322
|
-
const { pos, vel } =
|
|
323
|
-
|
|
324
|
-
return { r: apply(back, pos), v: apply(back, vel) };
|
|
308
|
+
function M(t2, e2) {
|
|
309
|
+
const { pos: n2, vel: r } = w(t2, gastHours(e2)), o2 = transpose(equatorRows(e2.tt, "true"));
|
|
310
|
+
return { r: apply(o2, n2), v: apply(o2, r) };
|
|
325
311
|
}
|
|
326
|
-
function
|
|
327
|
-
return
|
|
312
|
+
function _(t2, e2) {
|
|
313
|
+
return t2.kind === "topocentric" ? M(t2.site, e2).r : K;
|
|
328
314
|
}
|
|
329
|
-
function
|
|
330
|
-
return
|
|
315
|
+
function L(t2, e2) {
|
|
316
|
+
return t2 === d2.Moon ? s2(S(e2)) : p2(s2(h2(t2, e2)), s2(h2(d2.Earth, e2)));
|
|
331
317
|
}
|
|
332
|
-
function
|
|
333
|
-
const
|
|
334
|
-
const [
|
|
335
|
-
return new
|
|
336
|
-
},
|
|
337
|
-
return { v:
|
|
318
|
+
function T(t2, e2) {
|
|
319
|
+
const n2 = B((r) => {
|
|
320
|
+
const [o2, i2, f] = t2(r);
|
|
321
|
+
return new N(o2, i2, f, r);
|
|
322
|
+
}, e2);
|
|
323
|
+
return { v: s2(n2), left: n2.t };
|
|
338
324
|
}
|
|
339
325
|
var BARYCENTRE_ERROR = { au: 14e-6, auPerDay: 12e-8 };
|
|
340
|
-
function
|
|
341
|
-
return
|
|
326
|
+
function b2(t2, e2) {
|
|
327
|
+
return p2(s2(V(d2.Sun, t2)), s2(V(d2.Sun, e2)));
|
|
342
328
|
}
|
|
343
|
-
function locate(
|
|
329
|
+
function locate(t2, e2, n2, r) {
|
|
344
330
|
refuseUnderSource("@zodiacs/engine/calc");
|
|
345
|
-
const
|
|
346
|
-
if (
|
|
347
|
-
const
|
|
348
|
-
return
|
|
331
|
+
const o2 = (c2, l = length(c2)) => ({ v: c2, dist: l });
|
|
332
|
+
if (e2.kind === "barycentric") {
|
|
333
|
+
const c2 = (l) => s2(V(t2, l));
|
|
334
|
+
return o2(n2 === "geometric" ? c2(r) : T(c2, r).v);
|
|
349
335
|
}
|
|
350
|
-
if (
|
|
351
|
-
const
|
|
352
|
-
if (
|
|
353
|
-
const { v:
|
|
354
|
-
|
|
355
|
-
return correction === "apparent" ? found(v2, length(astrometric2)) : found(astrometric2);
|
|
336
|
+
if (e2.kind === "heliocentric") {
|
|
337
|
+
const c2 = (z2) => s2(h2(t2, z2));
|
|
338
|
+
if (n2 === "geometric") return o2(c2(r));
|
|
339
|
+
const { v: l, left: G2 } = T(c2, r), E = y(l, b2(G2, r));
|
|
340
|
+
return n2 === "apparent" ? o2(l, length(E)) : o2(E);
|
|
356
341
|
}
|
|
357
|
-
const
|
|
358
|
-
if (
|
|
359
|
-
if (
|
|
360
|
-
return
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
const
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
if (
|
|
372
|
-
const
|
|
373
|
-
if (
|
|
374
|
-
const
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
342
|
+
const i2 = _(e2, r);
|
|
343
|
+
if (n2 === "geometric") return o2(p2(L(t2, r), i2));
|
|
344
|
+
if (n2 === "apparent" && t2 === d2.Moon && e2.kind === "geocentric")
|
|
345
|
+
return o2(s2(S(r)));
|
|
346
|
+
const f = y(s2(h2(d2.Earth, r)), i2), { v: m, left: a } = T((c2) => p2(s2(h2(t2, c2)), f), r), u = y(m, b2(a, r));
|
|
347
|
+
if (n2 === "astrometric") return o2(u);
|
|
348
|
+
const A2 = e2.kind === "geocentric" ? s2(H(t2, r, true)) : T((c2) => p2(L(t2, c2), _(e2, c2)), r).v;
|
|
349
|
+
return o2(A2, length(u));
|
|
350
|
+
}
|
|
351
|
+
function geometricState(t2, e2, n2) {
|
|
352
|
+
if (refuseUnderSource("@zodiacs/engine/calc"), t2 === d2.Moon) return null;
|
|
353
|
+
const r = (u) => ({ r: s2(u), v: [u.vx, u.vy, u.vz] });
|
|
354
|
+
if (e2.kind === "barycentric") return r(V(t2, n2));
|
|
355
|
+
const o2 = r(x(t2, n2));
|
|
356
|
+
if (e2.kind === "heliocentric") return o2;
|
|
357
|
+
const i2 = r(x(d2.Earth, n2)), f = p2(o2.r, i2.r), m = p2(o2.v, i2.v);
|
|
358
|
+
if (e2.kind === "geocentric") return { r: f, v: m };
|
|
359
|
+
const a = M(e2.site, n2);
|
|
360
|
+
return { r: p2(f, a.r), v: p2(m, a.v) };
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
// src/calc-event-roots.ts
|
|
364
|
+
var g2 = 864e5;
|
|
365
|
+
var HOUR_MS = g2 / 24;
|
|
366
|
+
function principal(e2) {
|
|
367
|
+
return e2 - 360 * Math.floor((e2 + 180) / 360);
|
|
368
|
+
}
|
|
369
|
+
function scanEventRoots(e2, c2, f, x2, w2) {
|
|
370
|
+
if (e2 > c2) throw new RangeError("The search window must have from <= to.");
|
|
371
|
+
const o2 = f ? 1 : 1e3, b3 = Math.floor(e2 / o2) * o2, h3 = Math.ceil(c2 / o2) * o2, S2 = e2 === c2 ? 0 : 1 + Math.ceil((h3 - b3) / g2), r = sampleCrossings(S2, w2, x2, "Non-finite event search sample.", (a) => {
|
|
372
|
+
const R2 = [];
|
|
373
|
+
let u = b3, p3 = a(b3);
|
|
374
|
+
for (; u < h3; ) {
|
|
375
|
+
const M2 = Math.min(h3, u + g2), d3 = a(M2), l = p3 < 0 && d3 >= 0;
|
|
376
|
+
if (l || !f && p3 > 0 && d3 <= 0) {
|
|
377
|
+
let i2 = u, t2 = M2;
|
|
378
|
+
for (; t2 - i2 > 1; ) {
|
|
379
|
+
const n2 = t2 - i2 > o2 ? o2 : 1, s3 = i2 + n2 * Math.floor((t2 - i2) / (2 * n2)), m = a(s3);
|
|
380
|
+
(l ? m >= 0 : m <= 0) ? t2 = s3 : i2 = s3;
|
|
381
|
+
}
|
|
382
|
+
if (t2 > e2 && t2 <= c2) {
|
|
383
|
+
const n2 = a(t2 - HOUR_MS), s3 = a(t2 + HOUR_MS);
|
|
384
|
+
if (l ? n2 < 0 && s3 > 0 : n2 > 0 && s3 < 0) {
|
|
385
|
+
const m = (f ? principal(s3 - n2) : s3 - n2) * 12;
|
|
386
|
+
R2.push({ ttMs: t2, rising: l, slope: m });
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
u = M2, p3 = d3;
|
|
391
|
+
}
|
|
392
|
+
return R2;
|
|
393
|
+
});
|
|
394
|
+
return r.status === "refused" ? { status: "refused", reason: r.reason, samples: r.samples, maxSamples: w2, detail: "The search exceeds maxSamples." } : { status: "ok", samples: r.samples, roots: r.crossings };
|
|
382
395
|
}
|
|
383
396
|
|
|
384
397
|
// src/calc-ayanamsa.ts
|
|
@@ -411,841 +424,719 @@ var AYANAMSA_BOUNDS = {
|
|
|
411
424
|
};
|
|
412
425
|
var AYANAMSA_BASIS = "largest difference of the mean ayanamsa from ERFA's construction of the same definition; docs/evidence/calc-sidereal-2026-10-05";
|
|
413
426
|
var AYANAMSA_EPOCH_BASIS = "largest difference of the mean ayanamsa from ERFA's construction of the same definition, for epochs from 0001 to 3998 outside 1800 to 2200; docs/evidence/calc-epochs-2026-10-06";
|
|
414
|
-
function ayanamsaBand(
|
|
415
|
-
|
|
416
|
-
return definition.model === "engine" ? "epochOutsideSpan" : "olderEpochOutsideSpan";
|
|
417
|
-
}
|
|
418
|
-
if (definition.kind !== "star") return "epochOrLinear";
|
|
419
|
-
if (elongation === null || elongation < AT_SUN_DEGREES) return "starAtSun";
|
|
420
|
-
return elongation < NEAR_SUN_DEGREES ? "starNearSun" : "star";
|
|
427
|
+
function ayanamsaBand(e2, n2) {
|
|
428
|
+
return e2.kind === "epoch" && outsideSpanEpoch(e2) ? e2.model === "engine" ? "epochOutsideSpan" : "olderEpochOutsideSpan" : e2.kind !== "star" ? "epochOrLinear" : n2 === null || n2 < AT_SUN_DEGREES ? "starAtSun" : n2 < NEAR_SUN_DEGREES ? "starNearSun" : "star";
|
|
421
429
|
}
|
|
422
|
-
function ayanamsaBound(
|
|
423
|
-
const
|
|
424
|
-
|
|
425
|
-
return { ...AYANAMSA_BOUNDS[band], basis: outside ? AYANAMSA_EPOCH_BASIS : AYANAMSA_BASIS };
|
|
430
|
+
function ayanamsaBound(e2, n2) {
|
|
431
|
+
const o2 = ayanamsaBand(e2, n2), a = o2 === "epochOutsideSpan" || o2 === "olderEpochOutsideSpan";
|
|
432
|
+
return { ...AYANAMSA_BOUNDS[o2], basis: a ? AYANAMSA_EPOCH_BASIS : AYANAMSA_BASIS };
|
|
426
433
|
}
|
|
427
|
-
function addBounds(
|
|
428
|
-
return Math.ceil(Number(((
|
|
434
|
+
function addBounds(e2, n2) {
|
|
435
|
+
return Math.ceil(Number(((e2 + n2) * 1e9).toPrecision(15))) / 1e9;
|
|
429
436
|
}
|
|
430
437
|
|
|
431
438
|
// src/calc.ts
|
|
432
|
-
var
|
|
433
|
-
var
|
|
434
|
-
var CALC_BODIES = Object.freeze([...
|
|
435
|
-
var
|
|
439
|
+
var St = ["Sun", "Moon", "Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune", "Pluto"];
|
|
440
|
+
var Tn = ["North Node", "South Node", "Mean Node", "Mean South Node", "Black Moon Lilith"];
|
|
441
|
+
var CALC_BODIES = Object.freeze([...St, ...Tn]);
|
|
442
|
+
var Ct = CALC_BODIES.filter((e2) => e2 !== "Earth" && !/^Mean|Lilith/.test(e2));
|
|
436
443
|
var CALC_FRAMES2 = Object.freeze([...CALC_FRAMES]);
|
|
437
444
|
var CALC_AYANAMSAS = Object.freeze(Object.keys(AYANAMSAS));
|
|
438
445
|
var CALC_RECEIPT_SCHEMA = "zodiacs.calc-receipt.v1";
|
|
439
446
|
var CALC_SPAN = REFERENCE_SPAN;
|
|
440
|
-
var
|
|
441
|
-
var
|
|
442
|
-
var
|
|
443
|
-
var
|
|
444
|
-
var
|
|
445
|
-
var
|
|
446
|
-
var
|
|
447
|
-
var
|
|
448
|
-
function
|
|
449
|
-
if (
|
|
450
|
-
throw new RangeError(`${
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
}
|
|
455
|
-
return value;
|
|
447
|
+
var se = Math.PI / 180;
|
|
448
|
+
var ie = 180 / Math.PI;
|
|
449
|
+
var O2 = 864e5;
|
|
450
|
+
var z = 2451545;
|
|
451
|
+
var K2 = Date.UTC(2e3, 0, 1, 12);
|
|
452
|
+
var wn = [CALC_SPAN.from, CALC_SPAN.to].map((e2) => (Date.parse(e2) - K2) / O2);
|
|
453
|
+
var En = 1e-3;
|
|
454
|
+
var An = 0.25;
|
|
455
|
+
function N2(e2, n2, t2) {
|
|
456
|
+
if (e2 === null || typeof e2 != "object" || Array.isArray(e2) || e2 instanceof Date)
|
|
457
|
+
throw new RangeError(`${n2} must be an object.`);
|
|
458
|
+
if (Object.keys(e2).some((a) => !t2.includes(a)))
|
|
459
|
+
throw new RangeError(`${n2} takes only ${t2.join(", ")}.`);
|
|
460
|
+
return e2;
|
|
456
461
|
}
|
|
457
|
-
function
|
|
458
|
-
if (
|
|
459
|
-
if (typeof
|
|
460
|
-
throw new RangeError(`${
|
|
461
|
-
|
|
462
|
-
return value;
|
|
462
|
+
function k(e2, n2, t2, a) {
|
|
463
|
+
if (e2 === void 0 && a !== void 0) return a;
|
|
464
|
+
if (typeof e2 != "string" || !n2.includes(e2))
|
|
465
|
+
throw new RangeError(`${t2} must be one of ${n2.join(", ")}.`);
|
|
466
|
+
return e2;
|
|
463
467
|
}
|
|
464
|
-
function
|
|
465
|
-
if (typeof
|
|
466
|
-
throw new RangeError(`${
|
|
467
|
-
|
|
468
|
-
return value;
|
|
468
|
+
function J(e2, n2, t2, a) {
|
|
469
|
+
if (typeof e2 != "number" || !Number.isFinite(e2) || e2 < t2 || e2 > a)
|
|
470
|
+
throw new RangeError(`${n2} must be a number from ${t2} to ${a}.`);
|
|
471
|
+
return e2;
|
|
469
472
|
}
|
|
470
|
-
function
|
|
471
|
-
if (
|
|
472
|
-
if (typeof
|
|
473
|
-
return
|
|
473
|
+
function Ue(e2, n2, t2) {
|
|
474
|
+
if (e2 === void 0) return t2;
|
|
475
|
+
if (typeof e2 != "boolean") throw new RangeError(`${n2} must be true or false.`);
|
|
476
|
+
return e2;
|
|
474
477
|
}
|
|
475
|
-
function
|
|
476
|
-
const
|
|
478
|
+
function U(e2, n2) {
|
|
479
|
+
const t2 = (i2) => {
|
|
477
480
|
try {
|
|
478
|
-
return dateFrom(
|
|
481
|
+
return dateFrom(i2, n2);
|
|
479
482
|
} catch {
|
|
480
|
-
throw new RangeError(`${
|
|
483
|
+
throw new RangeError(`${n2} must be a valid Date, or an ISO 8601 date or date-time with a UTC offset.`);
|
|
481
484
|
}
|
|
482
485
|
};
|
|
483
|
-
if (typeof
|
|
484
|
-
const
|
|
485
|
-
|
|
486
|
-
return { record, ms: date.getTime(), scale: "utc", pin: void 0, civil: true };
|
|
486
|
+
if (typeof e2 == "string" || e2 instanceof Date) {
|
|
487
|
+
const i2 = t2(e2);
|
|
488
|
+
return { record: { iso: typeof e2 == "string" ? e2 : i2.toISOString() }, ms: i2.getTime(), scale: "utc", pin: void 0, civil: true };
|
|
487
489
|
}
|
|
488
|
-
if (typeof
|
|
489
|
-
const
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
if (typeof time.iso !== "string" || time.scale !== void 0) throw new RangeError(`${label}.iso must be an ISO string, without a scale.`);
|
|
495
|
-
return { record: { iso: time.iso, ...pinned }, ms: iso(time.iso).getTime(), scale: "utc", pin, civil: true };
|
|
490
|
+
if (typeof e2 == "number") throw new RangeError(`${n2} must be an ISO string, a Date or { jd, scale }.`);
|
|
491
|
+
const a = N2(e2, n2, ["iso", "jd", "scale", "deltaT"]), r = a.deltaT === void 0 ? void 0 : J(a.deltaT, `${n2}.deltaT`, -1e10, 1e10), s3 = r === void 0 ? {} : { deltaT: r };
|
|
492
|
+
if (a.iso === void 0 == (a.jd === void 0)) throw new RangeError(`${n2} takes iso, or jd and scale.`);
|
|
493
|
+
if (a.iso !== void 0) {
|
|
494
|
+
if (typeof a.iso != "string" || a.scale !== void 0) throw new RangeError(`${n2}.iso must be an ISO string, without a scale.`);
|
|
495
|
+
return { record: { iso: a.iso, ...s3 }, ms: t2(a.iso).getTime(), scale: "utc", pin: r, civil: true };
|
|
496
496
|
}
|
|
497
|
-
const
|
|
498
|
-
if (typeof
|
|
499
|
-
if (typeof
|
|
500
|
-
throw new RangeError(`${
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
return { record: { jd, scale, ...pinned }, ms: J2000_MS + (jd - J2000_JD) * DAY_MS, scale, pin, civil: false };
|
|
497
|
+
const o2 = a.jd;
|
|
498
|
+
if (typeof o2 != "number" || !Number.isFinite(o2)) throw new RangeError(`${n2}.jd must be a finite Julian date.`);
|
|
499
|
+
if (typeof a.scale == "string" && TIME_SCALE_NAMES.includes(a.scale.toLowerCase()) && !TIME_SCALE_NAMES.includes(a.scale))
|
|
500
|
+
throw new RangeError(`${n2}.scale must be one of ${TIME_SCALE_NAMES.join(", ")}: lowercase since 1.0.0.`);
|
|
501
|
+
const l = k(a.scale, TIME_SCALE_NAMES, `${n2}.scale`);
|
|
502
|
+
return { record: { jd: o2, scale: l, ...s3 }, ms: K2 + (o2 - z) * O2, scale: l, pin: r, civil: false };
|
|
504
503
|
}
|
|
505
|
-
function
|
|
506
|
-
const
|
|
504
|
+
function He(e2, n2, t2 = false) {
|
|
505
|
+
const a = N2(e2, n2, t2 ? ["latitude", "longitude", "height"] : ["latitude", "longitude"]);
|
|
507
506
|
return {
|
|
508
|
-
latitude:
|
|
509
|
-
longitude:
|
|
510
|
-
height:
|
|
507
|
+
latitude: J(a.latitude, `${n2}.latitude`, -90, 90),
|
|
508
|
+
longitude: J(a.longitude, `${n2}.longitude`, -180, 180),
|
|
509
|
+
height: a.height === void 0 ? 0 : J(a.height, `${n2}.height`, -12e3, 1e5)
|
|
511
510
|
};
|
|
512
511
|
}
|
|
513
|
-
function
|
|
514
|
-
return { status: "refused", reason, detail };
|
|
512
|
+
function F(e2, n2) {
|
|
513
|
+
return { status: "refused", reason: e2, detail: n2 };
|
|
515
514
|
}
|
|
516
|
-
var
|
|
515
|
+
var Ve = () => ({
|
|
517
516
|
status: "refused",
|
|
518
517
|
reason: "out-of-range",
|
|
519
518
|
detail: `The instant's UT1 or TT is outside ${CALC_SPAN.from} to ${CALC_SPAN.to}, where the engine's positions have been compared with an independent ephemeris.`,
|
|
520
519
|
span: CALC_SPAN
|
|
521
520
|
});
|
|
522
|
-
var
|
|
523
|
-
var
|
|
524
|
-
function
|
|
525
|
-
const
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
jd = J2000_JD + timeBasis(epoch.ms, epoch.scale, epoch.pin).ttDays;
|
|
521
|
+
var Rn = { record: "tropical", definition: null, ids: ["zodiac:tropical"] };
|
|
522
|
+
var Tt = 24405875e-1;
|
|
523
|
+
function wt(e2, n2) {
|
|
524
|
+
const t2 = e2.record, a = `${n2} must be an instant in the range of a Date.`;
|
|
525
|
+
let r;
|
|
526
|
+
if ("jd" in t2 && t2.scale === "tt")
|
|
527
|
+
r = t2.jd;
|
|
528
|
+
else {
|
|
529
|
+
if (!(Math.abs(e2.ms) <= 864e13)) throw new RangeError(a);
|
|
530
|
+
r = z + timeBasis(e2.ms, e2.scale, e2.pin).ttDays;
|
|
533
531
|
}
|
|
534
|
-
if (!(Math.abs(
|
|
535
|
-
return
|
|
536
|
-
}
|
|
537
|
-
function
|
|
538
|
-
if (
|
|
539
|
-
const
|
|
540
|
-
if (
|
|
541
|
-
const
|
|
542
|
-
return { record: { sidereal:
|
|
543
|
-
}
|
|
544
|
-
const label = "zodiac.sidereal";
|
|
545
|
-
const given = fields(sidereal, label, ["name", "epoch", "value", "rate", "model"]);
|
|
546
|
-
if (given.name !== void 0 && !isUserAyanamsaName(given.name)) {
|
|
547
|
-
throw new RangeError(`${label}.name must be a lowercase identifier of at most 64 characters that is not a built-in name.`);
|
|
532
|
+
if (!(Math.abs(r - Tt) <= 1e8)) throw new RangeError(a);
|
|
533
|
+
return r;
|
|
534
|
+
}
|
|
535
|
+
function Ie(e2) {
|
|
536
|
+
if (e2 === void 0 || e2 === "tropical") return Rn;
|
|
537
|
+
const n2 = N2(e2, "zodiac", ["sidereal"]).sidereal;
|
|
538
|
+
if (n2 === void 0 || typeof n2 == "string") {
|
|
539
|
+
const h3 = k(n2, CALC_AYANAMSAS, "zodiac.sidereal");
|
|
540
|
+
return { record: { sidereal: h3 }, definition: AYANAMSAS[h3], ids: ["zodiac:sidereal", `ayanamsa:${h3}`] };
|
|
548
541
|
}
|
|
549
|
-
const
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
const
|
|
553
|
-
|
|
554
|
-
const
|
|
555
|
-
...
|
|
556
|
-
epoch: { julianDateTT:
|
|
557
|
-
value:
|
|
558
|
-
...
|
|
559
|
-
...
|
|
542
|
+
const t2 = "zodiac.sidereal", a = N2(n2, t2, ["name", "epoch", "value", "rate", "model"]);
|
|
543
|
+
if (a.name !== void 0 && !isUserAyanamsaName(a.name))
|
|
544
|
+
throw new RangeError(`${t2}.name must be a lowercase identifier of at most 64 characters that is not a built-in name.`);
|
|
545
|
+
const r = U(a.epoch, `${t2}.epoch`), s3 = J(a.value, `${t2}.value`, -360, 360);
|
|
546
|
+
if (a.rate !== void 0 && a.model !== void 0) throw new RangeError(`${t2} takes a rate or a model, not both.`);
|
|
547
|
+
const o2 = a.rate === void 0 ? void 0 : J(a.rate, `${t2}.rate`, -3600, 3600), l = a.model === void 0 ? void 0 : k(a.model, ["engine", "newcomb", "iau1976"], `${t2}.model`), i2 = userAyanamsa({
|
|
548
|
+
...a.name === void 0 ? {} : { name: a.name },
|
|
549
|
+
epoch: { julianDateTT: wt(r, `${t2}.epoch`) },
|
|
550
|
+
value: s3,
|
|
551
|
+
...o2 === void 0 ? {} : { rate: o2 },
|
|
552
|
+
...l === void 0 ? {} : { model: l }
|
|
560
553
|
});
|
|
561
|
-
|
|
562
|
-
return { record: { sidereal: user }, definition, ids: ["zodiac:sidereal", `ayanamsa:user-${definition.kind}`] };
|
|
554
|
+
return { record: { sidereal: o2 === void 0 ? { name: i2.name, epoch: r.record, value: s3, model: l ?? "engine" } : { name: i2.name, epoch: r.record, value: s3, rate: o2 } }, definition: i2, ids: ["zodiac:sidereal", `ayanamsa:user-${i2.kind}`] };
|
|
563
555
|
}
|
|
564
|
-
var
|
|
565
|
-
function
|
|
566
|
-
return
|
|
556
|
+
var Et = (e2) => e2.kind !== "epoch" || e2.epochTT - z >= EPHEMERIS_SPAN.daysFromJ2000.from && e2.epochTT - z <= EPHEMERIS_SPAN.daysFromJ2000.to;
|
|
557
|
+
function Pe(e2) {
|
|
558
|
+
return e2.definition && !Et(e2.definition) ? {
|
|
567
559
|
status: "refused",
|
|
568
560
|
reason: "epoch-out-of-range",
|
|
569
561
|
detail: `The ayanamsa's epoch is outside ${EPHEMERIS_SPAN.fromTT} to ${EPHEMERIS_SPAN.toTT} TT (EPHEMERIS_SPAN), where the precession that carries it has been compared with ERFA's.`,
|
|
570
562
|
epochSpan: EPHEMERIS_SPAN
|
|
571
563
|
} : null;
|
|
572
564
|
}
|
|
573
|
-
var
|
|
574
|
-
function
|
|
575
|
-
return
|
|
565
|
+
var At = (e2) => e2 === "ecliptic-true-of-date" || e2 === "ecliptic-mean-of-date";
|
|
566
|
+
function Rt(e2, n2) {
|
|
567
|
+
return e2.definition && !At(n2) ? F(
|
|
576
568
|
"unsupported-combination",
|
|
577
|
-
`The sidereal zodiac is counted along the ecliptic of date; frame ${
|
|
569
|
+
`The sidereal zodiac is counted along the ecliptic of date; frame ${n2} is not offered with it, only ecliptic-true-of-date and ecliptic-mean-of-date.`
|
|
578
570
|
) : null;
|
|
579
571
|
}
|
|
580
|
-
function
|
|
572
|
+
function We(e2, n2, t2, a) {
|
|
581
573
|
return {
|
|
582
|
-
name:
|
|
583
|
-
mean:
|
|
584
|
-
nutation:
|
|
585
|
-
true:
|
|
586
|
-
subtracted,
|
|
587
|
-
bound: { value: ayanamsaBound(
|
|
574
|
+
name: e2.name,
|
|
575
|
+
mean: n2.mean * a,
|
|
576
|
+
nutation: n2.nutation * a,
|
|
577
|
+
true: n2.true * a,
|
|
578
|
+
subtracted: t2,
|
|
579
|
+
bound: { value: ayanamsaBound(e2, n2.elongation).position, unit: "arcsec", label: "measured", basis: ayanamsaBound(e2, n2.elongation).basis }
|
|
588
580
|
};
|
|
589
581
|
}
|
|
590
|
-
function
|
|
591
|
-
|
|
592
|
-
return { ...b, value: addBounds(b.value, add2.value), basis: `${b.basis}; plus the ayanamsa's, ${add2.value} ${b.unit}: ${add2.basis}` };
|
|
582
|
+
function ke(e2, n2) {
|
|
583
|
+
return n2 === null || e2.value === null ? e2 : { ...e2, value: addBounds(e2.value, n2.value), basis: `${e2.basis}; plus the ayanamsa's, ${n2.value} ${e2.unit}: ${n2.basis}` };
|
|
593
584
|
}
|
|
594
|
-
function
|
|
595
|
-
const
|
|
596
|
-
|
|
597
|
-
const
|
|
598
|
-
|
|
599
|
-
const basis = timeBasis(time.ms, time.scale, time.pin);
|
|
600
|
-
return inside(basis.ut1Days) && inside(basis.ttDays) ? basis : null;
|
|
585
|
+
function ge(e2) {
|
|
586
|
+
const n2 = (s3, o2 = 0) => s3 >= wn[0] - o2 && s3 < wn[1] + o2, t2 = (e2.ms - K2) / O2, a = (e2.pin ?? 0) / 86400;
|
|
587
|
+
if (!(n2(t2, 2) && n2(t2 + (e2.scale === "tt" ? -a : a), 2))) return null;
|
|
588
|
+
const r = timeBasis(e2.ms, e2.scale, e2.pin);
|
|
589
|
+
return n2(r.ut1Days) && n2(r.ttDays) ? r : null;
|
|
601
590
|
}
|
|
602
|
-
function
|
|
603
|
-
const
|
|
604
|
-
return
|
|
591
|
+
function Ze(e2, n2) {
|
|
592
|
+
const t2 = ge(e2);
|
|
593
|
+
return t2 === null ? Ve() : n2(t2);
|
|
605
594
|
}
|
|
606
|
-
function
|
|
607
|
-
return onChartClock(
|
|
595
|
+
function Se(e2, n2, t2) {
|
|
596
|
+
return onChartClock(n2, e2.scale, e2.pin, t2);
|
|
608
597
|
}
|
|
609
|
-
function
|
|
598
|
+
function Y(e2) {
|
|
610
599
|
return {
|
|
611
|
-
utc: new Date(Math.round(
|
|
612
|
-
jdUt1:
|
|
613
|
-
jdTt:
|
|
614
|
-
deltaT:
|
|
615
|
-
timeScale:
|
|
600
|
+
utc: new Date(Math.round(e2.utcMs)).toISOString(),
|
|
601
|
+
jdUt1: z + e2.ut1Days,
|
|
602
|
+
jdTt: z + e2.ttDays,
|
|
603
|
+
deltaT: e2.deltaT,
|
|
604
|
+
timeScale: e2.timeScale
|
|
616
605
|
};
|
|
617
606
|
}
|
|
618
|
-
var
|
|
619
|
-
function
|
|
607
|
+
var vt = "time:tt-from-leap-seconds-and-ut1-from-iers-1972-to-table-end;delta-t-model-otherwise";
|
|
608
|
+
function Ce(e2, n2, t2, a, r = true, s3 = EPHEMERIS) {
|
|
620
609
|
return {
|
|
621
610
|
schema: CALC_RECEIPT_SCHEMA,
|
|
622
|
-
request,
|
|
623
|
-
instants,
|
|
611
|
+
request: e2,
|
|
612
|
+
instants: n2,
|
|
624
613
|
conventions: [
|
|
625
|
-
...
|
|
626
|
-
`ephemeris:${
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
...
|
|
614
|
+
...t2,
|
|
615
|
+
`ephemeris:${s3.name}@${s3.version}`,
|
|
616
|
+
a === void 0 ? "deltat:time-basis" : "deltat:pinned",
|
|
617
|
+
vt,
|
|
618
|
+
...r ? ["time-band:first-order"] : []
|
|
630
619
|
],
|
|
631
|
-
engine: { name: "@zodiacs/engine", version: ENGINE_VERSION, ephemeris: { name:
|
|
620
|
+
engine: { name: "@zodiacs/engine", version: ENGINE_VERSION, ephemeris: { name: s3.name, version: s3.version } }
|
|
632
621
|
};
|
|
633
622
|
}
|
|
634
|
-
var
|
|
635
|
-
var
|
|
636
|
-
function
|
|
637
|
-
const
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
s.z * s.vx - s.x * s.vz,
|
|
643
|
-
s.x * s.vy - s.y * s.vx
|
|
623
|
+
var G = (e2) => Tn.includes(e2);
|
|
624
|
+
var le = (e2) => e2 === "North Node" || e2 === "South Node";
|
|
625
|
+
function Mt(e2) {
|
|
626
|
+
const n2 = qn(e2), t2 = eclipticFrame(e2.tt), [a, r] = meanEcliptic(
|
|
627
|
+
t2,
|
|
628
|
+
n2.y * n2.vz - n2.z * n2.vy,
|
|
629
|
+
n2.z * n2.vx - n2.x * n2.vz,
|
|
630
|
+
n2.x * n2.vy - n2.y * n2.vx
|
|
644
631
|
);
|
|
645
|
-
return normalizeLongitude(Math.atan2(
|
|
632
|
+
return normalizeLongitude(Math.atan2(a, -r) * ie + t2.tilt.dpsi / 3600);
|
|
646
633
|
}
|
|
647
|
-
function
|
|
648
|
-
const
|
|
649
|
-
if (
|
|
650
|
-
const
|
|
651
|
-
return
|
|
634
|
+
function xt(e2, n2) {
|
|
635
|
+
const t2 = (o2, l, i2 = 0) => ({ lon: l, lat: i2, dist: null, xyz: null, raw: o2 });
|
|
636
|
+
if (le(e2)) {
|
|
637
|
+
const o2 = Mt(n2);
|
|
638
|
+
return t2(o2, e2 === "North Node" ? o2 : normalizeLongitude(o2 + 180));
|
|
652
639
|
}
|
|
653
|
-
const
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
return row(apogee.lon, normalizeLongitude(apogee.lon), apogee.lat);
|
|
640
|
+
const a = n2.tt / 36525, r = tilt(n2.tt).dpsi / 3600;
|
|
641
|
+
if (e2 === "Black Moon Lilith") {
|
|
642
|
+
const o2 = meanApogee(a, r);
|
|
643
|
+
return t2(o2.lon, normalizeLongitude(o2.lon), o2.lat);
|
|
658
644
|
}
|
|
659
|
-
const
|
|
660
|
-
return
|
|
661
|
-
}
|
|
662
|
-
var
|
|
663
|
-
var
|
|
664
|
-
function
|
|
665
|
-
const
|
|
666
|
-
return (
|
|
667
|
-
let
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
const node = from.trueNode(basis.ttDays);
|
|
672
|
-
lon = body === "North Node" ? tidy(node) : normalizeLongitude(node + 180);
|
|
645
|
+
const s3 = meanNodeLongitude(a, r);
|
|
646
|
+
return t2(s3, normalizeLongitude(e2 === "Mean Node" ? s3 : s3 + 180));
|
|
647
|
+
}
|
|
648
|
+
var Bt = ["Mars", "Jupiter", "Saturn", "Uranus", "Neptune", "Pluto"];
|
|
649
|
+
var Dt = (e2, n2, t2) => n2 === "geocentric" && (le(e2) || !G(e2) && e2 !== "Earth" && t2 === "apparent");
|
|
650
|
+
function vn(e2, n2, t2, a) {
|
|
651
|
+
const r = (s3) => s3 === 360 ? 0 : s3 + 0;
|
|
652
|
+
return (s3, o2) => {
|
|
653
|
+
let l, i2 = 0, c2 = null;
|
|
654
|
+
if (le(n2)) {
|
|
655
|
+
const p3 = e2.trueNode(o2.ttDays);
|
|
656
|
+
l = n2 === "North Node" ? r(p3) : normalizeLongitude(p3 + 180);
|
|
673
657
|
} else {
|
|
674
|
-
const
|
|
675
|
-
|
|
676
|
-
lat = place.lat;
|
|
677
|
-
dist = place.dist ?? null;
|
|
658
|
+
const p3 = e2.place(n2, o2.ttDays, a);
|
|
659
|
+
l = r(p3.lon), i2 = p3.lat, c2 = p3.dist ?? null;
|
|
678
660
|
}
|
|
679
|
-
const
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
const there = toSpherical(turned);
|
|
684
|
-
return { lon: there.lon, lat: there.lat, dist, xyz: scaled(turned), raw: there.lon };
|
|
661
|
+
const h3 = (p3) => c2 === null ? null : [p3[0] * c2, p3[1] * c2, p3[2] * c2], m = fromSpherical(l, i2, 1);
|
|
662
|
+
if (t2 === "ecliptic-true-of-date") return { lon: l, lat: i2, dist: c2, xyz: h3(m), raw: l };
|
|
663
|
+
const b3 = apply(frameMatrix(t2, s3), apply(transpose(frameMatrix("ecliptic-true-of-date", s3)), m)), f = toSpherical(b3);
|
|
664
|
+
return { lon: f.lon, lat: f.lat, dist: c2, xyz: h3(b3), raw: f.lon };
|
|
685
665
|
};
|
|
686
666
|
}
|
|
687
|
-
var
|
|
688
|
-
function
|
|
689
|
-
if (
|
|
690
|
-
const
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
return (at2) => {
|
|
703
|
-
const point = pointAt(body, at2);
|
|
704
|
-
if (frame === "ecliptic-true-of-date") return point;
|
|
705
|
-
const eqj = apply(transpose(frameMatrix("ecliptic-true-of-date", at2)), fromSpherical(point.lon, point.lat, 1));
|
|
706
|
-
const { lon, lat } = toSpherical(apply(frameMatrix(frame, at2), eqj));
|
|
707
|
-
return { lon, lat, dist: null, xyz: null, raw: lon };
|
|
667
|
+
var _t = 695700;
|
|
668
|
+
function Mn(e2, n2, t2) {
|
|
669
|
+
if (n2 === "Sun" || n2 === "Moon" || G(n2) || le(n2) || n2 === "Earth") return false;
|
|
670
|
+
const a = e2.place("Sun", t2), r = e2.place(n2, t2);
|
|
671
|
+
if (a.dist === void 0 || r.dist === void 0 || !(r.dist > a.dist)) return false;
|
|
672
|
+
const s3 = fromSpherical(a.lon, a.lat, 1), o2 = fromSpherical(r.lon, r.lat, 1), l = Math.hypot(s3[1] * o2[2] - s3[2] * o2[1], s3[2] * o2[0] - s3[0] * o2[2], s3[0] * o2[1] - s3[1] * o2[0]), i2 = Math.atan2(l, s3[0] * o2[0] + s3[1] * o2[1] + s3[2] * o2[2]) * ie * 3600, c2 = Math.asin(_t / (a.dist * en)) * ie * 3600;
|
|
673
|
+
return Math.abs(i2 - c2) <= DE440_LIMB_BAND;
|
|
674
|
+
}
|
|
675
|
+
function xn(e2, n2, t2, a) {
|
|
676
|
+
if (G(e2))
|
|
677
|
+
return (s3) => {
|
|
678
|
+
const o2 = xt(e2, s3);
|
|
679
|
+
if (n2 === "ecliptic-true-of-date") return o2;
|
|
680
|
+
const l = apply(transpose(frameMatrix("ecliptic-true-of-date", s3)), fromSpherical(o2.lon, o2.lat, 1)), { lon: i2, lat: c2 } = toSpherical(apply(frameMatrix(n2, s3), l));
|
|
681
|
+
return { lon: i2, lat: c2, dist: null, xyz: null, raw: i2 };
|
|
708
682
|
};
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
const turned = apply(frameMatrix(frame, at2), v);
|
|
714
|
-
const { lon, lat } = frame === "ecliptic-true-of-date" ? eclipticOfDate(v[0], v[1], v[2], at2.tt) : toSpherical(turned);
|
|
715
|
-
const k = dist / length(turned);
|
|
716
|
-
return { lon, lat, dist, xyz: [turned[0] * k, turned[1] * k, turned[2] * k], raw: lon };
|
|
683
|
+
const r = e2;
|
|
684
|
+
return (s3) => {
|
|
685
|
+
const { v: o2, dist: l } = locate(r, t2, a, s3), i2 = apply(frameMatrix(n2, s3), o2), { lon: c2, lat: h3 } = n2 === "ecliptic-true-of-date" ? eclipticOfDate(o2[0], o2[1], o2[2], s3.tt) : toSpherical(i2), m = l / length(i2);
|
|
686
|
+
return { lon: c2, lat: h3, dist: l, xyz: [i2[0] * m, i2[1] * m, i2[2] * m], raw: c2 };
|
|
717
687
|
};
|
|
718
688
|
}
|
|
719
|
-
function
|
|
720
|
-
const
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
const row = evaluate(at2, basis);
|
|
728
|
-
const value = ayanamsaAt(definition, at2);
|
|
729
|
-
const subtracted = trueOfDate ? value.true : value.mean;
|
|
689
|
+
function Nt([e2, n2, t2], a) {
|
|
690
|
+
const r = Math.cos(a * se), s3 = Math.sin(a * se);
|
|
691
|
+
return [e2 * r + n2 * s3, n2 * r - e2 * s3, t2];
|
|
692
|
+
}
|
|
693
|
+
function Bn(e2, n2, t2) {
|
|
694
|
+
const a = t2 === "ecliptic-true-of-date";
|
|
695
|
+
return (r, s3) => {
|
|
696
|
+
const o2 = e2(r, s3), l = ayanamsaAt(n2, r), i2 = a ? l.true : l.mean;
|
|
730
697
|
return {
|
|
731
|
-
lon: wrap360(wrap360(
|
|
732
|
-
lat:
|
|
733
|
-
dist:
|
|
734
|
-
xyz:
|
|
735
|
-
raw:
|
|
736
|
-
ayanamsa:
|
|
698
|
+
lon: wrap360(wrap360(o2.lon) - i2),
|
|
699
|
+
lat: o2.lat,
|
|
700
|
+
dist: o2.dist,
|
|
701
|
+
xyz: o2.xyz && Nt(o2.xyz, i2),
|
|
702
|
+
raw: o2.raw - i2,
|
|
703
|
+
ayanamsa: l
|
|
737
704
|
};
|
|
738
705
|
};
|
|
739
706
|
}
|
|
740
|
-
function
|
|
741
|
-
const
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
if (frame !== "ecliptic-true-of-date") ids.push("frame-turn:from-true-ecliptic-of-date", "nutation:iau2000b");
|
|
760
|
-
if (frame.endsWith("icrs")) ids.push("frame-bias:iau2000");
|
|
761
|
-
return ids;
|
|
762
|
-
}
|
|
763
|
-
if (isPoint(body) || !inertial(frame)) ids.push("precession:iau2006");
|
|
764
|
-
if (frame.includes("true")) ids.push("nutation:iau2000b");
|
|
765
|
-
if (isPoint(body) || frame.startsWith("ecliptic")) ids.push("obliquity:iau2006");
|
|
766
|
-
if (frame.endsWith("icrs")) ids.push("frame-bias:iau2000");
|
|
767
|
-
if (kind === "barycentric") ids.push("barycentre:sun-and-giant-planets");
|
|
768
|
-
if (kind === "topocentric") ids.push("observer:iers2003-ellipsoid;no-polar-motion");
|
|
769
|
-
return ids;
|
|
770
|
-
}
|
|
771
|
-
var PACK_PLACE_IDS = ["place:icrf-to-true-ecliptic-of-date", "frame-bias:iau2006-fukushima-williams", "nutation:iau2000b-p03", "time:tdb-three-term"];
|
|
772
|
-
var MEAN_POINTS = ["Mean Node", "Mean South Node", "Black Moon Lilith"];
|
|
773
|
-
function bound(value, unit, estimated, measured) {
|
|
774
|
-
return value === void 0 || value === null ? { value: null, unit, label: "estimated", basis: "not compared with an independent ephemeris" } : { value, unit, label: estimated === null ? "measured" : "estimated", basis: estimated ?? measured };
|
|
775
|
-
}
|
|
776
|
-
var stretched = (b, extra) => !extra || b.value === null ? b : { ...b, value: addBounds(b.value, extra), label: "estimated", basis: `${b.basis}; plus ${+extra.toPrecision(3)} ${b.unit}, \u0394T extrapolated (docs/calc.md, "Bounds")` };
|
|
777
|
-
function up2(x) {
|
|
778
|
-
const unit = 10 ** (Math.floor(Math.log10(x)) - 1);
|
|
779
|
-
return Number((Math.ceil(x / unit) * unit).toPrecision(2));
|
|
780
|
-
}
|
|
781
|
-
function barycentricSun(r, v) {
|
|
782
|
-
const { au: e, auPerDay: ev } = BARYCENTRE_ERROR;
|
|
783
|
-
const rate = v === null ? null : ev / r + (v + ev) * e * (1 / r ** 2 + 1 / (r * (r - e)));
|
|
784
|
-
return [up2(Math.asin(e / r) * RAD2 * 3600), up2(e / (r - e)), rate === null ? null : up2(rate * RAD2 * 3600)];
|
|
785
|
-
}
|
|
786
|
-
function calc(request) {
|
|
707
|
+
function Ke(e2, n2, t2, a, r, s3 = false) {
|
|
708
|
+
const o2 = [...r.ids, `frame:${n2}`, `center:${t2}`];
|
|
709
|
+
return G(e2) ? (o2.push("correction:not-applicable", e2.endsWith("Lilith") ? "lilith:mean" : e2.startsWith("Mean") ? "node:mean" : "node:true-osculating"), s3 && o2.push(...Je)) : s3 ? (o2.push(`correction:${a}`, "light-time:iterated", "deflection:sun-outside-disc", "aberration:relativistic-annual"), Bt.includes(e2) && o2.push("target:system-barycentre"), o2.push(...Je)) : (o2.push(`correction:${a}`), e2 === "Moon" && t2 === "geocentric" && a !== "astrometric" ? o2.push("moon:series-at-instant") : a !== "geometric" && (o2.push("light-time:newtonian", "deflection:none"), a === "apparent" && t2 !== "barycentric" && o2.push("aberration:backdated-observer"))), s3 ? (o2.push("precession:iau2006", "obliquity:iau2006"), n2 !== "ecliptic-true-of-date" && o2.push("frame-turn:from-true-ecliptic-of-date", "nutation:iau2000b"), n2.endsWith("icrs") && o2.push("frame-bias:iau2000"), o2) : ((G(e2) || !inertial(n2)) && o2.push("precession:iau2006"), n2.includes("true") && o2.push("nutation:iau2000b"), (G(e2) || n2.startsWith("ecliptic")) && o2.push("obliquity:iau2006"), n2.endsWith("icrs") && o2.push("frame-bias:iau2000"), t2 === "barycentric" && o2.push("barycentre:sun-and-giant-planets"), t2 === "topocentric" && o2.push("observer:iers2003-ellipsoid;no-polar-motion"), o2);
|
|
710
|
+
}
|
|
711
|
+
var Je = ["place:icrf-to-true-ecliptic-of-date", "frame-bias:iau2006-fukushima-williams", "nutation:iau2000b-p03", "time:tdb-three-term"];
|
|
712
|
+
var It = ["Mean Node", "Mean South Node", "Black Moon Lilith"];
|
|
713
|
+
function Ye(e2, n2, t2, a) {
|
|
714
|
+
return e2 == null ? { value: null, unit: n2, label: "estimated", basis: "not compared with an independent ephemeris" } : { value: e2, unit: n2, label: t2 === null ? "measured" : "estimated", basis: t2 ?? a };
|
|
715
|
+
}
|
|
716
|
+
var ce = (e2, n2) => !n2 || e2.value === null ? e2 : { ...e2, value: addBounds(e2.value, n2), label: "estimated", basis: `${e2.basis}; plus ${+n2.toPrecision(3)} ${e2.unit}, \u0394T extrapolated (docs/calc.md, "Bounds")` };
|
|
717
|
+
function Ge(e2) {
|
|
718
|
+
const n2 = 10 ** (Math.floor(Math.log10(e2)) - 1);
|
|
719
|
+
return Number((Math.ceil(e2 / n2) * n2).toPrecision(2));
|
|
720
|
+
}
|
|
721
|
+
function Pt(e2, n2) {
|
|
722
|
+
const { au: t2, auPerDay: a } = BARYCENTRE_ERROR, r = n2 === null ? null : a / e2 + (n2 + a) * t2 * (1 / e2 ** 2 + 1 / (e2 * (e2 - t2)));
|
|
723
|
+
return [Ge(Math.asin(t2 / e2) * ie * 3600), Ge(t2 / (e2 - t2)), r === null ? null : Ge(r * ie * 3600)];
|
|
724
|
+
}
|
|
725
|
+
function calc(e2) {
|
|
787
726
|
refuseUnderSource("@zodiacs/engine/calc");
|
|
788
|
-
const
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
let centerRecord;
|
|
794
|
-
if (asked.center === void 0 || typeof asked.center === "string") {
|
|
795
|
-
const kind2 = oneOf(asked.center, ["geocentric", "heliocentric", "barycentric"], "center", "geocentric");
|
|
796
|
-
center = { kind: kind2 };
|
|
797
|
-
centerRecord = kind2;
|
|
727
|
+
const n2 = N2(e2, "calc request", ["body", "time", "frame", "center", "zodiac", "flags"]), t2 = k(n2.body, CALC_BODIES, "body"), a = U(n2.time, "time"), r = k(n2.frame, CALC_FRAMES2, "frame", "ecliptic-true-of-date");
|
|
728
|
+
let s3, o2;
|
|
729
|
+
if (n2.center === void 0 || typeof n2.center == "string") {
|
|
730
|
+
const y2 = k(n2.center, ["geocentric", "heliocentric", "barycentric"], "center", "geocentric");
|
|
731
|
+
s3 = { kind: y2 }, o2 = y2;
|
|
798
732
|
} else {
|
|
799
|
-
const
|
|
800
|
-
|
|
801
|
-
centerRecord = { topocentric: site };
|
|
733
|
+
const y2 = He(N2(n2.center, "center", ["topocentric"]).topocentric, "center.topocentric", true);
|
|
734
|
+
s3 = { kind: "topocentric", site: y2 }, o2 = { topocentric: y2 };
|
|
802
735
|
}
|
|
803
|
-
const
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
const
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
const evaluate = definition === null ? tropical : siderealOf(tropical, definition, frame);
|
|
823
|
-
const now = onInput(time, time.ms, evaluate);
|
|
824
|
-
const step = isTrueNode(body) ? NODE_STEP_DAYS : STEP_DAYS;
|
|
825
|
-
const analytic = flags.speeds && correction === "geometric" && inertial(frame) && !point && body !== "Moon";
|
|
826
|
-
let speeds = null;
|
|
827
|
-
let velocity = null;
|
|
828
|
-
let samples = null;
|
|
829
|
-
const sampling = () => {
|
|
830
|
-
if (samples) return samples;
|
|
831
|
-
const side = from && !isTrueNode(body) ? from.place(body, basis.ttDays).behindDisc : void 0;
|
|
832
|
-
const tropicalSamples = from && side !== void 0 ? packed(from, body, frame, side) : tropical;
|
|
833
|
-
return samples = definition === null ? tropicalSamples : siderealOf(tropicalSamples, definition, frame);
|
|
736
|
+
const l = n2.flags === void 0 ? {} : N2(n2.flags, "flags", ["correction", "speeds", "cartesian", "units", "deflection"]), i2 = {
|
|
737
|
+
correction: k(l.correction, ["apparent", "astrometric", "geometric"], "flags.correction", "apparent"),
|
|
738
|
+
speeds: Ue(l.speeds, "flags.speeds", true),
|
|
739
|
+
cartesian: Ue(l.cartesian, "flags.cartesian", false),
|
|
740
|
+
units: k(l.units, ["degrees", "radians"], "flags.units", "degrees"),
|
|
741
|
+
deflection: Ue(l.deflection, "flags.deflection", false)
|
|
742
|
+
}, c2 = Ie(n2.zodiac), h3 = G(t2), m = s3.kind, b3 = (i2.deflection ? F("not-in-this-version", "Gravitational light deflection is not modelled in this version.") : h3 && m !== "geocentric" ? F("unsupported-combination", `${t2} is a point of the Moon's geocentric orbit; only the geocentric center is offered.`) : h3 && i2.cartesian ? F("unsupported-combination", `${t2} has no distance, so no cartesian position.`) : t2 === "Sun" && m === "heliocentric" ? F("unsupported-combination", "The Sun is the heliocentric origin.") : t2 === "Earth" && (m === "geocentric" || m === "topocentric") ? F("unsupported-combination", "The Earth is offered heliocentric or barycentric only.") : Rt(c2, r)) ?? Pe(c2);
|
|
743
|
+
if (b3) return b3;
|
|
744
|
+
const f = i2.correction, p3 = c2.definition;
|
|
745
|
+
return Ze(a, (y2) => {
|
|
746
|
+
const T2 = Dt(t2, m, f) ? ephemerisAt(a.ms, a.scale, a.pin) : null, u = T2?.from ?? null, E = u ? vn(u, t2, r) : xn(t2, r, s3, f), g3 = p3 === null ? E : Bn(E, p3, r), d3 = Se(a, a.ms, g3), w2 = le(t2) ? An : En, v2 = i2.speeds && f === "geometric" && inertial(r) && !h3 && t2 !== "Moon";
|
|
747
|
+
let S2 = null, M2 = null, C2 = null;
|
|
748
|
+
const A2 = () => {
|
|
749
|
+
if (C2) return C2;
|
|
750
|
+
const R2 = u && !le(t2) ? u.place(t2, y2.ttDays).behindDisc : void 0, x2 = u && R2 !== void 0 ? vn(u, t2, r, R2) : E;
|
|
751
|
+
return C2 = p3 === null ? x2 : Bn(x2, p3, r);
|
|
752
|
+
}, I2 = (R2) => {
|
|
753
|
+
const x2 = a.ms + R2 * O2, B2 = A2();
|
|
754
|
+
return Se(a, x2, (D, _2) => ({ row: B2(D, _2), basis: _2 }));
|
|
834
755
|
};
|
|
835
|
-
|
|
836
|
-
const
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
};
|
|
840
|
-
if (analytic) {
|
|
841
|
-
const { state, turn } = onInput(time, time.ms, (at2) => ({
|
|
842
|
-
state: geometricState(body, center, at2),
|
|
843
|
-
turn: frameMatrix(frame, at2)
|
|
756
|
+
if (v2) {
|
|
757
|
+
const { state: R2, turn: x2 } = Se(a, a.ms, (B2) => ({
|
|
758
|
+
state: geometricState(t2, s3, B2),
|
|
759
|
+
turn: frameMatrix(r, B2)
|
|
844
760
|
}));
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
if (turn > 180) turn -= 360;
|
|
854
|
-
if (turn < -180) turn += 360;
|
|
855
|
-
speeds = {
|
|
856
|
-
lon: turn / elapsed,
|
|
857
|
-
lat: rate(after.row.lat, before.row.lat),
|
|
858
|
-
dist: now.dist === null ? null : rate(after.row.dist, before.row.dist)
|
|
761
|
+
M2 = apply(x2, R2.v), S2 = sphericalRates(apply(x2, R2.r), M2);
|
|
762
|
+
} else if (i2.speeds) {
|
|
763
|
+
const R2 = I2(-w2), x2 = I2(w2), B2 = elapsedDays(R2.basis, x2.basis, 2 * w2), D = (Ae, pe) => (Ae - pe) / B2;
|
|
764
|
+
let _2 = x2.row.raw - R2.row.raw;
|
|
765
|
+
_2 > 180 && (_2 -= 360), _2 < -180 && (_2 += 360), S2 = {
|
|
766
|
+
lon: _2 / B2,
|
|
767
|
+
lat: D(x2.row.lat, R2.row.lat),
|
|
768
|
+
dist: d3.dist === null ? null : D(x2.row.dist, R2.row.dist)
|
|
859
769
|
};
|
|
860
|
-
const [
|
|
861
|
-
|
|
862
|
-
}
|
|
863
|
-
const method = !flags.speeds ? null : analytic ? "analytic" : "central-difference";
|
|
864
|
-
const k = flags.units === "radians" ? DEG2 : 1;
|
|
865
|
-
const group = `${kind}/${point ? "apparent" : correction}`;
|
|
866
|
-
let row = MEASURED[group]?.[body];
|
|
867
|
-
let estimated = null;
|
|
868
|
-
const mean = MEAN_POINTS.includes(body);
|
|
869
|
-
const swept = SWEPT.includes(group) ? SWEPT_BASIS : MEASURED_BASIS;
|
|
870
|
-
let measured = mean ? MEAN_POINTS_BASIS : swept;
|
|
871
|
-
if (from) {
|
|
872
|
-
const position = DE440_MEASURED[body];
|
|
873
|
-
row = position === void 0 ? void 0 : [position, null, null];
|
|
874
|
-
measured = DE440_MEASURED_BASIS;
|
|
875
|
-
if (frame !== "ecliptic-true-of-date") estimated = DE440_TURNED_BASIS;
|
|
876
|
-
if (position !== void 0 && atLimb(from, body, basis.ttDays)) {
|
|
877
|
-
row = [DE440_AT_LIMB, null, null];
|
|
878
|
-
estimated = DE440_AT_LIMB_BASIS;
|
|
879
|
-
}
|
|
880
|
-
} else if (!row && kind === "topocentric") {
|
|
881
|
-
row = MEASURED[`geocentric/${correction}`]?.[body];
|
|
882
|
-
estimated = "the geocentric bound for this correction; the Sun, Moon and Mars, compared topocentric on 32 instants, fall within it";
|
|
883
|
-
} else if (kind === "barycentric" && body === "Sun") {
|
|
884
|
-
row = barycentricSun(now.dist, velocity && length(velocity));
|
|
885
|
-
estimated = `the largest angle, relative distance and rate of direction that the error of astronomy-engine's barycentre, ${BARYCENTRE_ERROR.au.toExponential()} au and ${BARYCENTRE_ERROR.auPerDay.toExponential()} au/day from 1800 to 2200, allows at this distance and speed; docs/evidence/calc-api`;
|
|
770
|
+
const [j2, V2] = [x2.row.xyz, R2.row.xyz];
|
|
771
|
+
j2 && V2 && (M2 = [D(j2[0], V2[0]), D(j2[1], V2[1]), D(j2[2], V2[2])]);
|
|
886
772
|
}
|
|
887
|
-
const
|
|
888
|
-
|
|
889
|
-
const
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
const
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
(Math.hypot(
|
|
905
|
-
|
|
906
|
-
(Math.hypot((turn(a.raw, now.raw) - turn(now.raw, b.raw)) * cos, a.lat - 2 * now.lat + b.lat) / h / h / 24 + spin) * tt + spin * ut1
|
|
907
|
-
];
|
|
908
|
-
ids.push("bounds:plus-delta-t-band");
|
|
773
|
+
const q = i2.speeds ? v2 ? "analytic" : "central-difference" : null, L2 = i2.units === "radians" ? se : 1, ue = `${m}/${h3 ? "apparent" : f}`;
|
|
774
|
+
let P = MEASURED[ue]?.[t2], $ = null;
|
|
775
|
+
const de = It.includes(t2), X = SWEPT.includes(ue) ? SWEPT_BASIS : MEASURED_BASIS;
|
|
776
|
+
let Q = de ? MEAN_POINTS_BASIS : X;
|
|
777
|
+
if (u) {
|
|
778
|
+
const R2 = DE440_MEASURED[t2];
|
|
779
|
+
P = R2 === void 0 ? void 0 : [R2, null, null], Q = DE440_MEASURED_BASIS, r !== "ecliptic-true-of-date" && ($ = DE440_TURNED_BASIS), R2 !== void 0 && Mn(u, t2, y2.ttDays) && (P = [DE440_AT_LIMB, null, null], $ = DE440_AT_LIMB_BASIS);
|
|
780
|
+
} else !P && m === "topocentric" ? (P = MEASURED[`geocentric/${f}`]?.[t2], $ = "the geocentric bound for this correction; the Sun, Moon and Mars, compared topocentric on 32 instants, fall within it") : m === "barycentric" && t2 === "Sun" && (P = Pt(d3.dist, M2 && length(M2)), $ = `the largest angle, relative distance and rate of direction that the error of astronomy-engine's barycentre, ${BARYCENTRE_ERROR.au.toExponential()} au and ${BARYCENTRE_ERROR.auPerDay.toExponential()} au/day from 1800 to 2200, allows at this distance and speed; docs/evidence/calc-api`);
|
|
781
|
+
const me = Ke(t2, r, m, f, c2, u !== null);
|
|
782
|
+
q && me.push(q === "analytic" ? "speed:analytic" : `speed:central-difference-${w2}d`);
|
|
783
|
+
const ee = s3.kind === "topocentric" ? ANGVEL * (EARTH_EQUATORIAL_RADIUS_KM + Math.max(s3.site.height, 0) / 1e3) / en : 0, H2 = ee && ee / (d3.dist * (1 - 1e-3)) * ie * 3600, Xe = timeBands(y2), { tt: ne, ut1: te } = Xe, Qe = deltaTExtrapolated(y2, H2);
|
|
784
|
+
let we = [0, 0, 0];
|
|
785
|
+
if (Qe) {
|
|
786
|
+
const [R2, x2] = [I2(w2), I2(-w2)], [B2, D] = [R2.row, x2.row], _2 = elapsedDays(x2.basis, R2.basis, 2 * w2) / 2, j2 = ($n, zn) => ($n - zn + 540) % 360 - 180, V2 = Math.cos(d3.lat * se), Ae = H2 * ANGVEL * 86400, pe = d3.dist;
|
|
787
|
+
we = [
|
|
788
|
+
(Math.hypot(j2(B2.raw, D.raw) * V2, B2.lat - D.lat) / _2 / 48 + H2) * ne + H2 * te,
|
|
789
|
+
pe && (Math.abs(B2.dist - D.dist) / _2 / 172800 + ee) / pe * ne + ee / pe * te,
|
|
790
|
+
(Math.hypot((j2(B2.raw, d3.raw) - j2(d3.raw, D.raw)) * V2, B2.lat - 2 * d3.lat + D.lat) / _2 / _2 / 24 + Ae) * ne + Ae * te
|
|
791
|
+
], me.push("bounds:plus-delta-t-band");
|
|
909
792
|
}
|
|
910
|
-
const
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
dist: speeds.dist === null ? null : (Math.abs(speeds.dist) / 86400 + v) * tt + v * ut1
|
|
793
|
+
const Ee = p3 === null ? null : d3.ayanamsa, ae = Ee && ayanamsaBound(p3, Ee.elongation);
|
|
794
|
+
let ze = null;
|
|
795
|
+
if (S2) {
|
|
796
|
+
const R2 = H2 / Math.cos(d3.lat * se);
|
|
797
|
+
ze = {
|
|
798
|
+
time: Xe,
|
|
799
|
+
lon: (Math.abs(S2.lon) / 24 + R2) * ne + R2 * te,
|
|
800
|
+
lat: (Math.abs(S2.lat) / 24 + H2) * ne + H2 * te,
|
|
801
|
+
dist: S2.dist === null ? null : (Math.abs(S2.dist) / 86400 + ee) * ne + ee * te
|
|
920
802
|
};
|
|
921
803
|
}
|
|
922
804
|
return {
|
|
923
805
|
status: "ok",
|
|
924
|
-
body,
|
|
925
|
-
frame,
|
|
926
|
-
lon:
|
|
927
|
-
lat:
|
|
928
|
-
dist:
|
|
929
|
-
speeds:
|
|
930
|
-
cartesian:
|
|
931
|
-
ayanamsa:
|
|
806
|
+
body: t2,
|
|
807
|
+
frame: r,
|
|
808
|
+
lon: d3.lon * L2,
|
|
809
|
+
lat: d3.lat * L2,
|
|
810
|
+
dist: d3.dist,
|
|
811
|
+
speeds: S2 && { lon: S2.lon * L2, lat: S2.lat * L2, dist: S2.dist },
|
|
812
|
+
cartesian: i2.cartesian && d3.xyz ? { x: d3.xyz[0], y: d3.xyz[1], z: d3.xyz[2], vx: M2?.[0] ?? null, vy: M2?.[1] ?? null, vz: M2?.[2] ?? null } : null,
|
|
813
|
+
ayanamsa: Ee && We(p3, Ee, r === "ecliptic-true-of-date" ? "true" : "mean", L2),
|
|
932
814
|
bounds: {
|
|
933
|
-
position:
|
|
934
|
-
|
|
935
|
-
|
|
815
|
+
position: ce(
|
|
816
|
+
ke(Ye(P?.[0], "arcsec", $, Q), ae && { value: ae.position, basis: ae.basis }),
|
|
817
|
+
we[0]
|
|
936
818
|
),
|
|
937
|
-
distance:
|
|
938
|
-
speed:
|
|
939
|
-
...
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
819
|
+
distance: h3 ? null : ce(Ye(P?.[1], "relative", $, u ? Q : X), we[1]),
|
|
820
|
+
speed: q && {
|
|
821
|
+
...ce(
|
|
822
|
+
ke(
|
|
823
|
+
Ye(P?.[2], "arcsec/day", $, de ? MEAN_POINTS_SPEED_BASIS : u ? Q : X),
|
|
824
|
+
ae && { value: ae.rate, basis: ae.basis }
|
|
943
825
|
),
|
|
944
|
-
|
|
826
|
+
we[2]
|
|
945
827
|
),
|
|
946
|
-
method,
|
|
947
|
-
stepDays:
|
|
828
|
+
method: q,
|
|
829
|
+
stepDays: v2 ? null : w2
|
|
948
830
|
}
|
|
949
831
|
},
|
|
950
|
-
band,
|
|
832
|
+
band: ze,
|
|
951
833
|
// Last, a position the pack gives that astronomy-engine gave instead says why.
|
|
952
|
-
flags:
|
|
953
|
-
receipt:
|
|
954
|
-
{ body, time:
|
|
955
|
-
[
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
834
|
+
flags: $e(Qe, T2?.fallback),
|
|
835
|
+
receipt: Ce(
|
|
836
|
+
{ body: t2, time: a.record, frame: r, center: o2, zodiac: c2.record, flags: i2 },
|
|
837
|
+
[Y(y2)],
|
|
838
|
+
me,
|
|
839
|
+
a.pin,
|
|
840
|
+
ze !== null,
|
|
841
|
+
T2?.ephemeris
|
|
960
842
|
)
|
|
961
843
|
};
|
|
962
844
|
});
|
|
963
845
|
}
|
|
964
|
-
var
|
|
965
|
-
var
|
|
966
|
-
function
|
|
967
|
-
return [
|
|
968
|
-
const
|
|
846
|
+
var Dn = 1.0027378119113546 / 3600;
|
|
847
|
+
var Te = 600 / 86400;
|
|
848
|
+
function _n(e2, n2, t2) {
|
|
849
|
+
return [Te, -Te].map((a) => {
|
|
850
|
+
const r = e2.AddDays(a);
|
|
969
851
|
return {
|
|
970
|
-
input: { gastHours: gastHours({ ut:
|
|
971
|
-
less:
|
|
852
|
+
input: { gastHours: gastHours({ ut: e2.ut, tt: r.tt }), ...n2, obliquity: tilt(r.tt).tobl },
|
|
853
|
+
less: t2 === null ? 0 : ayanamsaAt(t2, r).true
|
|
972
854
|
};
|
|
973
855
|
});
|
|
974
856
|
}
|
|
975
|
-
function
|
|
976
|
-
const
|
|
977
|
-
const
|
|
978
|
-
return [
|
|
979
|
-
(
|
|
857
|
+
function Nn(e2, n2, t2, a, r = 0) {
|
|
858
|
+
const s3 = (y2, T2 = 0) => {
|
|
859
|
+
const u = computeAngles(y2);
|
|
860
|
+
return [u.asc, u.mc, vertexOf(y2, u), eastPointOf(y2), ...n2 === "whole" ? [] : computeHouses(n2, y2, u).houses.cusps].map(
|
|
861
|
+
(E) => E - T2
|
|
980
862
|
);
|
|
981
|
-
}
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
onTt = rates(minus, plus, 2 * TT_STEP * 86400);
|
|
994
|
-
const [up, down] = moved.map((side) => isPolarUndefinedHouseSystem(system) && Math.abs(side.input.latitude) >= 90 - side.input.obliquity);
|
|
995
|
-
if (up || down) {
|
|
996
|
-
const here = values(input, less);
|
|
997
|
-
const one = up ? down ? null : rates(minus, here, TT_STEP * 86400) : rates(here, plus, TT_STEP * 86400);
|
|
998
|
-
for (let index = 4; index < onTt.length; index += 1) onTt[index] = one ? one[index] : 0;
|
|
863
|
+
}, o2 = (y2, T2, u) => T2.map((E, g3) => {
|
|
864
|
+
let d3 = E - y2[g3];
|
|
865
|
+
return d3 > 180 ? d3 -= 360 : d3 <= -180 && (d3 += 360), Math.abs(d3) * 3600 / u;
|
|
866
|
+
}), l = s3({ ...e2, gastHours: e2.gastHours - Dn }), i2 = o2(l, s3({ ...e2, gastHours: e2.gastHours + Dn }), 2);
|
|
867
|
+
let c2 = null;
|
|
868
|
+
if (a) {
|
|
869
|
+
const [y2, T2] = a.map((g3) => s3(g3.input, g3.less));
|
|
870
|
+
c2 = o2(T2, y2, 2 * Te * 86400);
|
|
871
|
+
const [u, E] = a.map((g3) => isPolarUndefinedHouseSystem(n2) && Math.abs(g3.input.latitude) >= 90 - g3.input.obliquity);
|
|
872
|
+
if (u || E) {
|
|
873
|
+
const g3 = s3(e2, r), d3 = u ? E ? null : o2(T2, g3, Te * 86400) : o2(g3, y2, Te * 86400);
|
|
874
|
+
for (let w2 = 4; w2 < c2.length; w2 += 1) c2[w2] = d3 ? d3[w2] : 0;
|
|
999
875
|
}
|
|
1000
876
|
}
|
|
1001
|
-
const [
|
|
1002
|
-
return { asc, mc, vertex, eastPoint, cusps:
|
|
1003
|
-
}
|
|
1004
|
-
function houses(
|
|
1005
|
-
const
|
|
1006
|
-
|
|
1007
|
-
const
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
const { input, value, moved } = onInput(time, time.ms, (at2) => ({
|
|
1016
|
-
input: { gastHours: gastHours(at2), latitude, longitude, obliquity: tilt(at2.tt).tobl },
|
|
1017
|
-
value: definition && ayanamsaAt(definition, at2),
|
|
1018
|
-
moved: bands.tt === 0 ? null : movedOnTt(at2, { latitude, longitude }, definition)
|
|
1019
|
-
}));
|
|
1020
|
-
const tropical = computeAngles(input);
|
|
1021
|
-
const { houses: computed, fellBack } = computeHouses(system, input, tropical);
|
|
1022
|
-
const zodiacal = value === null ? (lon) => lon : (lon) => wrap360(wrap360(lon) - value.true);
|
|
1023
|
-
const angles = value === null ? tropical : { asc: zodiacal(tropical.asc), mc: zodiacal(tropical.mc), dsc: zodiacal(tropical.dsc), ic: zodiacal(tropical.ic) };
|
|
1024
|
-
const cusps = value === null ? computed.cusps : computed.system === "whole" ? wholeSignCusps(angles.asc) : computed.cusps.map(zodiacal);
|
|
1025
|
-
const bounded = definition && value && ayanamsaBound(definition, value.elongation);
|
|
1026
|
-
const added = bounded && { value: bounded.position, basis: bounded.basis };
|
|
1027
|
-
const basis = (what) => `largest difference over the conformance suite's L2 ${what}, whose arbiter is ERFA with each system's definition`;
|
|
1028
|
-
const turned = angleBands(input, computed.system, bands, moved, value === null ? 0 : value.true);
|
|
1029
|
-
const late = deltaTExtrapolated(used, 1);
|
|
1030
|
-
const flags = fellBack ? ["polar-fallback"] : [];
|
|
1031
|
-
if (insidePolarCircle(input)) flags.push("polar-angles");
|
|
1032
|
-
if (late) flags.push("delta-t-extrapolated");
|
|
1033
|
-
return {
|
|
877
|
+
const [h3, m, b3, f, ...p3] = i2.map((y2, T2) => y2 * t2.ut1 + (c2 ? c2[T2] * t2.tt : 0));
|
|
878
|
+
return { asc: h3, mc: m, vertex: b3, eastPoint: f, cusps: n2 === "whole" ? Array(12).fill(0) : p3 };
|
|
879
|
+
}
|
|
880
|
+
function houses(e2) {
|
|
881
|
+
const n2 = N2(e2, "houses request", ["time", "place", "houseSystem", "zodiac"]), t2 = U(n2.time, "time"), { latitude: a, longitude: r } = He(n2.place, "place"), s3 = validateBirthSettings({ houseSystem: n2.houseSystem }).houseSystem ?? "whole", o2 = Ie(n2.zodiac), l = Pe(o2);
|
|
882
|
+
if (l) return l;
|
|
883
|
+
const i2 = o2.definition;
|
|
884
|
+
return Ze(t2, (c2) => {
|
|
885
|
+
const h3 = timeBands(c2), { input: m, value: b3, moved: f } = Se(t2, t2.ms, (A2) => ({
|
|
886
|
+
input: { gastHours: gastHours(A2), latitude: a, longitude: r, obliquity: tilt(A2.tt).tobl },
|
|
887
|
+
value: i2 && ayanamsaAt(i2, A2),
|
|
888
|
+
moved: h3.tt === 0 ? null : _n(A2, { latitude: a, longitude: r }, i2)
|
|
889
|
+
})), p3 = computeAngles(m), { houses: y2, fellBack: T2 } = computeHouses(s3, m, p3), u = b3 === null ? (A2) => A2 : (A2) => wrap360(wrap360(A2) - b3.true), E = b3 === null ? p3 : { asc: u(p3.asc), mc: u(p3.mc), dsc: u(p3.dsc), ic: u(p3.ic) }, g3 = b3 === null ? y2.cusps : y2.system === "whole" ? wholeSignCusps(E.asc) : y2.cusps.map(u), d3 = i2 && b3 && ayanamsaBound(i2, b3.elongation), w2 = d3 && { value: d3.position, basis: d3.basis }, v2 = (A2) => `largest difference over the conformance suite's L2 ${A2}, whose arbiter is ERFA with each system's definition`, S2 = Nn(m, y2.system, h3, f, b3 === null ? 0 : b3.true), M2 = deltaTExtrapolated(c2, 1), C2 = T2 ? ["polar-fallback"] : [];
|
|
890
|
+
return insidePolarCircle(m) && C2.push("polar-angles"), M2 && C2.push("delta-t-extrapolated"), {
|
|
1034
891
|
status: "ok",
|
|
1035
|
-
requested:
|
|
1036
|
-
system:
|
|
1037
|
-
cusps,
|
|
1038
|
-
angles,
|
|
892
|
+
requested: s3,
|
|
893
|
+
system: y2.system,
|
|
894
|
+
cusps: g3,
|
|
895
|
+
angles: E,
|
|
1039
896
|
// Normalized once more, as chartPoints() reports them.
|
|
1040
|
-
vertex:
|
|
1041
|
-
eastPoint:
|
|
1042
|
-
armc: ramcOf(
|
|
1043
|
-
obliquity:
|
|
1044
|
-
flags,
|
|
1045
|
-
ayanamsa:
|
|
897
|
+
vertex: u(normalizeLongitude(vertexOf(m, p3))),
|
|
898
|
+
eastPoint: u(normalizeLongitude(eastPointOf(m))),
|
|
899
|
+
armc: ramcOf(m),
|
|
900
|
+
obliquity: m.obliquity,
|
|
901
|
+
flags: C2,
|
|
902
|
+
ayanamsa: b3 && We(i2, b3, "true", 1),
|
|
1046
903
|
bounds: {
|
|
1047
|
-
angles:
|
|
1048
|
-
|
|
1049
|
-
{ value: 0.02, unit: "arcsec", label: "measured", basis:
|
|
1050
|
-
|
|
904
|
+
angles: ce(
|
|
905
|
+
ke(
|
|
906
|
+
{ value: 0.02, unit: "arcsec", label: "measured", basis: v2("vectors of the ascendant, midheaven, Vertex and East Point") },
|
|
907
|
+
w2
|
|
1051
908
|
),
|
|
1052
|
-
|
|
909
|
+
M2 ? Math.max(S2.asc, S2.mc, S2.vertex, S2.eastPoint) : 0
|
|
1053
910
|
),
|
|
1054
|
-
cusps:
|
|
1055
|
-
|
|
1056
|
-
|
|
911
|
+
cusps: ce(
|
|
912
|
+
ke({ value: 0.08, unit: "arcsec", label: "measured", basis: v2("cusp vectors, thirteen systems") }, w2),
|
|
913
|
+
M2 ? Math.max(...S2.cusps) : 0
|
|
1057
914
|
)
|
|
1058
915
|
},
|
|
1059
|
-
band: { time:
|
|
1060
|
-
receipt:
|
|
1061
|
-
{ time:
|
|
1062
|
-
[
|
|
916
|
+
band: { time: h3, ...S2 },
|
|
917
|
+
receipt: Ce(
|
|
918
|
+
{ time: t2.record, place: { latitude: a, longitude: r }, houseSystem: s3, zodiac: o2.record },
|
|
919
|
+
[Y(c2)],
|
|
1063
920
|
[
|
|
1064
|
-
...
|
|
1065
|
-
`house:${
|
|
1066
|
-
...
|
|
921
|
+
...o2.ids,
|
|
922
|
+
`house:${s3}`,
|
|
923
|
+
...T2 ? ["polar-fallback:whole"] : [],
|
|
1067
924
|
"angles:gast-and-true-obliquity",
|
|
1068
925
|
"sidereal-time:gast-iau2006-era",
|
|
1069
926
|
"nutation:iau2000b",
|
|
1070
927
|
"obliquity:iau2006",
|
|
1071
|
-
...
|
|
928
|
+
...M2 ? ["bounds:plus-delta-t-band"] : []
|
|
1072
929
|
],
|
|
1073
|
-
|
|
930
|
+
t2.pin
|
|
1074
931
|
)
|
|
1075
932
|
};
|
|
1076
933
|
});
|
|
1077
934
|
}
|
|
1078
|
-
function
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
const from = readTime(asked.from, "from");
|
|
1085
|
-
const to = readTime(asked.to, "to");
|
|
1086
|
-
const stepDays = asked.stepDays === void 0 ? 5 : asked.stepDays;
|
|
1087
|
-
const budget = asked.maxSamples === Infinity ? void 0 : asked.maxSamples;
|
|
1088
|
-
const limit = budget === void 0 ? {} : { maxSamples: budget };
|
|
1089
|
-
const zodiac = readZodiac(asked.zodiac);
|
|
1090
|
-
const refusal = (!CHART_BODIES.includes(body) ? refuse("unsupported-combination", `Crossings are searched for the bodies positions() gives; ${body} is not one.`) : from.pin !== void 0 || to.pin !== void 0 ? refuse("unsupported-combination", "Crossing searches run on the engine's \u0394T model; a pinned \u0394T is not offered.") : null) ?? epochRefusal(zodiac);
|
|
1091
|
-
if (refusal) return refusal;
|
|
1092
|
-
const definition = zodiac.definition;
|
|
1093
|
-
const longitudeAt = definition === null ? bodyLongitude : (b, date) => {
|
|
1094
|
-
const tropical = bodyLongitude(b, date);
|
|
1095
|
-
return wrap360(wrap360(tropical) - onChartClock(date.getTime(), "utc", void 0, (at2) => ayanamsaAt(definition, at2).true));
|
|
935
|
+
function In(e2, n2 = e2, t2 = e2.ttDays) {
|
|
936
|
+
return {
|
|
937
|
+
at: new Date(Math.round(e2.utcMs)).toISOString(),
|
|
938
|
+
jdUt1: z + e2.ut1Days,
|
|
939
|
+
jdTt: z + t2,
|
|
940
|
+
band: { utc: timeBands(n2).tt, ut1: e2.deltaT.sigma ?? 0 }
|
|
1096
941
|
};
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
942
|
+
}
|
|
943
|
+
function $e(e2, n2) {
|
|
944
|
+
const t2 = [];
|
|
945
|
+
return e2 && t2.push("delta-t-extrapolated"), n2 && t2.push(n2), t2;
|
|
946
|
+
}
|
|
947
|
+
function events(e2) {
|
|
948
|
+
refuseUnderSource("@zodiacs/engine/calc");
|
|
949
|
+
const n2 = N2(e2, "events request", ["kind", "body", "longitude", "from", "to", "zodiac", "stepDays", "maxSamples"]), t2 = k(n2.kind, ["longitude-crossing"], "kind"), a = k(n2.body, CALC_BODIES, "body"), r = J(n2.longitude, "longitude", -Number.MAX_VALUE, Number.MAX_VALUE), s3 = U(n2.from, "from"), o2 = U(n2.to, "to"), l = n2.stepDays === void 0 ? 5 : n2.stepDays, i2 = n2.maxSamples === 1 / 0 ? void 0 : n2.maxSamples, c2 = i2 === void 0 ? {} : { maxSamples: i2 }, h3 = Ie(n2.zodiac), m = (Ct.includes(a) ? s3.pin !== void 0 || o2.pin !== void 0 ? F("unsupported-combination", "Crossing searches run on the engine's \u0394T model; a pinned \u0394T is not offered.") : null : F("unsupported-combination", `Crossings are searched for the bodies positions() gives; ${a} is not one.`)) ?? Pe(h3);
|
|
950
|
+
if (m) return m;
|
|
951
|
+
const b3 = h3.definition, f = b3 === null ? bodyLongitude : (T2, u) => {
|
|
952
|
+
const E = bodyLongitude(T2, u);
|
|
953
|
+
return wrap360(wrap360(E) - onChartClock(u.getTime(), "utc", void 0, (g3) => ayanamsaAt(b3, g3).true));
|
|
954
|
+
}, p3 = ge(s3), y2 = ge(o2);
|
|
955
|
+
if (p3 === null || y2 === null) return Ve();
|
|
1100
956
|
{
|
|
1101
|
-
const
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
dated(end),
|
|
1109
|
-
{ stepDays, ...limit }
|
|
957
|
+
const T2 = ephemerisAt(Math.round(p3.utcMs)), u = (v2) => new Date(Math.round(v2.utcMs)), E = searchLongitudeCrossingsWith(
|
|
958
|
+
f,
|
|
959
|
+
a,
|
|
960
|
+
r,
|
|
961
|
+
u(p3),
|
|
962
|
+
u(y2),
|
|
963
|
+
{ stepDays: l, ...c2 }
|
|
1110
964
|
);
|
|
1111
|
-
if (
|
|
1112
|
-
const { samples, maxSamples } =
|
|
1113
|
-
return { status: "refused", reason: "sample-budget", detail: `The search needs more than ${
|
|
965
|
+
if (E.status === "refused") {
|
|
966
|
+
const { samples: v2, maxSamples: S2 } = E;
|
|
967
|
+
return { status: "refused", reason: "sample-budget", detail: `The search needs more than ${S2} evaluations.`, samples: v2, maxSamples: S2 };
|
|
1114
968
|
}
|
|
1115
|
-
let
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
const utc = timeBands(basis).tt;
|
|
1120
|
-
if (deltaTExtrapolated(basis)) {
|
|
1121
|
-
flagged = true;
|
|
1122
|
-
late = Math.max(late, utc);
|
|
1123
|
-
}
|
|
1124
|
-
return {
|
|
1125
|
-
at: at2.toISOString(),
|
|
1126
|
-
jdUt1: J2000_JD + basis.ut1Days,
|
|
1127
|
-
jdTt: J2000_JD + basis.ttDays,
|
|
1128
|
-
retrograde,
|
|
1129
|
-
band: { utc, ut1: basis.deltaT.sigma ?? 0 }
|
|
1130
|
-
};
|
|
969
|
+
let g3 = 0, d3 = false;
|
|
970
|
+
const w2 = E.crossings.map((v2) => {
|
|
971
|
+
const S2 = timeBasis(v2.at.getTime(), "utc"), { at: M2, jdUt1: C2, jdTt: A2, band: I2 } = In(S2);
|
|
972
|
+
return deltaTExtrapolated(S2) && (d3 = true, g3 = Math.max(g3, I2.utc)), { at: M2, jdUt1: C2, jdTt: A2, retrograde: v2.retrograde, band: I2 };
|
|
1131
973
|
});
|
|
1132
974
|
return {
|
|
1133
975
|
status: "ok",
|
|
1134
|
-
kind,
|
|
1135
|
-
events:
|
|
1136
|
-
samples:
|
|
1137
|
-
flags:
|
|
976
|
+
kind: t2,
|
|
977
|
+
events: w2,
|
|
978
|
+
samples: E.samples,
|
|
979
|
+
flags: $e(d3, T2.fallback),
|
|
1138
980
|
bounds: {
|
|
1139
|
-
timing:
|
|
981
|
+
timing: ce(
|
|
1140
982
|
{
|
|
1141
|
-
value:
|
|
983
|
+
value: l * 86400 / 2 ** 24,
|
|
1142
984
|
unit: "s",
|
|
1143
985
|
label: "estimated",
|
|
1144
|
-
basis: "the bisection bracket, step / 2^24, on the engine's own longitudes; the ephemeris's error over the body's speed adds to it" + (
|
|
986
|
+
basis: "the bisection bracket, step / 2^24, on the engine's own longitudes; the ephemeris's error over the body's speed adds to it" + (b3 === null ? "" : ", and in the sidereal zodiac the ayanamsa's")
|
|
1145
987
|
},
|
|
1146
|
-
|
|
988
|
+
g3
|
|
1147
989
|
)
|
|
1148
990
|
},
|
|
1149
|
-
receipt:
|
|
1150
|
-
{ kind, body, longitude, from:
|
|
1151
|
-
[
|
|
991
|
+
receipt: Ce(
|
|
992
|
+
{ kind: t2, body: a, longitude: r, from: s3.record, to: o2.record, zodiac: h3.record, stepDays: l, ...c2 },
|
|
993
|
+
[Y(p3), Y(y2)],
|
|
1152
994
|
[
|
|
1153
|
-
...
|
|
995
|
+
...Ke(a, "ecliptic-true-of-date", "geocentric", "apparent", h3, T2.from !== null),
|
|
1154
996
|
"search:scan-and-bisect",
|
|
1155
|
-
...
|
|
997
|
+
...d3 ? ["bounds:plus-delta-t-band"] : []
|
|
1156
998
|
],
|
|
1157
999
|
void 0,
|
|
1158
1000
|
true,
|
|
1159
|
-
|
|
1001
|
+
T2.ephemeris
|
|
1160
1002
|
)
|
|
1161
1003
|
};
|
|
1162
1004
|
}
|
|
1163
1005
|
}
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
const
|
|
1006
|
+
var kt = ["Mercury", "Venus", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune", "Pluto"];
|
|
1007
|
+
function Pn(e2, n2) {
|
|
1008
|
+
if (e2) return (a, r) => e2.place(n2, (a - K2) / O2, r);
|
|
1009
|
+
const t2 = xn(n2, "ecliptic-true-of-date", { kind: "geocentric" }, "apparent");
|
|
1010
|
+
return (a) => onChartClock(a, "tt", void 0, t2);
|
|
1011
|
+
}
|
|
1012
|
+
function kn(e2, n2, t2) {
|
|
1013
|
+
const a = U(e2.from, "from"), r = U(e2.to, "to"), s3 = e2.maxSamples === void 0 ? 1 / 0 : e2.maxSamples;
|
|
1014
|
+
if (s3 !== 1 / 0 && (!Number.isSafeInteger(s3) || s3 < 1)) throw new RangeError("maxSamples must be a positive safe integer or Infinity.");
|
|
1015
|
+
if (a.pin !== void 0 || r.pin !== void 0) return F("unsupported-combination", "Event searches require the engine's time basis.");
|
|
1016
|
+
const o2 = ge(a), l = ge(r);
|
|
1017
|
+
if (!o2 || !l) return Ve();
|
|
1018
|
+
const i2 = (C2) => Math.round(K2 + C2.ttDays * O2), c2 = i2(o2), h3 = i2(l), m = "phaseDegrees" in n2, b3 = c2 === h3 ? 0 : m ? HOUR_MS : 2 * HOUR_MS;
|
|
1019
|
+
let f = ephemerisAt(c2 - b3, "tt");
|
|
1020
|
+
f.from && c2 !== h3 && (f = ephemerisAt(h3 + b3, "tt"));
|
|
1021
|
+
const p3 = "body" in n2 ? n2.body : "Moon", y2 = m ? ["Moon", "Sun"] : [p3], T2 = Pn(f.from, p3), u = Pn(f.from, "Sun"), g3 = scanEventRoots(c2, h3, m, (C2) => {
|
|
1022
|
+
const A2 = T2(C2);
|
|
1023
|
+
return m ? principal(A2.lon - u(C2).lon - n2.phaseDegrees) : principal(T2(C2 + HOUR_MS, A2.behindDisc).lon - T2(C2 - HOUR_MS, A2.behindDisc).lon) * 12;
|
|
1024
|
+
}, s3);
|
|
1025
|
+
if (g3.status === "refused") return g3;
|
|
1026
|
+
const d3 = new Set($e(false, f.fallback)), w2 = (C2, A2, I2) => (f.from ? Mn(f.from, C2, (I2 - K2) / O2) ? DE440_AT_LIMB : DE440_MEASURED[C2] : MEASURED["geocentric/apparent"][C2][0]) / Math.cos(A2 * se), v2 = g3.roots.map(({ ttMs: C2, slope: A2, rising: I2 }) => {
|
|
1027
|
+
const q = timeBasis(C2, "tt"), L2 = timeBasis(q.utcMs, "utc"), ue = $e(deltaTExtrapolated(L2, true), f.fallback);
|
|
1028
|
+
for (const me of ue) d3.add(me);
|
|
1029
|
+
let P = w2(p3, T2(C2).lat, C2);
|
|
1030
|
+
m && (P += w2("Sun", u(C2).lat, C2));
|
|
1031
|
+
const $ = Math.max(1, P), de = $ / (Math.abs(A2) * 3600), X = 86400 * (m ? de : Math.sqrt(2 * de)), Q = {
|
|
1032
|
+
value: Number.isFinite(X) ? 1e-3 + X : null,
|
|
1033
|
+
unit: "s",
|
|
1034
|
+
label: "estimated",
|
|
1035
|
+
basis: m ? "local longitude allowance divided by phase rate, plus TT bracket" : "local quadratic longitude excursion at the station, plus TT bracket"
|
|
1036
|
+
};
|
|
1037
|
+
return t2({
|
|
1038
|
+
...In(q, L2, (C2 - K2) / O2),
|
|
1039
|
+
ephemeris: f.ephemeris,
|
|
1040
|
+
flags: ue,
|
|
1041
|
+
bracketSeconds: 1e-3,
|
|
1042
|
+
angularAllowanceArcsec: $,
|
|
1043
|
+
bounds: { timing: Q }
|
|
1044
|
+
}, A2, I2);
|
|
1045
|
+
}), S2 = { ...n2, from: a.record, to: r.record, ...s3 === 1 / 0 ? {} : { maxSamples: s3 } }, M2 = new Set(y2.flatMap((C2) => Ke(C2, "ecliptic-true-of-date", "geocentric", "apparent", Rn, f.from !== null)));
|
|
1046
|
+
return M2.add("search:scan-and-bisect"), M2.add(m ? "event:moon-minus-sun" : "event:station-central-difference-1h"), {
|
|
1047
|
+
status: "ok",
|
|
1048
|
+
events: v2,
|
|
1049
|
+
samples: g3.samples,
|
|
1050
|
+
ephemeris: f.ephemeris,
|
|
1051
|
+
flags: [...d3],
|
|
1052
|
+
receipt: Ce(S2, [Y(o2), Y(l)], [...M2], void 0, true, f.ephemeris)
|
|
1053
|
+
};
|
|
1054
|
+
}
|
|
1055
|
+
function searchStations(e2) {
|
|
1056
|
+
refuseUnderSource("@zodiacs/engine/calc");
|
|
1057
|
+
const n2 = N2(e2, "station request", ["from", "to", "body", "maxSamples"]), t2 = k(n2.body, kt, "body");
|
|
1058
|
+
return kn(e2, { body: t2 }, (a, r, s3) => ({
|
|
1059
|
+
...a,
|
|
1060
|
+
body: t2,
|
|
1061
|
+
direction: s3 ? "direct" : "retrograde",
|
|
1062
|
+
curvatureDegPerDay2: r
|
|
1063
|
+
}));
|
|
1064
|
+
}
|
|
1065
|
+
function searchLunations(e2) {
|
|
1066
|
+
refuseUnderSource("@zodiacs/engine/calc"), N2(e2, "lunation request", ["from", "to", "phaseDegrees", "maxSamples"]);
|
|
1067
|
+
const n2 = e2.phaseDegrees;
|
|
1068
|
+
if (![0, 90, 180, 270].includes(n2)) throw new RangeError("phaseDegrees must be 0, 90, 180 or 270.");
|
|
1069
|
+
return kn(e2, { phaseDegrees: n2 }, (t2, a) => ({
|
|
1070
|
+
...t2,
|
|
1071
|
+
phaseDegrees: n2,
|
|
1072
|
+
relativeSpeedDegPerDay: a
|
|
1073
|
+
}));
|
|
1074
|
+
}
|
|
1075
|
+
function $t(e2, n2) {
|
|
1076
|
+
const t2 = siderealChartOf(e2, n2), a = t2.ayanamsaValue, { elongation: r } = ayanamsaAt(n2, Fn.FromTerrestrialTime(a.julianDateTT - z));
|
|
1168
1077
|
return {
|
|
1169
|
-
ayanamsa:
|
|
1170
|
-
bodies:
|
|
1171
|
-
ascendant:
|
|
1172
|
-
midheaven:
|
|
1173
|
-
houseSystem:
|
|
1174
|
-
cusps:
|
|
1078
|
+
ayanamsa: We(n2, { mean: a.mean, nutation: a.nutation, true: a.true, elongation: r }, "true", 1),
|
|
1079
|
+
bodies: t2.bodies.map(({ body: s3, lon: o2 }) => ({ body: s3, lon: o2 })),
|
|
1080
|
+
ascendant: t2.ascendant === null ? null : t2.ascendant.lon,
|
|
1081
|
+
midheaven: t2.midheaven === null ? null : t2.midheaven.lon,
|
|
1082
|
+
houseSystem: t2.houseSystem,
|
|
1083
|
+
cusps: t2.cusps === null ? null : t2.cusps.map((s3) => s3.lon)
|
|
1175
1084
|
};
|
|
1176
1085
|
}
|
|
1177
|
-
function chart(
|
|
1086
|
+
function chart(e2) {
|
|
1178
1087
|
refuseUnderSource("@zodiacs/engine/calc");
|
|
1179
|
-
const
|
|
1180
|
-
|
|
1181
|
-
const
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
const zodiac = readZodiac(asked.zodiac);
|
|
1186
|
-
const refusal = epochRefusal(zodiac);
|
|
1187
|
-
if (refusal) return refusal;
|
|
1188
|
-
const whole = { ...time, ms: Math.round(time.ms) };
|
|
1189
|
-
return inSpan(whole, (basis) => {
|
|
1190
|
-
const utc = new Date(whole.ms);
|
|
1191
|
-
const houseSystem = settings.houseSystem ?? "whole";
|
|
1192
|
-
const timeKnown = settings.timeKnown ?? true;
|
|
1193
|
-
const possible = !timeKnown ? ["no-time"] : settings.houseSystem && isPolarUndefinedHouseSystem(houseSystem) && place ? ["polar-fallback"] : [];
|
|
1194
|
-
possible.push("delta-t-extrapolated", "de440-unavailable", "outside-de440-span");
|
|
1195
|
-
if (timeKnown && place) possible.push("polar-angles");
|
|
1196
|
-
assertDerivedFlags(supplied ?? [], possible);
|
|
1197
|
-
if ("iso" in time.record && !time.record.iso.includes("T") && settings.timeKnown !== false) {
|
|
1088
|
+
const n2 = N2(e2, "chart request", ["time", "place", "houseSystem", "timeKnown", "timeFlags", "zodiac"]), t2 = U(n2.time, "time"), a = n2.place === void 0 ? null : He(n2.place, "place"), r = a === null ? null : { latitude: a.latitude, longitude: a.longitude }, s3 = validateBirthSettings({ houseSystem: n2.houseSystem, timeKnown: n2.timeKnown }), o2 = n2.timeFlags === void 0 ? void 0 : snapshotFlags(n2.timeFlags).values, l = Ie(n2.zodiac), i2 = Pe(l);
|
|
1089
|
+
if (i2) return i2;
|
|
1090
|
+
const c2 = { ...t2, ms: Math.round(t2.ms) };
|
|
1091
|
+
return Ze(c2, (h3) => {
|
|
1092
|
+
const m = new Date(c2.ms), b3 = s3.houseSystem ?? "whole", f = s3.timeKnown ?? true, p3 = f ? s3.houseSystem && isPolarUndefinedHouseSystem(b3) && r ? ["polar-fallback"] : [] : ["no-time"];
|
|
1093
|
+
if (p3.push("delta-t-extrapolated", "de440-unavailable", "outside-de440-span"), f && r && p3.push("polar-angles"), assertDerivedFlags(o2 ?? [], p3), "iso" in t2.record && !t2.record.iso.includes("T") && s3.timeKnown !== false)
|
|
1198
1094
|
throw new RangeError(
|
|
1199
1095
|
"time is a calendar date with no time. Give the birth instant with its UTC offset, such as 1990-05-03T08:30:00+02:00, or set timeKnown: false if the birth time is not known."
|
|
1200
1096
|
);
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
...
|
|
1207
|
-
...
|
|
1208
|
-
...
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
const
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
const bands = timeBands(basis);
|
|
1216
|
-
const turned = computed.angles && place && (() => {
|
|
1217
|
-
const { input: angleInput, moved } = onInput(whole, whole.ms, (at2) => ({
|
|
1218
|
-
input: { gastHours: gastHours(at2), ...place, obliquity: tilt(at2.tt).tobl },
|
|
1219
|
-
moved: bands.tt === 0 ? null : movedOnTt(at2, place, null)
|
|
1097
|
+
const y2 = {
|
|
1098
|
+
utc: m,
|
|
1099
|
+
houseSystem: b3,
|
|
1100
|
+
timeKnown: f,
|
|
1101
|
+
...r,
|
|
1102
|
+
...o2 && { flags: timeFlags(o2) },
|
|
1103
|
+
...c2.pin === void 0 ? {} : { deltaT: c2.pin },
|
|
1104
|
+
...c2.scale === "utc" ? {} : { timeScale: c2.scale }
|
|
1105
|
+
}, T2 = Y(h3), u = computeChart(y2), E = u.ephemeris !== void 0 && u.ephemeris.name !== EPHEMERIS.name;
|
|
1106
|
+
assertDerivedFlags(o2 ?? [], u.flags);
|
|
1107
|
+
const g3 = timeBands(h3), d3 = u.angles && r && (() => {
|
|
1108
|
+
const { input: w2, moved: v2 } = Se(c2, c2.ms, (S2) => ({
|
|
1109
|
+
input: { gastHours: gastHours(S2), ...r, obliquity: tilt(S2.tt).tobl },
|
|
1110
|
+
moved: g3.tt === 0 ? null : _n(S2, r, null)
|
|
1220
1111
|
}));
|
|
1221
|
-
return
|
|
1112
|
+
return Nn(w2, "whole", g3, v2);
|
|
1222
1113
|
})();
|
|
1223
1114
|
return {
|
|
1224
1115
|
status: "ok",
|
|
1225
|
-
chart:
|
|
1226
|
-
sidereal:
|
|
1116
|
+
chart: u,
|
|
1117
|
+
sidereal: l.definition && $t(u, l.definition),
|
|
1227
1118
|
band: {
|
|
1228
|
-
time:
|
|
1229
|
-
bodies:
|
|
1230
|
-
asc:
|
|
1231
|
-
mc:
|
|
1119
|
+
time: g3,
|
|
1120
|
+
bodies: u.bodies.map(({ body: w2, speed: v2 }) => ({ body: w2, lon: Math.abs(v2) / 24 * g3.tt })),
|
|
1121
|
+
asc: d3 ? d3.asc : null,
|
|
1122
|
+
mc: d3 ? d3.mc : null
|
|
1232
1123
|
},
|
|
1233
|
-
receipt:
|
|
1124
|
+
receipt: Ce(
|
|
1234
1125
|
{
|
|
1235
|
-
time:
|
|
1236
|
-
...
|
|
1237
|
-
houseSystem,
|
|
1238
|
-
timeKnown,
|
|
1239
|
-
...
|
|
1240
|
-
zodiac:
|
|
1126
|
+
time: t2.record,
|
|
1127
|
+
...r && { place: r },
|
|
1128
|
+
houseSystem: b3,
|
|
1129
|
+
timeKnown: f,
|
|
1130
|
+
...o2 && { timeFlags: o2 },
|
|
1131
|
+
zodiac: l.record
|
|
1241
1132
|
},
|
|
1242
|
-
[
|
|
1133
|
+
[T2],
|
|
1243
1134
|
[
|
|
1244
|
-
...
|
|
1135
|
+
...l.ids,
|
|
1245
1136
|
"frame:ecliptic-true-of-date",
|
|
1246
1137
|
"center:geocentric",
|
|
1247
1138
|
"correction:apparent",
|
|
1248
|
-
...
|
|
1139
|
+
...E ? ["light-time:iterated", "deflection:sun-outside-disc", "aberration:relativistic-annual", "target:system-barycentre", "node:true-osculating", ...Je, "precession:iau2006"] : [
|
|
1249
1140
|
"light-time:newtonian",
|
|
1250
1141
|
"deflection:none",
|
|
1251
1142
|
"aberration:backdated-observer",
|
|
@@ -1255,19 +1146,19 @@ function chart(request) {
|
|
|
1255
1146
|
],
|
|
1256
1147
|
"nutation:iau2000b",
|
|
1257
1148
|
"obliquity:iau2006",
|
|
1258
|
-
...
|
|
1259
|
-
`house:${
|
|
1260
|
-
...
|
|
1149
|
+
...u.houses === null ? [] : [
|
|
1150
|
+
`house:${b3}`,
|
|
1151
|
+
...u.houses.system === b3 ? [] : ["polar-fallback:whole"],
|
|
1261
1152
|
"angles:gast-and-true-obliquity",
|
|
1262
1153
|
"sidereal-time:gast-iau2006-era"
|
|
1263
1154
|
],
|
|
1264
1155
|
"aspects:major",
|
|
1265
|
-
`speed:central-difference-${
|
|
1266
|
-
`speed:central-difference-${
|
|
1156
|
+
`speed:central-difference-${En}d`,
|
|
1157
|
+
`speed:central-difference-${An}d`
|
|
1267
1158
|
],
|
|
1268
|
-
|
|
1159
|
+
t2.pin,
|
|
1269
1160
|
true,
|
|
1270
|
-
|
|
1161
|
+
u.ephemeris
|
|
1271
1162
|
)
|
|
1272
1163
|
};
|
|
1273
1164
|
});
|
|
@@ -1281,5 +1172,7 @@ export {
|
|
|
1281
1172
|
calc,
|
|
1282
1173
|
chart,
|
|
1283
1174
|
events,
|
|
1284
|
-
houses
|
|
1175
|
+
houses,
|
|
1176
|
+
searchLunations,
|
|
1177
|
+
searchStations
|
|
1285
1178
|
};
|