@zodiacs/engine 0.1.1-rc.14 → 0.1.1-rc.16
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 +797 -6
- package/LICENSING.md +354 -21
- package/NOTICE +166 -9
- package/README.md +327 -84
- package/dist/api-VOW6Umy5.d.ts +197 -0
- package/dist/calc.d.ts +279 -0
- package/dist/calc.js +853 -0
- package/dist/{chunk-NAJ735VN.js → chunk-2OWGBT3O.js} +1 -1
- package/dist/{chunk-4OSOCZY2.js → chunk-4NV4ZEFZ.js} +21 -6
- package/dist/chunk-A3U2ZS2W.js +29 -0
- package/dist/chunk-I7O5EGFV.js +25 -0
- package/dist/chunk-KFTJMMG7.js +61 -0
- package/dist/chunk-KHBLFXFG.js +227 -0
- package/dist/chunk-L6ZHWJZ6.js +355 -0
- package/dist/chunk-N4B5JNMA.js +473 -0
- package/dist/chunk-O3NJRGJ2.js +56 -0
- package/dist/{chunk-RETEVD4F.js → chunk-WOU7JVD3.js} +293 -154
- package/dist/crossings.d.ts +1 -1
- package/dist/deltat.d.ts +8 -8
- package/dist/geo.d.ts +137 -8
- package/dist/geo.js +28 -166
- package/dist/houses-extra.d.ts +81 -0
- package/dist/houses-extra.js +337 -0
- package/dist/houses-q1O2GGp4.d.ts +128 -0
- package/dist/index.d.ts +8 -201
- package/dist/index.js +38 -315
- package/dist/internal-math-CmJ9xtaW.d.ts +160 -0
- package/dist/internal-math.d.ts +3 -2
- package/dist/internal-math.js +2 -2
- package/dist/internal.d.ts +2 -1
- package/dist/internal.js +4 -4
- package/dist/receipt.d.ts +74 -29
- package/dist/receipt.js +194 -33
- package/dist/rulers-9wljfVaO.d.ts +10 -0
- package/dist/sky.d.ts +158 -0
- package/dist/sky.js +377 -0
- package/dist/techniques.d.ts +410 -0
- package/dist/techniques.js +830 -0
- package/dist/timing.d.ts +473 -0
- package/dist/timing.js +904 -0
- package/dist/{types-CeafogFp.d.ts → types-B4MCoCCS.d.ts} +35 -4
- package/dist/tzdb-2025c-00-6GVG6RYL.js +6 -0
- package/dist/tzdb-2025c-01-CEYMG3LE.js +6 -0
- package/dist/tzdb-2025c-02-NWQJCVUU.js +6 -0
- package/dist/tzdb-2025c-03-PLHP6VH4.js +6 -0
- package/dist/tzdb-2025c-04-MEKUJA6M.js +6 -0
- package/dist/tzdb-2025c-05-3K5YKZBL.js +6 -0
- package/dist/tzdb-2025c-06-L2VV5XJV.js +6 -0
- package/dist/tzdb-2025c-07-H3GLGJGY.js +6 -0
- package/dist/tzdb-2025c-08-DA7QQIGD.js +6 -0
- package/dist/tzdb-2025c-09-MTXIO3QL.js +6 -0
- package/dist/tzdb-2025c-10-ASL4UW5C.js +6 -0
- package/dist/tzdb-2025c-11-EQEOANYB.js +6 -0
- package/dist/tzdb-2025c-12-NKCCXJ5G.js +6 -0
- package/dist/tzdb-2025c-13-DYTF3UC7.js +6 -0
- package/dist/tzdb-2025c-14-C25H45R5.js +6 -0
- package/dist/tzdb-2025c-15-7OYYZWRY.js +6 -0
- package/dist/vedic.d.ts +393 -0
- package/dist/vedic.js +930 -0
- package/dist/window.d.ts +178 -0
- package/dist/window.js +961 -0
- package/package.json +31 -3
- package/dist/chunk-GFT24GFR.js +0 -25
- package/dist/internal-math-BE2hcSHd.d.ts +0 -271
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { DeltaT } from './deltat.js';
|
|
2
|
+
import { B as BodyName, d as Chart, f as BirthInput, D as DateInput, i as ChartPoints, M as MoonPhase, c as BodyPosition, S as SynastryResult, j as TransitResult } from './types-B4MCoCCS.js';
|
|
3
|
+
import { LongitudeCrossing, CrossingSearchOptions, CrossingSearchResult } from './crossings.js';
|
|
4
|
+
|
|
5
|
+
/** Geometry over full ecliptic positions; no independent ephemeris is implied. */
|
|
6
|
+
|
|
7
|
+
/** Site-compatible maximum orb, in degrees, for a pair without Sun or Moon. */
|
|
8
|
+
declare const DECLINATION_ORB = 1;
|
|
9
|
+
/** Site-compatible maximum orb when either identifier is exactly Sun or Moon. */
|
|
10
|
+
declare const DECLINATION_ORB_LUMINARY = 1.5;
|
|
11
|
+
interface DeclinationOrbPolicy {
|
|
12
|
+
/** Inclusive maximum difference in degrees for an ordinary pair. */
|
|
13
|
+
orb: number;
|
|
14
|
+
/** Inclusive maximum when Sun or Moon is a member of the pair. */
|
|
15
|
+
luminaryOrb: number;
|
|
16
|
+
}
|
|
17
|
+
declare const DEFAULT_DECLINATION_ORB_POLICY: Readonly<DeclinationOrbPolicy>;
|
|
18
|
+
/**
|
|
19
|
+
* Horizontal unit-vector magnitude below which RA is numerically undefined.
|
|
20
|
+
* This is a floating-point singularity convention, not a physical error bound.
|
|
21
|
+
*/
|
|
22
|
+
declare const RA_POLE_TOLERANCE: number;
|
|
23
|
+
/**
|
|
24
|
+
* Degrees of ecliptic latitude within which a supplied row labelled exactly
|
|
25
|
+
* "Sun" is never flagged out of bounds by declinationsForBodies, by convention
|
|
26
|
+
* (0.001°, 3.6″). A chart's own Sun, in chartDeclinations, is exempt at any
|
|
27
|
+
* latitude. See outOfBounds.
|
|
28
|
+
*/
|
|
29
|
+
declare const SUN_BOUND_LATITUDE = 0.001;
|
|
30
|
+
interface EquatorialCoordinates {
|
|
31
|
+
/** Right ascension in degrees [0,360), or null at a numerical celestial pole. */
|
|
32
|
+
ra: number | null;
|
|
33
|
+
/** Declination in degrees [-90,90], north positive. */
|
|
34
|
+
dec: number;
|
|
35
|
+
/** False exactly when ra is null; consult RA_POLE_TOLERANCE. */
|
|
36
|
+
raDefined: boolean;
|
|
37
|
+
}
|
|
38
|
+
interface DeclinationBody {
|
|
39
|
+
body: string;
|
|
40
|
+
/** Ecliptic longitude in degrees; finite values wrap into [0,360). */
|
|
41
|
+
lon: number;
|
|
42
|
+
/** Full ecliptic latitude in degrees [-90,90], not an assumed zero. */
|
|
43
|
+
lat: number;
|
|
44
|
+
}
|
|
45
|
+
interface DeclinationRow extends DeclinationBody, EquatorialCoordinates {
|
|
46
|
+
/**
|
|
47
|
+
* Strictly |declination| > the supplied true obliquity, with no uncertainty
|
|
48
|
+
* allowance, except for the Sun, by convention. In chartDeclinations the
|
|
49
|
+
* chart's own Sun row is never out of bounds, at any latitude. In
|
|
50
|
+
* declinationsForBodies a row labelled exactly "Sun" is exempt while its
|
|
51
|
+
* ecliptic latitude is within SUN_BOUND_LATITUDE, and flagged by the strict
|
|
52
|
+
* rule beyond it. The real Sun does pass the bound at about half of all
|
|
53
|
+
* solstices, by up to about 1.1″, but the ephemeris's solar declination is
|
|
54
|
+
* off by up to about 2.7″ near the present and its solar latitude by tens of
|
|
55
|
+
* arcseconds far from it (−68″ in year 2, +26″ in 3902), more than the
|
|
56
|
+
* effect, so the flag could not say which.
|
|
57
|
+
*/
|
|
58
|
+
outOfBounds: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* |declination| − trueObliquity, in arcseconds: positive beyond the bound,
|
|
61
|
+
* negative inside it. For every row but the exempt Sun, outOfBounds is
|
|
62
|
+
* exactly boundMarginArcsec > 0. The flag describes the ephemeris's position;
|
|
63
|
+
* it agrees with the real sky only where |boundMarginArcsec| exceeds the
|
|
64
|
+
* ephemeris's declination error for that body (see the README).
|
|
65
|
+
*/
|
|
66
|
+
boundMarginArcsec: number;
|
|
67
|
+
}
|
|
68
|
+
type DeclinationAspectType = "parallel" | "contraparallel";
|
|
69
|
+
interface DeclinationAspect {
|
|
70
|
+
a: string;
|
|
71
|
+
b: string;
|
|
72
|
+
type: DeclinationAspectType;
|
|
73
|
+
/**
|
|
74
|
+
* Degrees from the selected parallel or contraparallel: the exact
|
|
75
|
+
* min(|decA − decB|, |decA + decB|) of the two declination doubles,
|
|
76
|
+
* rounded to the nearest double.
|
|
77
|
+
*/
|
|
78
|
+
orb: number;
|
|
79
|
+
/** Inclusive maximum allowed by the explicit pair policy. */
|
|
80
|
+
maximumOrb: number;
|
|
81
|
+
decA: number;
|
|
82
|
+
decB: number;
|
|
83
|
+
/**
|
|
84
|
+
* Ecliptic-longitude separation of the two supplied longitudes, reduced
|
|
85
|
+
* exactly modulo 360, in degrees [0,180]; not sky separation. Rounded once.
|
|
86
|
+
*/
|
|
87
|
+
separation: number;
|
|
88
|
+
}
|
|
89
|
+
interface Declinations {
|
|
90
|
+
/**
|
|
91
|
+
* True obliquity of date in degrees: the bound for out-of-bounds flags. From
|
|
92
|
+
* chartDeclinations it is the engine's, at the chart instant on its TT
|
|
93
|
+
* clock: the IAU 2006 mean obliquity plus the IAU 2000B nutation in
|
|
94
|
+
* obliquity, all 77 terms. Elsewhere it is the value supplied.
|
|
95
|
+
*/
|
|
96
|
+
trueObliquity: number;
|
|
97
|
+
rows: DeclinationRow[];
|
|
98
|
+
aspects: DeclinationAspect[];
|
|
99
|
+
orbPolicy: DeclinationOrbPolicy;
|
|
100
|
+
convention: "true-equator-and-equinox-of-date; full-ecliptic-longitude-and-latitude";
|
|
101
|
+
/** This derived feature is not asserted to be covered by the natal receipt. */
|
|
102
|
+
receiptScope: "not-included-in-natal-receipt";
|
|
103
|
+
}
|
|
104
|
+
interface ChartDeclinations extends Declinations {
|
|
105
|
+
/** Observation instant, retaining the engine's UTC-label/UT1 convention. */
|
|
106
|
+
utc: string;
|
|
107
|
+
/** The evaluated provider Delta-T used to obtain true obliquity. */
|
|
108
|
+
deltaT: DeltaT;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Rotate full ecliptic longitude/latitude into the equator associated with the
|
|
112
|
+
* explicitly supplied true obliquity. Both angles and the obliquity are degrees.
|
|
113
|
+
* The source frame/corrections must already be appropriate: this rotation does
|
|
114
|
+
* not add light time, aberration, precession or an ephemeris precision guarantee.
|
|
115
|
+
*/
|
|
116
|
+
declare function eclipticToEquatorial(longitudeDeg: number, latitudeDeg: number, trueObliquityDeg: number): EquatorialCoordinates;
|
|
117
|
+
/** Declination from full longitude/latitude and explicitly supplied obliquity. */
|
|
118
|
+
declare function declinationOf(lon: number, lat: number, trueObliquity: number): number;
|
|
119
|
+
/** Inclusive pair allowance; the returned value makes the applied policy explicit. */
|
|
120
|
+
declare function declinationOrb(a: string, b: string, policy?: Readonly<DeclinationOrbPolicy>): number;
|
|
121
|
+
/**
|
|
122
|
+
* Site-compatible nearest declination aspect for each supplied pair. Inclusive
|
|
123
|
+
* orbs, decided exactly on the declination doubles; a parallel wins an exact
|
|
124
|
+
* tie at the equator. Every supplied body is eligible, including nodes; no
|
|
125
|
+
* longitude-aspect body filter is inferred.
|
|
126
|
+
*/
|
|
127
|
+
declare function findDeclinationAspects(bodies: readonly DeclinationBody[], trueObliquity: number, policy?: Readonly<DeclinationOrbPolicy>): DeclinationAspect[];
|
|
128
|
+
/** Pure derived output; the chart wrapper supplies a provider obliquity of date. */
|
|
129
|
+
declare function declinationsForBodies(bodies: readonly DeclinationBody[], trueObliquity: number, policy?: Readonly<DeclinationOrbPolicy>): Declinations;
|
|
130
|
+
|
|
131
|
+
interface ReturnSeason {
|
|
132
|
+
/** One-based return number. */
|
|
133
|
+
index: number;
|
|
134
|
+
crossings: LongitudeCrossing[];
|
|
135
|
+
first: Date;
|
|
136
|
+
last: Date;
|
|
137
|
+
}
|
|
138
|
+
interface SaturnReturnResult {
|
|
139
|
+
natalLon: number;
|
|
140
|
+
natalRetrograde: boolean;
|
|
141
|
+
seasons: ReturnSeason[];
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Every instant in (from, to] when `body` sits exactly on `targetLongitude`,
|
|
145
|
+
* from the engine's apparent geocentric longitudes, in time order. This is
|
|
146
|
+
* {@link findLongitudeCrossingsWith} on the engine's ephemeris, with its
|
|
147
|
+
* conventions: a root exactly at `from` is not reported and one exactly at
|
|
148
|
+
* `to` is, an exact sample is reported once, and a pair of crossings around a
|
|
149
|
+
* station that falls between two samples is found and kept. There is no
|
|
150
|
+
* sample budget; {@link searchLongitudeCrossings} takes one and refuses
|
|
151
|
+
* instead of throwing. Invalid input throws RangeError.
|
|
152
|
+
*/
|
|
153
|
+
declare function findLongitudeCrossings(body: BodyName, targetLongitude: number, from: Date, to: Date, stepDays?: number): LongitudeCrossing[];
|
|
154
|
+
/**
|
|
155
|
+
* {@link findLongitudeCrossings} under an optional budget of ephemeris
|
|
156
|
+
* evaluations, `maxSamples`, with the step as `stepDays` (default 5). Over
|
|
157
|
+
* budget, it returns `{ status: "refused", reason: "sample-budget" }` with no
|
|
158
|
+
* crossings rather than throwing.
|
|
159
|
+
*/
|
|
160
|
+
declare function searchLongitudeCrossings(body: BodyName, targetLongitude: number, from: Date, to: Date, options?: CrossingSearchOptions): CrossingSearchResult;
|
|
161
|
+
declare function groupIntoSeasons(crossings: readonly LongitudeCrossing[], gapDays?: number): ReturnSeason[];
|
|
162
|
+
|
|
163
|
+
type NatalSource = Chart | BirthInput;
|
|
164
|
+
type SaturnReturnSource = NatalSource | DateInput;
|
|
165
|
+
/**
|
|
166
|
+
* Apparent geocentric tropical positions for an instant. Speeds are sampled
|
|
167
|
+
* up to six hours either side of it, so an instant nearer either end of the
|
|
168
|
+
* Date range, or one astronomy-engine cannot evaluate, throws RangeError.
|
|
169
|
+
*/
|
|
170
|
+
declare function positions(date: DateInput): BodyPosition[];
|
|
171
|
+
/** Build a natal chart from an already resolved UTC instant. */
|
|
172
|
+
declare function natalChart(birth: BirthInput): Chart;
|
|
173
|
+
/**
|
|
174
|
+
* Equatorial coordinates and declination aspects derived from a natal chart's
|
|
175
|
+
* full ecliptic positions, on its own Delta T clock. A supplied Chart's
|
|
176
|
+
* numerical positions remain caller claims, as with chartPoints and synastry.
|
|
177
|
+
* This additional analysis is not included in the natal receipt.
|
|
178
|
+
*/
|
|
179
|
+
declare function chartDeclinations(natal: NatalSource): ChartDeclinations;
|
|
180
|
+
/**
|
|
181
|
+
* The chart's points: the mean lunar node and its opposite, and Black Moon
|
|
182
|
+
* Lilith (the mean lunar apogee), for any chart; with a birth time and place,
|
|
183
|
+
* also the Vertex, the East Point, the chart's sect and the seven lots of
|
|
184
|
+
* Paulus Alexandrinus. A supplied Chart is checked as `transits` checks one;
|
|
185
|
+
* its lots are taken from its own ascendant and bodies.
|
|
186
|
+
*/
|
|
187
|
+
declare function chartPoints(natal: NatalSource): ChartPoints;
|
|
188
|
+
/** Snapshot of current positions and their major aspects to a natal chart. */
|
|
189
|
+
declare function transits(natal: NatalSource, date: DateInput): TransitResult;
|
|
190
|
+
/** Major inter-chart aspects and element/modality balances. */
|
|
191
|
+
declare function synastry(first: NatalSource, second: NatalSource): SynastryResult;
|
|
192
|
+
/** High-precision Moon phase derived from the same positions as charts. */
|
|
193
|
+
declare function moonPhase(date: DateInput): MoonPhase;
|
|
194
|
+
/** Natal Saturn and return seasons through approximately age 92. */
|
|
195
|
+
declare function saturnReturn(birth: SaturnReturnSource): SaturnReturnResult;
|
|
196
|
+
|
|
197
|
+
export { transits as A, type ChartDeclinations as C, DECLINATION_ORB as D, type EquatorialCoordinates as E, type NatalSource as N, RA_POLE_TOLERANCE as R, SUN_BOUND_LATITUDE as S, DECLINATION_ORB_LUMINARY as a, DEFAULT_DECLINATION_ORB_POLICY as b, type DeclinationAspect as c, type DeclinationAspectType as d, type DeclinationBody as e, type DeclinationOrbPolicy as f, type DeclinationRow as g, type Declinations as h, type ReturnSeason as i, type SaturnReturnResult as j, type SaturnReturnSource as k, chartDeclinations as l, chartPoints as m, declinationOf as n, declinationOrb as o, declinationsForBodies as p, eclipticToEquatorial as q, findDeclinationAspects as r, findLongitudeCrossings as s, groupIntoSeasons as t, moonPhase as u, natalChart as v, positions as w, saturnReturn as x, searchLongitudeCrossings as y, synastry as z };
|
package/dist/calc.d.ts
ADDED
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import { DeltaT } from './deltat.js';
|
|
2
|
+
import { h as TimeScale, H as HouseSystem, e as ChartFlag, d as Chart, A as Angles } from './types-B4MCoCCS.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The frames of the calc entry point. A position is first found as a vector on
|
|
6
|
+
* astronomy-engine's EQJ axes, the mean equator and equinox of J2000.0 that its
|
|
7
|
+
* precession starts from, and is then turned into one of eight frames. The
|
|
8
|
+
* precession (IAU 2006, astronomy-engine's own, reproduced in src/frame.ts) and
|
|
9
|
+
* the nutation (IAU 2000B, src/nutation.ts) are the engine's, as positions()
|
|
10
|
+
* and natalChart() use them (src/equator.ts); the J2000.0-ecliptic and ICRS
|
|
11
|
+
* frames are built here.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* A reference plane (the ecliptic or the equator) and the equinox its
|
|
16
|
+
* longitudes count from: the true or the mean equinox of date, the mean
|
|
17
|
+
* equinox of J2000.0, or the ICRS axes.
|
|
18
|
+
*/
|
|
19
|
+
type CalcFrame = "ecliptic-true-of-date" | "ecliptic-mean-of-date" | "ecliptic-j2000" | "ecliptic-icrs" | "equatorial-true-of-date" | "equatorial-mean-of-date" | "equatorial-j2000" | "equatorial-icrs";
|
|
20
|
+
declare const CALC_FRAMES: readonly ["ecliptic-true-of-date", "ecliptic-mean-of-date", "ecliptic-j2000", "ecliptic-icrs", "equatorial-true-of-date", "equatorial-mean-of-date", "equatorial-j2000", "equatorial-icrs"];
|
|
21
|
+
/**
|
|
22
|
+
* "apparent": light time and aberration (annual, and diurnal for a topocentric
|
|
23
|
+
* observer), without gravitational deflection. "astrometric": light time only.
|
|
24
|
+
* "geometric": where the body is at the instant.
|
|
25
|
+
*/
|
|
26
|
+
type CalcCorrection = "apparent" | "astrometric" | "geometric";
|
|
27
|
+
|
|
28
|
+
/** The Sun, Moon, Earth and planets, the true and mean lunar nodes, and Black Moon Lilith (the mean apogee). */
|
|
29
|
+
type CalcBody = "Sun" | "Moon" | "Mercury" | "Venus" | "Earth" | "Mars" | "Jupiter" | "Saturn" | "Uranus" | "Neptune" | "Pluto" | "North Node" | "South Node" | "Mean Node" | "Mean South Node" | "Black Moon Lilith";
|
|
30
|
+
declare const CALC_BODIES: readonly CalcBody[];
|
|
31
|
+
/** The time scale of a Julian date: UTC, UT1 or TT, the root entry's `timeScale` values. */
|
|
32
|
+
type CalcScale = "UTC" | "UT1" | "TT";
|
|
33
|
+
/**
|
|
34
|
+
* An instant: an ISO 8601 string or a Date, read as UTC on the engine's time
|
|
35
|
+
* basis, as positions() and natalChart() read one; or a Julian date on a
|
|
36
|
+
* named time scale. `deltaT` fixes ΔT = TT − UT1, seconds, in place of the
|
|
37
|
+
* time basis's: UT1 still comes from the instant (UTC plus IERS UT1 − UTC
|
|
38
|
+
* from 1972), and TT = UT1 + ΔT.
|
|
39
|
+
*/
|
|
40
|
+
type CalcTime = string | Date | {
|
|
41
|
+
readonly iso: string;
|
|
42
|
+
readonly deltaT?: number;
|
|
43
|
+
} | {
|
|
44
|
+
readonly jd: number;
|
|
45
|
+
readonly scale: CalcScale;
|
|
46
|
+
readonly deltaT?: number;
|
|
47
|
+
};
|
|
48
|
+
/** Geodetic latitude and east longitude, degrees; `height` in metres, 0 by default (topocentric only). */
|
|
49
|
+
interface CalcPlace {
|
|
50
|
+
readonly latitude: number;
|
|
51
|
+
readonly longitude: number;
|
|
52
|
+
readonly height?: number;
|
|
53
|
+
}
|
|
54
|
+
type CalcCenter = "geocentric" | "heliocentric" | "barycentric" | {
|
|
55
|
+
readonly topocentric: CalcPlace;
|
|
56
|
+
};
|
|
57
|
+
/** Ayanamsa names for the sidereal zodiac, which calc refuses in this version: those of @zodiacs/engine/vedic. */
|
|
58
|
+
type CalcAyanamsa = "lahiri" | "fagan-bradley" | "krishnamurti" | "raman" | "yukteswar" | "true-chitra" | "true-revati" | "true-pushya" | "galactic-center";
|
|
59
|
+
declare const CALC_AYANAMSAS: readonly CalcAyanamsa[];
|
|
60
|
+
type CalcZodiac = "tropical" | {
|
|
61
|
+
readonly sidereal: CalcAyanamsa;
|
|
62
|
+
};
|
|
63
|
+
interface CalcFlags {
|
|
64
|
+
/** Default "apparent". */
|
|
65
|
+
readonly correction?: CalcCorrection;
|
|
66
|
+
/** Rates of every coordinate, per day. Default true. */
|
|
67
|
+
readonly speeds?: boolean;
|
|
68
|
+
/** Also x, y, z (au) and their rates. Default false. */
|
|
69
|
+
readonly cartesian?: boolean;
|
|
70
|
+
/** Default "degrees". */
|
|
71
|
+
readonly units?: "degrees" | "radians";
|
|
72
|
+
/** Gravitational light deflection; true is refused in this version. */
|
|
73
|
+
readonly deflection?: boolean;
|
|
74
|
+
}
|
|
75
|
+
interface CalcRequest {
|
|
76
|
+
readonly body: CalcBody;
|
|
77
|
+
readonly time: CalcTime;
|
|
78
|
+
/** Default "ecliptic-true-of-date". */
|
|
79
|
+
readonly frame?: CalcFrame;
|
|
80
|
+
/** Default "geocentric". */
|
|
81
|
+
readonly center?: CalcCenter;
|
|
82
|
+
/** Default "tropical". */
|
|
83
|
+
readonly zodiac?: CalcZodiac;
|
|
84
|
+
readonly flags?: CalcFlags;
|
|
85
|
+
}
|
|
86
|
+
/** An instant as the engine used it: its UTC, UT1 and TT, and how the time basis gave them. */
|
|
87
|
+
interface CalcInstant {
|
|
88
|
+
/** UTC, ISO 8601, to the millisecond; before 1972 and after the IERS table, the civil time read as UT1. */
|
|
89
|
+
readonly utc: string;
|
|
90
|
+
readonly jdUt1: number;
|
|
91
|
+
readonly jdTt: number;
|
|
92
|
+
readonly deltaT: DeltaT;
|
|
93
|
+
/** The scale the instant was given on and the basis that gave UT1 and TT, as a chart records it. */
|
|
94
|
+
readonly timeScale: TimeScale;
|
|
95
|
+
}
|
|
96
|
+
declare const CALC_RECEIPT_SCHEMA = "zodiacs.calc-receipt.draft-v1";
|
|
97
|
+
interface CalcReceipt<Request> {
|
|
98
|
+
readonly schema: typeof CALC_RECEIPT_SCHEMA;
|
|
99
|
+
/** The request as read, every default filled in, as JSON; passing it back repeats the calculation. */
|
|
100
|
+
readonly request: Request;
|
|
101
|
+
readonly instants: readonly CalcInstant[];
|
|
102
|
+
/** Convention ids, such as "frame:ecliptic-j2000"; docs/calc.md defines each. */
|
|
103
|
+
readonly conventions: readonly string[];
|
|
104
|
+
readonly engine: {
|
|
105
|
+
readonly name: "@zodiacs/engine";
|
|
106
|
+
readonly version: string;
|
|
107
|
+
readonly ephemeris: {
|
|
108
|
+
readonly name: "astronomy-engine";
|
|
109
|
+
readonly version: string;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
/** A bound on a result, labelled by how it was found; none is proven. */
|
|
114
|
+
interface CalcBound {
|
|
115
|
+
/** null where nothing has been measured. */
|
|
116
|
+
readonly value: number | null;
|
|
117
|
+
readonly unit: "arcsec" | "arcsec/day" | "relative" | "s";
|
|
118
|
+
readonly label: "measured" | "estimated";
|
|
119
|
+
readonly basis: string;
|
|
120
|
+
}
|
|
121
|
+
interface CalcBounds {
|
|
122
|
+
/** Angle between the reported and the arbiter's direction. */
|
|
123
|
+
readonly position: CalcBound;
|
|
124
|
+
/** Relative distance difference; null for the nodes and Lilith. */
|
|
125
|
+
readonly distance: CalcBound | null;
|
|
126
|
+
/** Angular-rate difference, and how rates were found; null without speeds. */
|
|
127
|
+
readonly speed: (CalcBound & {
|
|
128
|
+
readonly method: "analytic" | "central-difference";
|
|
129
|
+
readonly stepDays: number | null;
|
|
130
|
+
}) | null;
|
|
131
|
+
}
|
|
132
|
+
interface CalcPosition {
|
|
133
|
+
readonly status: "ok";
|
|
134
|
+
readonly body: CalcBody;
|
|
135
|
+
readonly frame: CalcFrame;
|
|
136
|
+
/** Ecliptic longitude, or right ascension in an equatorial frame, in [0, 360) degrees (or radians). */
|
|
137
|
+
readonly lon: number;
|
|
138
|
+
/** Ecliptic latitude, or declination. */
|
|
139
|
+
readonly lat: number;
|
|
140
|
+
/** au: the light path for apparent and astrometric positions (the geocentric apparent Moon, its series, is geometric); null for the nodes and Lilith. */
|
|
141
|
+
readonly dist: number | null;
|
|
142
|
+
/** Per day, in the units of lon and lat, and au. */
|
|
143
|
+
readonly speeds: {
|
|
144
|
+
readonly lon: number;
|
|
145
|
+
readonly lat: number;
|
|
146
|
+
readonly dist: number | null;
|
|
147
|
+
} | null;
|
|
148
|
+
/** au and au per day, when `flags.cartesian`. */
|
|
149
|
+
readonly cartesian: {
|
|
150
|
+
readonly x: number;
|
|
151
|
+
readonly y: number;
|
|
152
|
+
readonly z: number;
|
|
153
|
+
readonly vx: number | null;
|
|
154
|
+
readonly vy: number | null;
|
|
155
|
+
readonly vz: number | null;
|
|
156
|
+
} | null;
|
|
157
|
+
readonly bounds: CalcBounds;
|
|
158
|
+
readonly receipt: CalcReceipt<CalcRequest>;
|
|
159
|
+
}
|
|
160
|
+
/** Why a request was not computed; the crossing search uses the same `status` and `reason` words. */
|
|
161
|
+
type CalcRefusal = {
|
|
162
|
+
readonly status: "refused";
|
|
163
|
+
readonly detail: string;
|
|
164
|
+
} & ({
|
|
165
|
+
readonly reason: "unsupported-combination" | "not-in-this-version";
|
|
166
|
+
} | {
|
|
167
|
+
readonly reason: "out-of-range";
|
|
168
|
+
readonly span: CalcSpan;
|
|
169
|
+
} | {
|
|
170
|
+
readonly reason: "sample-budget";
|
|
171
|
+
readonly samples: number;
|
|
172
|
+
readonly maxSamples: number;
|
|
173
|
+
});
|
|
174
|
+
/** From an ISO instant up to, not including, another. */
|
|
175
|
+
interface CalcSpan {
|
|
176
|
+
readonly from: string;
|
|
177
|
+
readonly to: string;
|
|
178
|
+
}
|
|
179
|
+
/** calc() and the other functions compute an instant only if its UT1 and its TT are in this span; positions() and natalChart() compute outside it, with a flag. */
|
|
180
|
+
declare const CALC_SPAN: CalcSpan;
|
|
181
|
+
/**
|
|
182
|
+
* The position of `body` at `time` in `frame` from `center`, with the
|
|
183
|
+
* correction and outputs `flags` asks for, or a typed refusal. With every
|
|
184
|
+
* default it is the position positions() and natalChart() give, to the bit
|
|
185
|
+
* after the same earlier calls (docs/calc.md).
|
|
186
|
+
*/
|
|
187
|
+
declare function calc(request: CalcRequest): CalcPosition | CalcRefusal;
|
|
188
|
+
interface HousesRequest {
|
|
189
|
+
readonly time: CalcTime;
|
|
190
|
+
readonly place: CalcPlace;
|
|
191
|
+
/** Default "whole", as in natalChart(). */
|
|
192
|
+
readonly system?: HouseSystem;
|
|
193
|
+
readonly zodiac?: CalcZodiac;
|
|
194
|
+
}
|
|
195
|
+
interface HousesResult {
|
|
196
|
+
readonly status: "ok";
|
|
197
|
+
readonly requested: HouseSystem;
|
|
198
|
+
/** The requested system, or whole sign where Placidus or Koch is undefined (flag "polar-fallback"). */
|
|
199
|
+
readonly system: HouseSystem;
|
|
200
|
+
/** Twelve cusps from the first house, degrees in the true ecliptic of date. */
|
|
201
|
+
readonly cusps: readonly number[];
|
|
202
|
+
readonly angles: Angles;
|
|
203
|
+
readonly vertex: number;
|
|
204
|
+
readonly eastPoint: number;
|
|
205
|
+
/** Right ascension of the midheaven, degrees. */
|
|
206
|
+
readonly armc: number;
|
|
207
|
+
/** The true obliquity used, degrees. */
|
|
208
|
+
readonly obliquity: number;
|
|
209
|
+
readonly flags: readonly ChartFlag[];
|
|
210
|
+
readonly bounds: {
|
|
211
|
+
readonly angles: CalcBound;
|
|
212
|
+
readonly cusps: CalcBound;
|
|
213
|
+
};
|
|
214
|
+
readonly receipt: CalcReceipt<HousesRequest>;
|
|
215
|
+
}
|
|
216
|
+
/** The angles, the Vertex, the East Point and the cusps for an instant and a place, as natalChart() computes them. */
|
|
217
|
+
declare function houses(request: HousesRequest): HousesResult | CalcRefusal;
|
|
218
|
+
interface EventsRequest {
|
|
219
|
+
/** The one kind in this version: the instants a body sits on a longitude. */
|
|
220
|
+
readonly kind: "longitude-crossing";
|
|
221
|
+
readonly body: CalcBody;
|
|
222
|
+
/** Apparent geocentric ecliptic longitude of date, degrees. */
|
|
223
|
+
readonly longitude: number;
|
|
224
|
+
/** The search covers (from, to]. */
|
|
225
|
+
readonly from: CalcTime;
|
|
226
|
+
readonly to: CalcTime;
|
|
227
|
+
readonly zodiac?: CalcZodiac;
|
|
228
|
+
/** Days between coarse samples, default 5. */
|
|
229
|
+
readonly stepDays?: number;
|
|
230
|
+
/** Most longitude evaluations allowed, refusing beyond; no limit by default. */
|
|
231
|
+
readonly maxSamples?: number;
|
|
232
|
+
}
|
|
233
|
+
interface CalcEvent {
|
|
234
|
+
/** UTC, ISO 8601, to the millisecond, as the crossing search gives it. */
|
|
235
|
+
readonly at: string;
|
|
236
|
+
readonly jdUt1: number;
|
|
237
|
+
readonly jdTt: number;
|
|
238
|
+
/** True when the body moved backward through the longitude. */
|
|
239
|
+
readonly retrograde: boolean;
|
|
240
|
+
}
|
|
241
|
+
interface EventsResult {
|
|
242
|
+
readonly status: "ok";
|
|
243
|
+
readonly kind: "longitude-crossing";
|
|
244
|
+
readonly events: readonly CalcEvent[];
|
|
245
|
+
/** Longitude evaluations made. */
|
|
246
|
+
readonly samples: number;
|
|
247
|
+
readonly bounds: {
|
|
248
|
+
readonly timing: CalcBound;
|
|
249
|
+
};
|
|
250
|
+
readonly receipt: CalcReceipt<EventsRequest>;
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Every instant in (from, to] when `body` sits on `longitude`: the engine's
|
|
254
|
+
* crossing search (searchLongitudeCrossings) on its apparent geocentric
|
|
255
|
+
* longitudes, under an optional budget of evaluations.
|
|
256
|
+
*/
|
|
257
|
+
declare function events(request: EventsRequest): EventsResult | CalcRefusal;
|
|
258
|
+
interface ChartRequest {
|
|
259
|
+
readonly time: CalcTime;
|
|
260
|
+
/** Without a place there are no angles or houses. */
|
|
261
|
+
readonly place?: CalcPlace;
|
|
262
|
+
/** Default "whole". */
|
|
263
|
+
readonly houseSystem?: HouseSystem;
|
|
264
|
+
/** False: `time` is a reference instant, with no angles or houses. Default true. */
|
|
265
|
+
readonly timeKnown?: boolean;
|
|
266
|
+
/** Time-resolution assertions, as BirthInput.flags takes them. */
|
|
267
|
+
readonly timeFlags?: readonly ChartFlag[];
|
|
268
|
+
readonly zodiac?: CalcZodiac;
|
|
269
|
+
}
|
|
270
|
+
interface ChartResult {
|
|
271
|
+
readonly status: "ok";
|
|
272
|
+
/** The chart natalChart() gives for the same instant (to the millisecond), place, settings and ΔT. */
|
|
273
|
+
readonly chart: Chart;
|
|
274
|
+
readonly receipt: CalcReceipt<ChartRequest>;
|
|
275
|
+
}
|
|
276
|
+
/** A natal chart from the calc vocabulary: natalChart()'s chart, with a receipt. */
|
|
277
|
+
declare function chart(request: ChartRequest): ChartResult | CalcRefusal;
|
|
278
|
+
|
|
279
|
+
export { Angles, CALC_AYANAMSAS, CALC_BODIES, CALC_FRAMES, CALC_RECEIPT_SCHEMA, CALC_SPAN, type CalcAyanamsa, type CalcBody, type CalcBound, type CalcBounds, type CalcCenter, type CalcCorrection, type CalcEvent, type CalcFlags, type CalcFrame, type CalcInstant, type CalcPlace, type CalcPosition, type CalcReceipt, type CalcRefusal, type CalcRequest, type CalcScale, type CalcSpan, type CalcTime, type CalcZodiac, Chart, ChartFlag, type ChartRequest, type ChartResult, DeltaT, type EventsRequest, type EventsResult, HouseSystem, type HousesRequest, type HousesResult, TimeScale, calc, chart, events, houses };
|