@zodiacs/engine 0.1.1-rc.15 → 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.
Files changed (43) hide show
  1. package/CHANGELOG.md +433 -0
  2. package/LICENSING.md +175 -8
  3. package/NOTICE +93 -0
  4. package/README.md +255 -59
  5. package/dist/{api-CoB_kqE3.d.ts → api-VOW6Umy5.d.ts} +4 -5
  6. package/dist/calc.d.ts +279 -0
  7. package/dist/calc.js +853 -0
  8. package/dist/{chunk-MFF3VKO3.js → chunk-2OWGBT3O.js} +1 -1
  9. package/dist/{chunk-ZHVI3KWJ.js → chunk-4NV4ZEFZ.js} +1 -1
  10. package/dist/chunk-A3U2ZS2W.js +29 -0
  11. package/dist/{chunk-OYGRVGXD.js → chunk-I7O5EGFV.js} +3 -3
  12. package/dist/{chunk-CWI4YUDL.js → chunk-L6ZHWJZ6.js} +9 -9
  13. package/dist/chunk-N4B5JNMA.js +473 -0
  14. package/dist/chunk-O3NJRGJ2.js +56 -0
  15. package/dist/{chunk-ZZPITHQS.js → chunk-WOU7JVD3.js} +194 -60
  16. package/dist/crossings.d.ts +1 -1
  17. package/dist/geo.d.ts +1 -1
  18. package/dist/geo.js +15 -458
  19. package/dist/houses-extra.d.ts +81 -0
  20. package/dist/houses-extra.js +337 -0
  21. package/dist/{internal-math-BbktkHCc.d.ts → houses-q1O2GGp4.d.ts} +3 -159
  22. package/dist/index.d.ts +5 -4
  23. package/dist/index.js +17 -17
  24. package/dist/internal-math-CmJ9xtaW.d.ts +160 -0
  25. package/dist/internal-math.d.ts +3 -2
  26. package/dist/internal-math.js +2 -2
  27. package/dist/internal.d.ts +1 -1
  28. package/dist/internal.js +3 -3
  29. package/dist/receipt.d.ts +31 -6
  30. package/dist/receipt.js +13 -7
  31. package/dist/rulers-9wljfVaO.d.ts +10 -0
  32. package/dist/sky.d.ts +158 -0
  33. package/dist/sky.js +377 -0
  34. package/dist/techniques.d.ts +410 -0
  35. package/dist/techniques.js +830 -0
  36. package/dist/timing.d.ts +69 -10
  37. package/dist/timing.js +86 -33
  38. package/dist/{types-BsWaqwU_.d.ts → types-B4MCoCCS.d.ts} +2 -2
  39. package/dist/vedic.d.ts +3 -4
  40. package/dist/vedic.js +26 -43
  41. package/dist/window.d.ts +178 -0
  42. package/dist/window.js +961 -0
  43. package/package.json +23 -3
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 };