@zodiacs/engine 0.1.1-rc.15 → 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.
- package/CHANGELOG.md +891 -0
- package/LICENSING.md +192 -12
- package/NOTICE +96 -2
- package/README.md +296 -66
- package/dist/{api-CoB_kqE3.d.ts → api-WbxJ4Wj-.d.ts} +15 -10
- package/dist/ayanamsa--YQ46fET.d.ts +134 -0
- package/dist/calc.d.ts +390 -0
- package/dist/calc.js +1039 -0
- package/dist/chunk-47ERTK5X.js +27 -0
- package/dist/chunk-7TRLIFFI.js +56 -0
- package/dist/chunk-A3U2ZS2W.js +29 -0
- package/dist/{chunk-KHBLFXFG.js → chunk-B5LKF437.js} +29 -28
- package/dist/{chunk-ONBZ4HK7.js → chunk-BHJXUY67.js} +4 -2
- package/dist/{chunk-OYGRVGXD.js → chunk-CHSYDKBL.js} +3 -3
- package/dist/{chunk-ZHVI3KWJ.js → chunk-DMGHYCDI.js} +4 -4
- package/dist/{chunk-CWI4YUDL.js → chunk-FTX3JDJA.js} +21 -18
- package/dist/{chunk-MFF3VKO3.js → chunk-OG4OYTJJ.js} +47 -42
- package/dist/{chunk-ZZPITHQS.js → chunk-SRXBTP5H.js} +199 -65
- package/dist/{chunk-AECKV73C.js → chunk-TSS2SZWQ.js} +8 -2
- package/dist/chunk-WS3TDSP3.js +474 -0
- package/dist/chunk-YIITY7Q7.js +483 -0
- package/dist/crossings.d.ts +8 -7
- package/dist/crossings.js +1 -1
- package/dist/deltat.d.ts +28 -3
- package/dist/deltat.js +1 -1
- package/dist/geo.d.ts +33 -12
- package/dist/geo.js +17 -458
- package/dist/{internal-math-BbktkHCc.d.ts → houses-CFERsAlK.d.ts} +14 -160
- package/dist/houses-extra.d.ts +95 -0
- package/dist/houses-extra.js +339 -0
- package/dist/index.d.ts +34 -48
- package/dist/index.js +31 -23
- package/dist/internal-math-DJJ8BYex.d.ts +174 -0
- package/dist/internal-math.d.ts +3 -2
- package/dist/internal-math.js +2 -2
- package/dist/internal.d.ts +1 -1
- package/dist/internal.js +5 -5
- package/dist/receipt.d.ts +2 -243
- package/dist/receipt.js +78 -37
- package/dist/reference-span-CILpclrz.d.ts +40 -0
- package/dist/rulers-Dla6h_Sm.d.ts +15 -0
- package/dist/sky.d.ts +173 -0
- package/dist/sky.js +379 -0
- package/dist/techniques.d.ts +453 -0
- package/dist/techniques.js +823 -0
- package/dist/timing.d.ts +113 -17
- package/dist/timing.js +98 -64
- package/dist/{types-BsWaqwU_.d.ts → types-B-yb_tGL.d.ts} +23 -11
- package/dist/vedic.d.ts +42 -124
- package/dist/vedic.js +44 -458
- package/dist/window.d.ts +180 -0
- package/dist/window.js +960 -0
- package/dist/zone-history-ghdyO0Sc.d.ts +268 -0
- package/package.json +25 -3
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
computeAngles,
|
|
3
|
-
computeHouses,
|
|
4
|
-
eastPointOf,
|
|
5
|
-
vertexOf
|
|
6
|
-
} from "./chunk-ZHVI3KWJ.js";
|
|
7
1
|
import {
|
|
8
2
|
EPHEMERIS_SPAN,
|
|
9
3
|
elapsedDays,
|
|
10
4
|
outsideReferenceSpan,
|
|
11
5
|
timeBasis
|
|
12
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-B5LKF437.js";
|
|
13
7
|
import {
|
|
14
8
|
deltaT
|
|
15
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-BHJXUY67.js";
|
|
10
|
+
import {
|
|
11
|
+
computeAngles,
|
|
12
|
+
computeHouses,
|
|
13
|
+
eastPointOf,
|
|
14
|
+
meanObliquity,
|
|
15
|
+
vertexOf
|
|
16
|
+
} from "./chunk-DMGHYCDI.js";
|
|
16
17
|
import {
|
|
17
18
|
ENGINE_VERSION,
|
|
18
19
|
degreeInSign,
|
|
19
20
|
findAspects,
|
|
20
21
|
normalizeLongitude,
|
|
21
22
|
signForLongitude
|
|
22
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-OG4OYTJJ.js";
|
|
23
24
|
|
|
24
25
|
// src/body-label.ts
|
|
25
26
|
var MAX_BODY_LABEL_LENGTH = 80;
|
|
@@ -114,7 +115,7 @@ var DEG = Math.PI / 180;
|
|
|
114
115
|
var RAD = 180 / Math.PI;
|
|
115
116
|
var DECLINATION_ORB = 1;
|
|
116
117
|
var DECLINATION_ORB_LUMINARY = 1.5;
|
|
117
|
-
var DEFAULT_DECLINATION_ORB_POLICY = Object.freeze({
|
|
118
|
+
var DEFAULT_DECLINATION_ORB_POLICY = /* @__PURE__ */ Object.freeze({
|
|
118
119
|
orb: DECLINATION_ORB,
|
|
119
120
|
luminaryOrb: DECLINATION_ORB_LUMINARY
|
|
120
121
|
});
|
|
@@ -167,11 +168,11 @@ function eclipticToEquatorial(longitudeDeg, latitudeDeg, trueObliquityDeg) {
|
|
|
167
168
|
obliquity(trueObliquityDeg);
|
|
168
169
|
const lon = normalize(longitudeDeg) * DEG;
|
|
169
170
|
const lat = latitudeDeg * DEG;
|
|
170
|
-
const
|
|
171
|
+
const tilt2 = trueObliquityDeg * DEG;
|
|
171
172
|
const cosLat = Math.cos(lat);
|
|
172
173
|
const x = cosLat * Math.cos(lon);
|
|
173
|
-
const y = cosLat * Math.sin(lon) * Math.cos(
|
|
174
|
-
const z = cosLat * Math.sin(lon) * Math.sin(
|
|
174
|
+
const y = cosLat * Math.sin(lon) * Math.cos(tilt2) - Math.sin(lat) * Math.sin(tilt2);
|
|
175
|
+
const z = cosLat * Math.sin(lon) * Math.sin(tilt2) + Math.sin(lat) * Math.cos(tilt2);
|
|
175
176
|
const horizontal = Math.hypot(x, y);
|
|
176
177
|
const raDefined = horizontal > RA_POLE_TOLERANCE;
|
|
177
178
|
let dec = trueObliquityDeg === 0 ? latitudeDeg : Math.atan2(z, horizontal) * RAD;
|
|
@@ -283,32 +284,178 @@ function chartBodyDeclinations(bodies, trueObliquity) {
|
|
|
283
284
|
return declinations(bodies, trueObliquity, DEFAULT_DECLINATION_ORB_POLICY, true);
|
|
284
285
|
}
|
|
285
286
|
|
|
286
|
-
// src/
|
|
287
|
+
// src/nutation.ts
|
|
287
288
|
var DEG2 = Math.PI / 180;
|
|
289
|
+
var ARCSEC = DEG2 / 3600;
|
|
290
|
+
var ARGUMENTS = [
|
|
291
|
+
485868.249036,
|
|
292
|
+
17179159232178e-4,
|
|
293
|
+
128710479305e-5,
|
|
294
|
+
1295965810481e-4,
|
|
295
|
+
335779.526232,
|
|
296
|
+
17395272628478e-4,
|
|
297
|
+
107226070369e-5,
|
|
298
|
+
1602961601209e-3,
|
|
299
|
+
450160.398036,
|
|
300
|
+
-69628905431e-4
|
|
301
|
+
];
|
|
302
|
+
var MULTIPLIERS = "2222322404224242222423222234043222222423324242140422403124241224232223122231244432423024232224222444204040224242424324041242342222224222322312243244042204232203212231244324222324440242223424224432142422243324034240402243424232140322203112424220332242234033122202424524242124231424222321144412422214440222333424422231323233222324221240332224122322243412464132332040332443024441222433404";
|
|
303
|
+
var COEFFICIENT_TEXT = "-172064161,-174666,33386,92052331,9086,15377,-13170906,-1675,-13696,5730336,-3015,-4587,-2276413,-234,2796,978459,-485,1374,2074554,207,-698,-897492,470,-291,1475877,-3633,11817,73871,-184,-1924,-516821,1226,-524,224386,-677,-174,711159,73,-872,-6750,0,358,-387298,-367,380,200728,18,318,-301461,-36,816,129025,-63,367,215829,-494,111,-95929,299,132,128227,137,181,-68982,-9,39,123457,11,19,-53311,32,-4,156994,10,-168,-1235,0,82,63110,63,27,-33228,0,-9,-57976,-63,-189,31429,0,-75,-59641,-11,149,25543,-11,66,-51613,-42,129,26366,0,78,45893,50,31,-24236,-10,20,63384,11,-150,-1220,0,29,-38571,-1,158,16452,-11,68,32481,0,0,-13870,0,0,-47722,0,-18,477,0,-25,-31046,-1,131,13238,-11,59,28593,0,-1,-12338,10,-3,20441,21,10,-10758,0,-3,29243,0,-74,-609,0,13,25887,0,-66,-550,0,11,-14053,-25,79,8551,-2,-45,15164,10,11,-8001,0,-1,-15794,72,-16,6850,-42,-5,21783,0,13,-167,0,13,-12873,-10,-37,6953,0,-14,-12654,11,63,6415,0,26,-10204,0,25,5222,0,15,16707,-85,-10,168,-1,10,-7691,0,44,3268,0,19,-11024,0,-14,104,0,2,7566,-21,-11,-3250,0,-5,-6637,-11,25,3353,0,14,-7141,21,8,3070,0,4,-6302,-11,2,3272,0,4,5800,10,2,-3045,0,-1,6443,0,-7,-2768,0,-4,-5774,-11,-15,3041,0,-5,-5350,0,21,2695,0,12,-4752,-11,-3,2719,0,-3,-4940,-11,-21,2720,0,-9,7350,0,-8,-51,0,4,4065,0,6,-2206,0,1,6579,0,-24,-199,0,2,3579,0,5,-1900,0,1,4725,0,-6,-41,0,3,-3075,0,-2,1313,0,-1,-2904,0,15,1233,0,7,4348,0,-10,-81,0,2,-2878,0,8,1232,0,4,-4230,0,5,-20,0,-2,-2819,0,7,1207,0,3,-4056,0,5,40,0,-2,-2647,0,11,1129,0,5,-2294,0,-10,1266,0,-4,2481,0,-7,-1062,0,-3,2179,0,-2,-1129,0,-2,3276,0,1,-9,0,0,-3389,0,5,35,0,-2,3339,0,-13,-107,0,1,-1987,0,-6,1073,0,-2,-1981,0,0,854,0,0,4026,0,-353,-553,0,-139,1660,0,-5,-710,0,-2,-1521,0,9,647,0,4,1314,0,0,-700,0,0,-1283,0,0,672,0,0,-1331,0,8,663,0,4,1383,0,-2,-594,0,-2,1405,0,4,-610,0,2,1290,0,0,-556,0,0";
|
|
304
|
+
var coefficientValues;
|
|
305
|
+
function coefficients() {
|
|
306
|
+
return coefficientValues ??= COEFFICIENT_TEXT.split(",").map(Number);
|
|
307
|
+
}
|
|
308
|
+
var OFFSETS = [-135e-6, 388e-6];
|
|
309
|
+
var NUTATION_TERMS = 77;
|
|
310
|
+
function nutation(t, terms = NUTATION_TERMS) {
|
|
311
|
+
const c = coefficients();
|
|
312
|
+
const re = [];
|
|
313
|
+
const im = [];
|
|
314
|
+
let om = 0;
|
|
315
|
+
for (let j = 0; j < 5; j += 1) {
|
|
316
|
+
const f = (ARGUMENTS[2 * j] + t * ARGUMENTS[2 * j + 1]) % 1296e3 * ARCSEC;
|
|
317
|
+
const cos = Math.cos(f);
|
|
318
|
+
const sin = Math.sin(f);
|
|
319
|
+
const o = 7 * j;
|
|
320
|
+
re[o + 1] = cos;
|
|
321
|
+
im[o + 1] = -sin;
|
|
322
|
+
re[o + 2] = 1;
|
|
323
|
+
im[o + 2] = 0;
|
|
324
|
+
for (let k = o + 3; k < o + 7; k += 1) {
|
|
325
|
+
re[k] = re[k - 1] * cos - im[k - 1] * sin;
|
|
326
|
+
im[k] = re[k - 1] * sin + im[k - 1] * cos;
|
|
327
|
+
}
|
|
328
|
+
re[o] = re[o + 4];
|
|
329
|
+
im[o] = -im[o + 4];
|
|
330
|
+
om = f;
|
|
331
|
+
}
|
|
332
|
+
let dp = 0;
|
|
333
|
+
let de = 0;
|
|
334
|
+
for (let i = terms - 1; i >= 0; i -= 1) {
|
|
335
|
+
let cos = 1;
|
|
336
|
+
let sin = 0;
|
|
337
|
+
for (let j = 0; j < 5; j += 1) {
|
|
338
|
+
const k2 = 7 * j + MULTIPLIERS.charCodeAt(5 * i + j) - 48;
|
|
339
|
+
const next = cos * re[k2] - sin * im[k2];
|
|
340
|
+
sin = cos * im[k2] + sin * re[k2];
|
|
341
|
+
cos = next;
|
|
342
|
+
}
|
|
343
|
+
const k = 6 * i;
|
|
344
|
+
dp += (c[k] + c[k + 1] * t) * sin + c[k + 2] * cos;
|
|
345
|
+
de += (c[k + 3] + c[k + 4] * t) * cos + c[k + 5] * sin;
|
|
346
|
+
}
|
|
347
|
+
return { dpsi: dp * 1e-7 + OFFSETS[0], deps: de * 1e-7 + OFFSETS[1], om };
|
|
348
|
+
}
|
|
349
|
+
function tilt(tt) {
|
|
350
|
+
const t = tt / 36525;
|
|
351
|
+
const { dpsi, deps, om } = nutation(t);
|
|
352
|
+
const mobl = meanObliquity(t);
|
|
353
|
+
return {
|
|
354
|
+
dpsi,
|
|
355
|
+
deps,
|
|
356
|
+
mobl,
|
|
357
|
+
tobl: mobl + deps / 3600,
|
|
358
|
+
ee: dpsi * Math.cos(mobl * DEG2) + 264096e-8 * Math.sin(om) + 6352e-8 * Math.sin(2 * om)
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
// src/frame.ts
|
|
363
|
+
var DEG3 = Math.PI / 180;
|
|
364
|
+
var ASEC2RAD = DEG3 / 3600;
|
|
288
365
|
var RAD2 = 180 / Math.PI;
|
|
289
|
-
var
|
|
366
|
+
var last;
|
|
367
|
+
function eclipticFrame(tt) {
|
|
368
|
+
if (last !== void 0 && last.tt === tt) return last;
|
|
369
|
+
const t = tt / 36525;
|
|
370
|
+
let eps0 = 84381.406;
|
|
371
|
+
let psia = ((((-951e-10 * t + 132851e-9) * t - 114045e-8) * t - 1.0790069) * t + 5038.481507) * t;
|
|
372
|
+
let omegaa = ((((3337e-10 * t - 467e-9) * t - 772503e-8) * t + 0.0512623) * t - 0.025754) * t + eps0;
|
|
373
|
+
let chia = ((((-56e-9 * t + 170663e-9) * t - 121197e-8) * t - 2.3814292) * t + 10.556403) * t;
|
|
374
|
+
eps0 *= ASEC2RAD;
|
|
375
|
+
psia *= ASEC2RAD;
|
|
376
|
+
omegaa *= ASEC2RAD;
|
|
377
|
+
chia *= ASEC2RAD;
|
|
378
|
+
const sa = Math.sin(eps0);
|
|
379
|
+
const ca = Math.cos(eps0);
|
|
380
|
+
const sb = Math.sin(-psia);
|
|
381
|
+
const cb = Math.cos(-psia);
|
|
382
|
+
const sc = Math.sin(-omegaa);
|
|
383
|
+
const cc = Math.cos(-omegaa);
|
|
384
|
+
const sd = Math.sin(chia);
|
|
385
|
+
const cd = Math.cos(chia);
|
|
386
|
+
const xx = cd * cb - sb * sd * cc;
|
|
387
|
+
const yx = cd * sb * ca + sd * cc * cb * ca - sa * sd * sc;
|
|
388
|
+
const zx = cd * sb * sa + sd * cc * cb * sa + ca * sd * sc;
|
|
389
|
+
const xy = -sd * cb - sb * cd * cc;
|
|
390
|
+
const yy = -sd * sb * ca + cd * cc * cb * ca - sa * cd * sc;
|
|
391
|
+
const zy = -sd * sb * sa + cd * cc * cb * sa + ca * cd * sc;
|
|
392
|
+
const xz = sb * sc;
|
|
393
|
+
const yz = -sc * cb * ca - sa * cc;
|
|
394
|
+
const zz = -sc * cb * sa + cc * ca;
|
|
395
|
+
const at = tilt(tt);
|
|
396
|
+
const e = at.mobl * DEG3;
|
|
397
|
+
const ce = Math.cos(e);
|
|
398
|
+
const se = Math.sin(e);
|
|
399
|
+
last = {
|
|
400
|
+
tt,
|
|
401
|
+
rows: [
|
|
402
|
+
xx,
|
|
403
|
+
yx,
|
|
404
|
+
zx,
|
|
405
|
+
ce * xy + se * xz,
|
|
406
|
+
ce * yy + se * yz,
|
|
407
|
+
ce * zy + se * zz,
|
|
408
|
+
ce * xz - se * xy,
|
|
409
|
+
ce * yz - se * yy,
|
|
410
|
+
ce * zz - se * zy
|
|
411
|
+
],
|
|
412
|
+
tilt: at
|
|
413
|
+
};
|
|
414
|
+
return last;
|
|
415
|
+
}
|
|
416
|
+
function meanEcliptic(frame, x, y, z) {
|
|
417
|
+
const m = frame.rows;
|
|
418
|
+
return [
|
|
419
|
+
m[0] * x + m[1] * y + m[2] * z,
|
|
420
|
+
m[3] * x + m[4] * y + m[5] * z,
|
|
421
|
+
m[6] * x + m[7] * y + m[8] * z
|
|
422
|
+
];
|
|
423
|
+
}
|
|
424
|
+
function eclipticOfDate(x, y, z, tt) {
|
|
425
|
+
const frame = eclipticFrame(tt);
|
|
426
|
+
const [ex, ey, ez] = meanEcliptic(frame, x, y, z);
|
|
427
|
+
return {
|
|
428
|
+
lon: normalizeLongitude(Math.atan2(ey, ex) * RAD2 + frame.tilt.dpsi / 3600),
|
|
429
|
+
lat: Math.asin(ez / Math.hypot(ex, ey, ez)) * RAD2
|
|
430
|
+
};
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
// src/points.ts
|
|
434
|
+
var DEG4 = Math.PI / 180;
|
|
435
|
+
var RAD3 = 180 / Math.PI;
|
|
436
|
+
var ARCSEC2 = 1 / 3600;
|
|
290
437
|
function lunarMeanArguments(centuries) {
|
|
291
438
|
const t = centuries;
|
|
292
439
|
const l = 485868.249036 + t * (17179159232178e-4 + t * (31.8792 + t * (0.051635 + t * -2447e-7)));
|
|
293
440
|
const F = 335779.526232 + t * (17395272628478e-4 + t * (-12.7512 + t * (-1037e-6 + t * 417e-8)));
|
|
294
441
|
const node = 450160.398036 + t * (-69628905431e-4 + t * (7.4722 + t * (7702e-6 + t * -5939e-8)));
|
|
295
|
-
return { l: l *
|
|
442
|
+
return { l: l * ARCSEC2, F: F * ARCSEC2, node: node * ARCSEC2 };
|
|
296
443
|
}
|
|
297
444
|
var MEAN_LUNAR_INCLINATION = 5.1453964;
|
|
298
|
-
function meanNodeLongitude(centuries,
|
|
299
|
-
return normalizeLongitude(lunarMeanArguments(centuries).node +
|
|
445
|
+
function meanNodeLongitude(centuries, nutation2) {
|
|
446
|
+
return normalizeLongitude(lunarMeanArguments(centuries).node + nutation2);
|
|
300
447
|
}
|
|
301
|
-
function meanApogee(centuries,
|
|
448
|
+
function meanApogee(centuries, nutation2) {
|
|
302
449
|
const { l, F, node } = lunarMeanArguments(centuries);
|
|
303
|
-
const u = (F - l + 180) *
|
|
304
|
-
const i = MEAN_LUNAR_INCLINATION *
|
|
305
|
-
const lon = node + Math.atan2(Math.cos(i) * Math.sin(u), Math.cos(u)) *
|
|
306
|
-
return { lon: normalizeLongitude(lon), lat: Math.asin(Math.sin(i) * Math.sin(u)) *
|
|
450
|
+
const u = (F - l + 180) * DEG4;
|
|
451
|
+
const i = MEAN_LUNAR_INCLINATION * DEG4;
|
|
452
|
+
const lon = node + Math.atan2(Math.cos(i) * Math.sin(u), Math.cos(u)) * RAD3 + nutation2;
|
|
453
|
+
return { lon: normalizeLongitude(lon), lat: Math.asin(Math.sin(i) * Math.sin(u)) * RAD3 };
|
|
307
454
|
}
|
|
308
455
|
function sectOf(ascendant, sun) {
|
|
309
456
|
return normalizeLongitude(sun - ascendant) >= 180 ? "day" : "night";
|
|
310
457
|
}
|
|
311
|
-
var LOTS = [
|
|
458
|
+
var LOTS = /* @__PURE__ */ Object.freeze([
|
|
312
459
|
"Lot of Fortune",
|
|
313
460
|
"Lot of Spirit",
|
|
314
461
|
"Lot of Eros",
|
|
@@ -316,7 +463,7 @@ var LOTS = [
|
|
|
316
463
|
"Lot of Courage",
|
|
317
464
|
"Lot of Victory",
|
|
318
465
|
"Lot of Nemesis"
|
|
319
|
-
];
|
|
466
|
+
]);
|
|
320
467
|
function hellenisticLots(inputs, sect) {
|
|
321
468
|
const lot = (from, to) => normalizeLongitude(inputs.ascendant + (sect === "day" ? to - from : from - to));
|
|
322
469
|
const fortune = lot(inputs.sun, inputs.moon);
|
|
@@ -345,17 +492,13 @@ function midpoint(first, second) {
|
|
|
345
492
|
// src/ephemeris.ts
|
|
346
493
|
import {
|
|
347
494
|
Body,
|
|
348
|
-
|
|
495
|
+
GeoMoon,
|
|
349
496
|
GeoMoonState,
|
|
350
497
|
GeoVector,
|
|
351
498
|
MakeTime,
|
|
352
|
-
|
|
353
|
-
Rotation_EQJ_ECT,
|
|
354
|
-
SetDeltaTFunction,
|
|
355
|
-
Vector,
|
|
356
|
-
e_tilt
|
|
499
|
+
SetDeltaTFunction
|
|
357
500
|
} from "astronomy-engine";
|
|
358
|
-
var
|
|
501
|
+
var RAD4 = 180 / Math.PI;
|
|
359
502
|
var DAY = 864e5;
|
|
360
503
|
var UTC_CLOCK = { scale: "utc", pin: void 0 };
|
|
361
504
|
function timeOf(basis) {
|
|
@@ -386,7 +529,7 @@ function evaluated(run) {
|
|
|
386
529
|
}
|
|
387
530
|
function gastHours(time) {
|
|
388
531
|
const t = time.tt / 36525;
|
|
389
|
-
const eqeq =
|
|
532
|
+
const eqeq = tilt(time.tt).ee;
|
|
390
533
|
const thet1 = 0.779057273264 + 0.00273781191135448 * time.ut;
|
|
391
534
|
const thet3 = time.ut % 1;
|
|
392
535
|
let theta = 360 * ((thet1 + thet3) % 1);
|
|
@@ -396,14 +539,6 @@ function gastHours(time) {
|
|
|
396
539
|
if (gst < 0) gst += 24;
|
|
397
540
|
return gst;
|
|
398
541
|
}
|
|
399
|
-
function onEngineClock(seconds, fn) {
|
|
400
|
-
SetDeltaTFunction(() => seconds);
|
|
401
|
-
try {
|
|
402
|
-
return fn();
|
|
403
|
-
} finally {
|
|
404
|
-
SetDeltaTFunction(deltaT);
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
542
|
function onChartClock(ms, scale, pin, fn) {
|
|
408
543
|
return evaluated(() => {
|
|
409
544
|
const basis = timeBasis(ms, scale, pin);
|
|
@@ -421,29 +556,24 @@ var PLANETS = [
|
|
|
421
556
|
{ name: "Neptune", body: Body.Neptune },
|
|
422
557
|
{ name: "Pluto", body: Body.Pluto }
|
|
423
558
|
];
|
|
424
|
-
function
|
|
559
|
+
function planetOfDate(body, time) {
|
|
425
560
|
const equatorial = GeoVector(body, time, true);
|
|
426
|
-
|
|
427
|
-
const lon = normalizeLongitude(Math.atan2(ecliptic.y, ecliptic.x) * RAD3);
|
|
428
|
-
const lat = Math.asin(ecliptic.z / Math.hypot(ecliptic.x, ecliptic.y, ecliptic.z)) * RAD3;
|
|
429
|
-
return { lon, lat };
|
|
561
|
+
return eclipticOfDate(equatorial.x, equatorial.y, equatorial.z, time.tt);
|
|
430
562
|
}
|
|
431
563
|
function moonOfDate(time) {
|
|
432
|
-
const
|
|
433
|
-
return
|
|
564
|
+
const equatorial = GeoMoon(time);
|
|
565
|
+
return eclipticOfDate(equatorial.x, equatorial.y, equatorial.z, time.tt);
|
|
434
566
|
}
|
|
435
567
|
function trueNodeLongitude(time) {
|
|
436
568
|
const state = GeoMoonState(time);
|
|
437
|
-
const
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
Rotation_EQJ_ECT(time),
|
|
444
|
-
new Vector(angularMomentum.x, angularMomentum.y, angularMomentum.z, time)
|
|
569
|
+
const frame = eclipticFrame(time.tt);
|
|
570
|
+
const [x, y] = meanEcliptic(
|
|
571
|
+
frame,
|
|
572
|
+
state.y * state.vz - state.z * state.vy,
|
|
573
|
+
state.z * state.vx - state.x * state.vz,
|
|
574
|
+
state.x * state.vy - state.y * state.vx
|
|
445
575
|
);
|
|
446
|
-
return normalizeLongitude(Math.atan2(
|
|
576
|
+
return normalizeLongitude(Math.atan2(x, -y) * RAD4 + frame.tilt.dpsi / 3600);
|
|
447
577
|
}
|
|
448
578
|
function longitudeAt(body, ms, clock) {
|
|
449
579
|
return longitudeOn(body, basisAt(ms, clock));
|
|
@@ -457,7 +587,7 @@ function longitudeOn(body, basis) {
|
|
|
457
587
|
}
|
|
458
588
|
const planet = PLANETS.find((candidate) => candidate.name === body);
|
|
459
589
|
if (!planet) throw new RangeError(`Unknown body: ${body}`);
|
|
460
|
-
return
|
|
590
|
+
return planetOfDate(planet.body, time).lon;
|
|
461
591
|
}
|
|
462
592
|
function bodyLongitude(body, date) {
|
|
463
593
|
return evaluated(() => longitudeAt(body, date.getTime(), UTC_CLOCK));
|
|
@@ -497,7 +627,7 @@ function computeBodies(date) {
|
|
|
497
627
|
function bodiesAt(ms, clock) {
|
|
498
628
|
const bodies = [];
|
|
499
629
|
for (const planet of PLANETS) {
|
|
500
|
-
const coordinates =
|
|
630
|
+
const coordinates = planetOfDate(planet.body, timeAt(ms, clock));
|
|
501
631
|
bodies.push(
|
|
502
632
|
position(planet.name, coordinates.lon, coordinates.lat, speedAt(planet.name, ms, clock))
|
|
503
633
|
);
|
|
@@ -533,7 +663,7 @@ function chartAt(input) {
|
|
|
533
663
|
gastHours: gastHours(time),
|
|
534
664
|
latitude: input.latitude,
|
|
535
665
|
longitude: input.longitude,
|
|
536
|
-
obliquity:
|
|
666
|
+
obliquity: tilt(time.tt).tobl
|
|
537
667
|
};
|
|
538
668
|
angles = computeAngles(angleInput);
|
|
539
669
|
const result = computeHouses(input.houseSystem, angleInput, angles);
|
|
@@ -558,8 +688,8 @@ function chartAt(input) {
|
|
|
558
688
|
function meanLunarPoints(basis) {
|
|
559
689
|
const time = timeOf(basis);
|
|
560
690
|
const centuries = time.tt / 36525;
|
|
561
|
-
const
|
|
562
|
-
return { node: meanNodeLongitude(centuries,
|
|
691
|
+
const nutation2 = tilt(time.tt).dpsi / 3600;
|
|
692
|
+
return { node: meanNodeLongitude(centuries, nutation2), apogee: meanApogee(centuries, nutation2) };
|
|
563
693
|
}
|
|
564
694
|
function pointPosition(point, lon, lat, speed) {
|
|
565
695
|
const longitude = normalizeLongitude(lon);
|
|
@@ -591,7 +721,7 @@ function computeChartDeclinations(chart) {
|
|
|
591
721
|
return evaluated(() => {
|
|
592
722
|
const basis = timeBasis(date.getTime(), scale, pin);
|
|
593
723
|
return {
|
|
594
|
-
...chartBodyDeclinations(bodies,
|
|
724
|
+
...chartBodyDeclinations(bodies, tilt(timeOf(basis).tt).tobl),
|
|
595
725
|
utc: date.toISOString(),
|
|
596
726
|
deltaT: basis.deltaT
|
|
597
727
|
};
|
|
@@ -617,7 +747,7 @@ function pointsAt(chart) {
|
|
|
617
747
|
gastHours: gastHours(time),
|
|
618
748
|
latitude,
|
|
619
749
|
longitude,
|
|
620
|
-
obliquity:
|
|
750
|
+
obliquity: tilt(time.tt).tobl
|
|
621
751
|
};
|
|
622
752
|
points.push(
|
|
623
753
|
pointPosition("Vertex", vertexOf(angleInput, computeAngles(angleInput)), 0, null),
|
|
@@ -664,6 +794,10 @@ export {
|
|
|
664
794
|
declinationOrb,
|
|
665
795
|
findDeclinationAspects,
|
|
666
796
|
declinationsForBodies,
|
|
797
|
+
tilt,
|
|
798
|
+
eclipticFrame,
|
|
799
|
+
meanEcliptic,
|
|
800
|
+
eclipticOfDate,
|
|
667
801
|
lunarMeanArguments,
|
|
668
802
|
MEAN_LUNAR_INCLINATION,
|
|
669
803
|
meanNodeLongitude,
|
|
@@ -674,7 +808,7 @@ export {
|
|
|
674
808
|
antiscion,
|
|
675
809
|
contraAntiscion,
|
|
676
810
|
midpoint,
|
|
677
|
-
|
|
811
|
+
gastHours,
|
|
678
812
|
onChartClock,
|
|
679
813
|
bodyLongitude,
|
|
680
814
|
SPEED_STEP_DAYS,
|
|
@@ -216,8 +216,14 @@ function findLongitudeCrossingsWith(longitudeAt, body, targetLongitude, from, to
|
|
|
216
216
|
return result.crossings;
|
|
217
217
|
}
|
|
218
218
|
function searchLongitudeCrossingsWith(longitudeAt, body, targetLongitude, from, to, options = {}) {
|
|
219
|
-
|
|
220
|
-
|
|
219
|
+
const prototype = options !== null && typeof options === "object" ? Object.getPrototypeOf(options) : void 0;
|
|
220
|
+
if (prototype !== Object.prototype && prototype !== null) {
|
|
221
|
+
throw new RangeError("Crossing search options must be a plain options object.");
|
|
222
|
+
}
|
|
223
|
+
for (const key of Reflect.ownKeys(options)) {
|
|
224
|
+
if (key !== "stepDays" && key !== "maxSamples") throw new RangeError(`Crossing search options has an unknown option: ${String(key)}.`);
|
|
225
|
+
const slot = Object.getOwnPropertyDescriptor(options, key);
|
|
226
|
+
if (!slot || !("value" in slot) || !slot.enumerable) throw new RangeError("Crossing search options must contain only plain data properties.");
|
|
221
227
|
}
|
|
222
228
|
const stepDays = options.stepDays === void 0 ? 5 : options.stepDays;
|
|
223
229
|
const window = validWindow(targetLongitude, from, to, stepDays);
|