@johnmorrisdotca/wakusei-planets 0.17.2 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/NOTICE.md +8 -4
  3. package/README.md +9 -5
  4. package/dist/calendar.d.ts +119 -0
  5. package/dist/calendar.js +154 -0
  6. package/dist/clock.d.ts +244 -0
  7. package/dist/clock.js +326 -0
  8. package/dist/coordinates.d.ts +177 -0
  9. package/dist/coordinates.js +169 -0
  10. package/dist/data/lunar.d.ts +4 -0
  11. package/dist/data/lunar.js +548 -0
  12. package/dist/data/orbits.d.ts +5 -1
  13. package/dist/data/orbits.js +26 -26
  14. package/dist/data/pluto.d.ts +6 -0
  15. package/dist/data/pluto.js +29 -0
  16. package/dist/data/tables.d.ts +41 -0
  17. package/dist/data/tables.js +37 -0
  18. package/dist/data/vsop.d.ts +21 -0
  19. package/dist/data/vsop.js +27 -0
  20. package/dist/element.d.ts +5 -3
  21. package/dist/element.js +22 -9
  22. package/dist/ephemeris.d.ts +4 -16
  23. package/dist/ephemeris.js +76 -33
  24. package/dist/live.js +1 -1
  25. package/dist/mars.d.ts +41 -0
  26. package/dist/mars.js +52 -0
  27. package/dist/scales.d.ts +46 -0
  28. package/dist/scales.js +75 -0
  29. package/dist/sidereal.d.ts +66 -0
  30. package/dist/sidereal.js +88 -0
  31. package/dist/sky/engine.d.ts +46 -0
  32. package/dist/sky/engine.js +145 -0
  33. package/dist/sky/events.d.ts +37 -0
  34. package/dist/sky/events.js +133 -0
  35. package/dist/suncalc-legacy.d.ts +187 -0
  36. package/dist/suncalc-legacy.js +168 -0
  37. package/dist/suncalc.d.ts +209 -0
  38. package/dist/suncalc.js +173 -0
  39. package/dist/tables/all.d.ts +2 -0
  40. package/dist/tables/all.js +2 -0
  41. package/dist/tables/ceres.d.ts +1 -0
  42. package/dist/tables/ceres.js +57 -0
  43. package/dist/tables/dwarfs.d.ts +1 -0
  44. package/dist/tables/dwarfs.js +59 -0
  45. package/dist/theory.d.ts +20 -0
  46. package/dist/theory.js +98 -0
  47. package/dist/time.d.ts +6 -0
  48. package/dist/time.js +7 -0
  49. package/dist/version.d.ts +1 -1
  50. package/dist/version.js +1 -1
  51. package/dist/when.d.ts +16 -0
  52. package/dist/when.js +18 -0
  53. package/package.json +71 -5
@@ -0,0 +1,177 @@
1
+ /** Named axes. Of-date axes are mean, not nutated.
2
+ * @example
3
+ * ```ts
4
+ * import type { CoordinateFrame } from "@johnmorrisdotca/wakusei-planets/coordinates";
5
+ * const value: CoordinateFrame = "eclipticJ2000";
6
+ * console.log(value);
7
+ * ```
8
+ */
9
+ export type CoordinateFrame = "eclipticJ2000" | "equatorialJ2000" | "eclipticOfDate" | "equatorialOfDate";
10
+ /** Origin is preserved by every rotation; no observer translation is performed.
11
+ * @example
12
+ * ```ts
13
+ * import type { CoordinateOrigin } from "@johnmorrisdotca/wakusei-planets/coordinates";
14
+ * const value: CoordinateOrigin = "geocentric";
15
+ * console.log(value);
16
+ * ```
17
+ */
18
+ export type CoordinateOrigin = "heliocentric" | "geocentric" | "topocentric";
19
+ /** Scientific context. Numeric epoch is Unix UTC milliseconds identifying the mean frame's instant; J2000 is JD 2451545.0 TT.
20
+ * @example
21
+ * ```ts
22
+ * import type { CoordinateContext } from "@johnmorrisdotca/wakusei-planets/coordinates";
23
+ * const value: CoordinateContext = { origin: "geocentric", frame: "equatorialJ2000", epoch: "J2000", corrections: "geometric" };
24
+ * console.log(value);
25
+ * ```
26
+ */
27
+ export interface CoordinateContext {
28
+ origin: CoordinateOrigin;
29
+ frame: CoordinateFrame;
30
+ epoch: "J2000" | number;
31
+ corrections: "geometric";
32
+ }
33
+ /** Spherical coordinates: longitude [0,360), latitude [-90,90], radius in AU.
34
+ * @example
35
+ * ```ts
36
+ * import { cartesianToSpherical, type SphericalAu } from "@johnmorrisdotca/wakusei-planets/coordinates";
37
+ * const value: SphericalAu = cartesianToSpherical({ origin: "heliocentric", frame: "eclipticJ2000", epoch: "J2000", corrections: "geometric", xAu: 0, yAu: 1, zAu: 0 });
38
+ * console.log(value);
39
+ * ```
40
+ */
41
+ export interface SphericalAu extends CoordinateContext {
42
+ longitude: number;
43
+ latitude: number;
44
+ distanceAu: number;
45
+ }
46
+ /** Right-handed Cartesian components in AU: x at longitude zero, y at 90 degrees, z north.
47
+ * @example
48
+ * ```ts
49
+ * import { sphericalToCartesian, type CartesianAu } from "@johnmorrisdotca/wakusei-planets/coordinates";
50
+ * const value: CartesianAu = sphericalToCartesian({ origin: "heliocentric", frame: "eclipticJ2000", epoch: "J2000", corrections: "geometric", longitude: 90, latitude: 0, distanceAu: 1 });
51
+ * console.log(value);
52
+ * ```
53
+ */
54
+ export interface CartesianAu extends CoordinateContext {
55
+ xAu: number;
56
+ yAu: number;
57
+ zAu: number;
58
+ }
59
+ /** Ecliptic angles, in degrees, in the named mean ecliptic frame.
60
+ * @example
61
+ * ```ts
62
+ * import { equatorialToEcliptic, type EclipticCoordinates } from "@johnmorrisdotca/wakusei-planets/coordinates";
63
+ * const value: EclipticCoordinates = equatorialToEcliptic({ origin: "geocentric", frame: "equatorialJ2000", epoch: "J2000", corrections: "geometric", rightAscension: 90, declination: 0 });
64
+ * console.log(value);
65
+ * ```
66
+ */
67
+ export interface EclipticCoordinates extends CoordinateContext {
68
+ frame: "eclipticJ2000" | "eclipticOfDate";
69
+ eclipticLongitude: number;
70
+ eclipticLatitude: number;
71
+ }
72
+ /** Equatorial angles, in degrees (right ascension is never hours).
73
+ * @example
74
+ * ```ts
75
+ * import { eclipticToEquatorial, type EquatorialCoordinates } from "@johnmorrisdotca/wakusei-planets/coordinates";
76
+ * const value: EquatorialCoordinates = eclipticToEquatorial({ origin: "geocentric", frame: "eclipticJ2000", epoch: "J2000", corrections: "geometric", eclipticLongitude: 90, eclipticLatitude: 0 });
77
+ * console.log(value);
78
+ * ```
79
+ */
80
+ export interface EquatorialCoordinates extends CoordinateContext {
81
+ frame: "equatorialJ2000" | "equatorialOfDate";
82
+ rightAscension: number;
83
+ declination: number;
84
+ }
85
+ /** Earth observer: degrees north/east; optional metres above mean sea level. Rotations do not use height.
86
+ * @example
87
+ * ```ts
88
+ * import type { CoordinateObserver } from "@johnmorrisdotca/wakusei-planets/coordinates";
89
+ * const value: CoordinateObserver = { latitude: 49, longitude: -123 };
90
+ * console.log(value);
91
+ * ```
92
+ */
93
+ export interface CoordinateObserver {
94
+ latitude: number;
95
+ longitude: number;
96
+ heightM?: number;
97
+ }
98
+ /** Geometric horizontal direction. Azimuth is clockwise from north; origin remains that of the supplied direction.
99
+ * @example
100
+ * ```ts
101
+ * import { equatorialToHorizontal, type HorizontalCoordinates } from "@johnmorrisdotca/wakusei-planets/coordinates";
102
+ * const value: HorizontalCoordinates = equatorialToHorizontal({ origin: "topocentric", frame: "equatorialOfDate", epoch: 0, corrections: "geometric", rightAscension: 0, declination: 0 }, 0, { observer: { latitude: 49, longitude: -123 } });
103
+ * console.log(value);
104
+ * ```
105
+ */
106
+ export interface HorizontalCoordinates {
107
+ origin: CoordinateOrigin;
108
+ frame: "horizontal";
109
+ epoch: number;
110
+ corrections: "geometric";
111
+ altitude: number;
112
+ azimuth: number;
113
+ }
114
+ /** Convert spherical to Cartesian, preserving origin, frame, epoch and geometric corrections. Radius must be positive.
115
+ * @param value - Coordinates with explicit origin, frame, epoch and geometric corrections.
116
+ * @returns Cartesian components in AU with the same context.
117
+ * @example
118
+ * ```ts
119
+ * import { sphericalToCartesian } from "@johnmorrisdotca/wakusei-planets/coordinates";
120
+ * console.log(sphericalToCartesian({ origin: "heliocentric", frame: "eclipticJ2000", epoch: "J2000", corrections: "geometric", longitude: 90, latitude: 0, distanceAu: 1 }));
121
+ * ```
122
+ */
123
+ export declare function sphericalToCartesian(value: SphericalAu): CartesianAu;
124
+ /** Convert Cartesian to spherical. Zero vectors throw; longitude at either pole is conventionally zero.
125
+ * @param value - Coordinates with explicit origin, frame, epoch and geometric corrections.
126
+ * @returns Spherical angles in degrees and radius in AU with the same context.
127
+ * @example
128
+ * ```ts
129
+ * import { cartesianToSpherical } from "@johnmorrisdotca/wakusei-planets/coordinates";
130
+ * console.log(cartesianToSpherical({ origin: "heliocentric", frame: "eclipticJ2000", epoch: "J2000", corrections: "geometric", xAu: 0, yAu: 1, zAu: 0 }));
131
+ * ```
132
+ */
133
+ export declare function cartesianToSpherical(value: CartesianAu): SphericalAu;
134
+ /** Mean obliquity in degrees: IAU 1980 (Meeus 22.2), evaluated in TT. Validated for 1800–2050; extrapolates outside it.
135
+ * @param when - Date or Unix UTC milliseconds.
136
+ * @returns Mean obliquity in degrees.
137
+ * @example
138
+ * ```ts
139
+ * import { meanObliquity } from "@johnmorrisdotca/wakusei-planets/coordinates";
140
+ * console.log(meanObliquity(new Date("2000-01-01T12:00:00Z")));
141
+ * ```
142
+ */
143
+ export declare function meanObliquity(when: Date | number): number;
144
+ /** Rotate a mean ecliptic direction into the matching mean equatorial frame. No precession between epochs, nutation, aberration or light-time is added.
145
+ * @param value - Coordinates with explicit origin, frame, epoch and geometric corrections.
146
+ * @returns Right ascension and declination in the matching mean equatorial frame.
147
+ * @example
148
+ * ```ts
149
+ * import { eclipticToEquatorial } from "@johnmorrisdotca/wakusei-planets/coordinates";
150
+ * console.log(eclipticToEquatorial({ origin: "geocentric", frame: "eclipticJ2000", epoch: "J2000", corrections: "geometric", eclipticLongitude: 90, eclipticLatitude: 0 }));
151
+ * ```
152
+ */
153
+ export declare function eclipticToEquatorial(value: EclipticCoordinates): EquatorialCoordinates;
154
+ /** Inverse mean-equator rotation, retaining the same origin and epoch.
155
+ * @param value - Coordinates with explicit origin, frame, epoch and geometric corrections.
156
+ * @returns Ecliptic longitude and latitude in the matching mean ecliptic frame.
157
+ * @example
158
+ * ```ts
159
+ * import { equatorialToEcliptic } from "@johnmorrisdotca/wakusei-planets/coordinates";
160
+ * console.log(equatorialToEcliptic({ origin: "geocentric", frame: "equatorialJ2000", epoch: "J2000", corrections: "geometric", rightAscension: 90, declination: 0 }));
161
+ * ```
162
+ */
163
+ export declare function equatorialToEcliptic(value: EquatorialCoordinates): EclipticCoordinates;
164
+ /** Rotate a mean equatorial-of-date direction to an observer's horizon (Meeus 12.4, 13.5–6). The input epoch must equal when. UTC approximates UT1; height is validated but unused. No parallax, refraction, nutation or horizon dip. Azimuth at zenith/nadir is conventionally zero.
165
+ * @param value - Mean equatorial-of-date direction with explicit origin and epoch.
166
+ * @param when - Date or Unix UTC milliseconds equal to the input epoch.
167
+ * @param options - Observer in degrees north/east; height in metres above mean sea level.
168
+ * @returns Altitude and north-based azimuth in degrees; original origin preserved.
169
+ * @example
170
+ * ```ts
171
+ * import { equatorialToHorizontal } from "@johnmorrisdotca/wakusei-planets/coordinates";
172
+ * console.log(equatorialToHorizontal({ origin: "topocentric", frame: "equatorialOfDate", epoch: 0, corrections: "geometric", rightAscension: 0, declination: 0 }, 0, { observer: { latitude: 49, longitude: -123 } }));
173
+ * ```
174
+ */
175
+ export declare function equatorialToHorizontal(value: EquatorialCoordinates, when: Date | number, options: {
176
+ observer: CoordinateObserver;
177
+ }): HorizontalCoordinates;
@@ -0,0 +1,169 @@
1
+ // Coordinate rotations: Meeus, Astronomical Algorithms, 2nd ed., chapters 12, 13, 22.
2
+ // Standalone mathematics; no body data, ephemerides or rendering dependencies.
3
+ import { ttMinusUtc } from "./clock.js";
4
+ const RAD = Math.PI / 180;
5
+ const J2000 = 2451545;
6
+ const DAY_MS = 86400000;
7
+ function finite(name, value) {
8
+ if (typeof value !== "number" || !Number.isFinite(value))
9
+ throw new RangeError(`${name}: ${String(value)} must be finite`);
10
+ return value;
11
+ }
12
+ function bounded(name, value, low, high) {
13
+ finite(name, value);
14
+ if (value < low || value > high)
15
+ throw new RangeError(`${name}: ${value} must be in [${low}, ${high}]`);
16
+ return value;
17
+ }
18
+ function wrap(value) { return ((value % 360) + 360) % 360; }
19
+ function instant(when) {
20
+ const ms = finite("when", when instanceof Date ? when.getTime() : when);
21
+ if (Math.abs(ms) > 8640000000000000)
22
+ throw new RangeError(`when: ${ms} is outside the Date range`);
23
+ return ms;
24
+ }
25
+ function context(c) {
26
+ if (!["heliocentric", "geocentric", "topocentric"].includes(c.origin))
27
+ throw new RangeError(`origin: ${c.origin}`);
28
+ if (!["eclipticJ2000", "equatorialJ2000", "eclipticOfDate", "equatorialOfDate"].includes(c.frame))
29
+ throw new RangeError(`frame: ${c.frame}`);
30
+ if (c.corrections !== "geometric")
31
+ throw new RangeError(`corrections: ${c.corrections}; expected geometric`);
32
+ if (c.frame.endsWith("J2000")) {
33
+ if (c.epoch !== "J2000")
34
+ throw new RangeError(`epoch: ${c.epoch}; expected J2000`);
35
+ }
36
+ else {
37
+ if (typeof c.epoch !== "number")
38
+ throw new RangeError(`epoch: ${c.epoch}; expected Unix milliseconds`);
39
+ instant(c.epoch);
40
+ }
41
+ return { origin: c.origin, frame: c.frame, epoch: c.epoch, corrections: c.corrections };
42
+ }
43
+ function spherical(longitude, latitude) {
44
+ const l = wrap(finite("longitude", longitude)) * RAD;
45
+ const b = bounded("latitude", latitude, -90, 90) * RAD;
46
+ const cb = Math.abs(latitude) === 90 ? 0 : Math.cos(b);
47
+ return [cb * Math.cos(l), cb * Math.sin(l), Math.sin(b)];
48
+ }
49
+ function angles(x, y, z) {
50
+ const xy = Math.hypot(x, y);
51
+ return [xy < 1e-15 * Math.hypot(x, y, z) ? 0 : wrap(Math.atan2(y, x) / RAD), Math.atan2(z, xy) / RAD];
52
+ }
53
+ /** Convert spherical to Cartesian, preserving origin, frame, epoch and geometric corrections. Radius must be positive.
54
+ * @param value - Coordinates with explicit origin, frame, epoch and geometric corrections.
55
+ * @returns Cartesian components in AU with the same context.
56
+ * @example
57
+ * ```ts
58
+ * import { sphericalToCartesian } from "@johnmorrisdotca/wakusei-planets/coordinates";
59
+ * console.log(sphericalToCartesian({ origin: "heliocentric", frame: "eclipticJ2000", epoch: "J2000", corrections: "geometric", longitude: 90, latitude: 0, distanceAu: 1 }));
60
+ * ```
61
+ */
62
+ export function sphericalToCartesian(value) {
63
+ const c = context(value);
64
+ const d = finite("distanceAu", value.distanceAu);
65
+ if (d <= 0)
66
+ throw new RangeError(`distanceAu: ${d} must be positive`);
67
+ const [x, y, z] = spherical(value.longitude, value.latitude);
68
+ return { ...c, xAu: x * d, yAu: y * d, zAu: z * d };
69
+ }
70
+ /** Convert Cartesian to spherical. Zero vectors throw; longitude at either pole is conventionally zero.
71
+ * @param value - Coordinates with explicit origin, frame, epoch and geometric corrections.
72
+ * @returns Spherical angles in degrees and radius in AU with the same context.
73
+ * @example
74
+ * ```ts
75
+ * import { cartesianToSpherical } from "@johnmorrisdotca/wakusei-planets/coordinates";
76
+ * console.log(cartesianToSpherical({ origin: "heliocentric", frame: "eclipticJ2000", epoch: "J2000", corrections: "geometric", xAu: 0, yAu: 1, zAu: 0 }));
77
+ * ```
78
+ */
79
+ export function cartesianToSpherical(value) {
80
+ const c = context(value);
81
+ const x = finite("xAu", value.xAu), y = finite("yAu", value.yAu), z = finite("zAu", value.zAu);
82
+ const d = finite("distanceAu", Math.hypot(x, y, z));
83
+ if (d === 0)
84
+ throw new RangeError("distanceAu: 0 has no direction");
85
+ const [longitude, latitude] = angles(x / d, y / d, z / d);
86
+ return { ...c, longitude, latitude, distanceAu: d };
87
+ }
88
+ /** Mean obliquity in degrees: IAU 1980 (Meeus 22.2), evaluated in TT. Validated for 1800–2050; extrapolates outside it.
89
+ * @param when - Date or Unix UTC milliseconds.
90
+ * @returns Mean obliquity in degrees.
91
+ * @example
92
+ * ```ts
93
+ * import { meanObliquity } from "@johnmorrisdotca/wakusei-planets/coordinates";
94
+ * console.log(meanObliquity(new Date("2000-01-01T12:00:00Z")));
95
+ * ```
96
+ */
97
+ export function meanObliquity(when) {
98
+ const utc = instant(when);
99
+ const t = ((utc + ttMinusUtc(utc) * 1000) / DAY_MS + 2440587.5 - J2000) / 36525;
100
+ return (84381.448 - 46.815 * t - 0.00059 * t * t + 0.001813 * t * t * t) / 3600;
101
+ }
102
+ function obliquity(c) {
103
+ return (c.epoch === "J2000" ? 84381.448 / 3600 : meanObliquity(c.epoch)) * RAD;
104
+ }
105
+ /** Rotate a mean ecliptic direction into the matching mean equatorial frame. No precession between epochs, nutation, aberration or light-time is added.
106
+ * @param value - Coordinates with explicit origin, frame, epoch and geometric corrections.
107
+ * @returns Right ascension and declination in the matching mean equatorial frame.
108
+ * @example
109
+ * ```ts
110
+ * import { eclipticToEquatorial } from "@johnmorrisdotca/wakusei-planets/coordinates";
111
+ * console.log(eclipticToEquatorial({ origin: "geocentric", frame: "eclipticJ2000", epoch: "J2000", corrections: "geometric", eclipticLongitude: 90, eclipticLatitude: 0 }));
112
+ * ```
113
+ */
114
+ export function eclipticToEquatorial(value) {
115
+ const c = context(value);
116
+ if (!c.frame.startsWith("ecliptic"))
117
+ throw new RangeError(`frame: ${c.frame}; expected ecliptic`);
118
+ const [x, y, z] = spherical(value.eclipticLongitude, value.eclipticLatitude);
119
+ const e = obliquity(c);
120
+ const [rightAscension, declination] = angles(x, y * Math.cos(e) - z * Math.sin(e), y * Math.sin(e) + z * Math.cos(e));
121
+ return { ...c, frame: c.frame === "eclipticJ2000" ? "equatorialJ2000" : "equatorialOfDate", rightAscension, declination };
122
+ }
123
+ /** Inverse mean-equator rotation, retaining the same origin and epoch.
124
+ * @param value - Coordinates with explicit origin, frame, epoch and geometric corrections.
125
+ * @returns Ecliptic longitude and latitude in the matching mean ecliptic frame.
126
+ * @example
127
+ * ```ts
128
+ * import { equatorialToEcliptic } from "@johnmorrisdotca/wakusei-planets/coordinates";
129
+ * console.log(equatorialToEcliptic({ origin: "geocentric", frame: "equatorialJ2000", epoch: "J2000", corrections: "geometric", rightAscension: 90, declination: 0 }));
130
+ * ```
131
+ */
132
+ export function equatorialToEcliptic(value) {
133
+ const c = context(value);
134
+ if (!c.frame.startsWith("equatorial"))
135
+ throw new RangeError(`frame: ${c.frame}; expected equatorial`);
136
+ const [x, y, z] = spherical(value.rightAscension, value.declination);
137
+ const e = obliquity(c);
138
+ const [eclipticLongitude, eclipticLatitude] = angles(x, y * Math.cos(e) + z * Math.sin(e), -y * Math.sin(e) + z * Math.cos(e));
139
+ return { ...c, frame: c.frame === "equatorialJ2000" ? "eclipticJ2000" : "eclipticOfDate", eclipticLongitude, eclipticLatitude };
140
+ }
141
+ /** Rotate a mean equatorial-of-date direction to an observer's horizon (Meeus 12.4, 13.5–6). The input epoch must equal when. UTC approximates UT1; height is validated but unused. No parallax, refraction, nutation or horizon dip. Azimuth at zenith/nadir is conventionally zero.
142
+ * @param value - Mean equatorial-of-date direction with explicit origin and epoch.
143
+ * @param when - Date or Unix UTC milliseconds equal to the input epoch.
144
+ * @param options - Observer in degrees north/east; height in metres above mean sea level.
145
+ * @returns Altitude and north-based azimuth in degrees; original origin preserved.
146
+ * @example
147
+ * ```ts
148
+ * import { equatorialToHorizontal } from "@johnmorrisdotca/wakusei-planets/coordinates";
149
+ * console.log(equatorialToHorizontal({ origin: "topocentric", frame: "equatorialOfDate", epoch: 0, corrections: "geometric", rightAscension: 0, declination: 0 }, 0, { observer: { latitude: 49, longitude: -123 } }));
150
+ * ```
151
+ */
152
+ export function equatorialToHorizontal(value, when, options) {
153
+ const c = context(value), ms = instant(when);
154
+ if (c.frame !== "equatorialOfDate" || c.epoch !== ms)
155
+ throw new RangeError(`frame/epoch: ${c.frame}/${c.epoch}; expected equatorialOfDate at when ${ms}`);
156
+ const observer = options.observer;
157
+ const p = bounded("observer.latitude", observer.latitude, -90, 90) * RAD;
158
+ const l = bounded("observer.longitude", observer.longitude, -180, 180);
159
+ finite("observer.heightM", observer.heightM ?? 0);
160
+ const ra = wrap(finite("rightAscension", value.rightAscension));
161
+ const d = bounded("declination", value.declination, -90, 90) * RAD;
162
+ const days = ms / DAY_MS + 2440587.5 - J2000, t = days / 36525;
163
+ const h = wrap(280.46061837 + 360.98564736629 * days + 0.000387933 * t * t - t * t * t / 38710000 + l - ra) * RAD;
164
+ const east = -Math.cos(d) * Math.sin(h);
165
+ const north = Math.sin(d) * Math.cos(p) - Math.cos(d) * Math.cos(h) * Math.sin(p);
166
+ const up = Math.sin(d) * Math.sin(p) + Math.cos(d) * Math.cos(h) * Math.cos(p);
167
+ const horizontal = Math.hypot(east, north);
168
+ return { origin: c.origin, frame: "horizontal", epoch: ms, corrections: "geometric", altitude: Math.atan2(up, horizontal) / RAD, azimuth: horizontal < 1e-15 ? 0 : wrap(Math.atan2(east, north) / RAD) };
169
+ }
@@ -0,0 +1,4 @@
1
+ /** The main problem: coordinate (0 longitude, 1 latitude, 2 distance), amplitude, then the multipliers of D, l', l and F. A distance term is a cosine, which the evaluator makes a sine a quarter turn on. */
2
+ export declare const LUNAR_MAIN: readonly (readonly number[])[];
3
+ /** The perturbations: coordinate, the power of time the amplitude is multiplied by, amplitude, phase in degrees, then the multipliers of D, l', l, F, zeta (the Moon's mean longitude with the precession) and the eight planets' mean longitudes (the Earth's is the third). */
4
+ export declare const LUNAR_PERIODIC: readonly (readonly number[])[];