@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,337 @@
|
|
|
1
|
+
// src/houses-extra.ts
|
|
2
|
+
var DEG = Math.PI / 180;
|
|
3
|
+
var RAD = 180 / Math.PI;
|
|
4
|
+
var SIDEREAL_RATE = 360.98564736629;
|
|
5
|
+
var SYSTEMS = [
|
|
6
|
+
"whole",
|
|
7
|
+
"placidus",
|
|
8
|
+
"porphyry",
|
|
9
|
+
"equal",
|
|
10
|
+
"equal-mc",
|
|
11
|
+
"vehlow",
|
|
12
|
+
"koch",
|
|
13
|
+
"regiomontanus",
|
|
14
|
+
"campanus",
|
|
15
|
+
"topocentric",
|
|
16
|
+
"alcabitius",
|
|
17
|
+
"morinus",
|
|
18
|
+
"meridian"
|
|
19
|
+
];
|
|
20
|
+
var normalize = (value) => (value % 360 + 360) % 360;
|
|
21
|
+
var inCircle = (value) => value >= 0 && value < 360 ? value : normalize(value);
|
|
22
|
+
function finiteNumber(value, label) {
|
|
23
|
+
if (typeof value !== "number" || !Number.isFinite(value)) throw new RangeError(`${label} must be a finite number.`);
|
|
24
|
+
return value;
|
|
25
|
+
}
|
|
26
|
+
function placeOf(input) {
|
|
27
|
+
if (input === null || typeof input !== "object") throw new RangeError("input must be an AngleInput object.");
|
|
28
|
+
const gastHours = finiteNumber(input.gastHours, "gastHours");
|
|
29
|
+
const longitude = finiteNumber(input.longitude, "longitude");
|
|
30
|
+
const latitude = finiteNumber(input.latitude, "latitude");
|
|
31
|
+
const obliquity = finiteNumber(input.obliquity, "obliquity");
|
|
32
|
+
if (Math.abs(latitude) > 90) throw new RangeError("latitude must be within [-90, 90] degrees.");
|
|
33
|
+
if (!(obliquity > 0 && obliquity < 90)) throw new RangeError("obliquity must be between 0 and 90 degrees.");
|
|
34
|
+
return { ramc: normalize(gastHours * 15 + longitude), latitude, obliquity };
|
|
35
|
+
}
|
|
36
|
+
function systemOf(system) {
|
|
37
|
+
if (typeof system === "string" && SYSTEMS.includes(system)) return system;
|
|
38
|
+
throw new RangeError(`Unknown house system ${String(system)}.`);
|
|
39
|
+
}
|
|
40
|
+
function anglesOf({ ramc, latitude, obliquity }) {
|
|
41
|
+
const ra = ramc * DEG;
|
|
42
|
+
const eps = obliquity * DEG;
|
|
43
|
+
const mc = normalize(Math.atan2(Math.sin(ra), Math.cos(ra) * Math.cos(eps)) * RAD);
|
|
44
|
+
let asc = normalize(
|
|
45
|
+
Math.atan2(Math.cos(ra), -(Math.sin(ra) * Math.cos(eps) + Math.tan(latitude * DEG) * Math.sin(eps))) * RAD
|
|
46
|
+
);
|
|
47
|
+
if (normalize(asc - mc) >= 180) asc = normalize(asc + 180);
|
|
48
|
+
return { asc, mc };
|
|
49
|
+
}
|
|
50
|
+
function obliqueLongitude(ascension, pole, obliquity) {
|
|
51
|
+
const a = ascension * DEG;
|
|
52
|
+
const e = obliquity * DEG;
|
|
53
|
+
return normalize(Math.atan2(Math.sin(a), Math.cos(a) * Math.cos(e) - Math.tan(pole * DEG) * Math.sin(e)) * RAD);
|
|
54
|
+
}
|
|
55
|
+
function equatorialOf(place, body) {
|
|
56
|
+
if (body === null || typeof body !== "object") throw new RangeError("body must be an object with lon and lat.");
|
|
57
|
+
const lon = finiteNumber(body.lon, "body lon");
|
|
58
|
+
const lat = body.lat === void 0 ? 0 : finiteNumber(body.lat, "body lat");
|
|
59
|
+
if (Math.abs(lat) > 90) throw new RangeError("body lat must be within [-90, 90] degrees.");
|
|
60
|
+
const l = lon * DEG;
|
|
61
|
+
const b = lat * DEG;
|
|
62
|
+
const e = place.obliquity * DEG;
|
|
63
|
+
const x = Math.cos(b) * Math.cos(l);
|
|
64
|
+
const y = Math.cos(b) * Math.sin(l) * Math.cos(e) - Math.sin(b) * Math.sin(e);
|
|
65
|
+
const z = Math.cos(b) * Math.sin(l) * Math.sin(e) + Math.sin(b) * Math.cos(e);
|
|
66
|
+
return { md: normalize(Math.atan2(y, x) * RAD - place.ramc), dec: Math.atan2(z, Math.hypot(x, y)) * RAD };
|
|
67
|
+
}
|
|
68
|
+
function semiArc(a) {
|
|
69
|
+
return a >= 1 ? 180 : a <= -1 ? 0 : 90 + Math.asin(a) * RAD;
|
|
70
|
+
}
|
|
71
|
+
var diurnalSemiArc = (tanLatitude, dec) => semiArc(tanLatitude * Math.tan(dec * DEG));
|
|
72
|
+
function byQuadrants(md, dec, east) {
|
|
73
|
+
if (md < 180) return east(md, dec);
|
|
74
|
+
const opposite = east(md - 180, -dec);
|
|
75
|
+
return opposite === null ? null : opposite + 180;
|
|
76
|
+
}
|
|
77
|
+
function placidusEast(tanLatitude) {
|
|
78
|
+
return (md, dec) => {
|
|
79
|
+
const day = diurnalSemiArc(tanLatitude, dec);
|
|
80
|
+
return md < day ? 270 + 90 * md / day : 90 * (md - day) / (180 - day);
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
function kochEast(place, tanLatitude) {
|
|
84
|
+
const day = semiArc(tanLatitude * Math.tan(place.obliquity * DEG) * Math.sin(place.ramc * DEG));
|
|
85
|
+
if (!(day > 0)) return null;
|
|
86
|
+
return (md, dec) => {
|
|
87
|
+
const position = 90 * (md - diurnalSemiArc(tanLatitude, dec)) / day;
|
|
88
|
+
if (!(Math.abs(position) <= 90 + 1e-9)) return null;
|
|
89
|
+
return Math.min(90, Math.max(-90, position));
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
function root(f, low, high) {
|
|
93
|
+
const atLow = f(low);
|
|
94
|
+
const atHigh = f(high);
|
|
95
|
+
if (atLow === 0) return low;
|
|
96
|
+
if (atHigh === 0) return high;
|
|
97
|
+
if (!(Math.sign(atLow) === -Math.sign(atHigh))) return null;
|
|
98
|
+
let lower = low;
|
|
99
|
+
let upper = high;
|
|
100
|
+
for (let step = 0; step < 200; step += 1) {
|
|
101
|
+
const middle = (lower + upper) / 2;
|
|
102
|
+
if (!(middle > lower && middle < upper)) break;
|
|
103
|
+
if (Math.sign(f(middle)) === Math.sign(atLow)) lower = middle;
|
|
104
|
+
else upper = middle;
|
|
105
|
+
}
|
|
106
|
+
return (lower + upper) / 2;
|
|
107
|
+
}
|
|
108
|
+
function topocentricEast(tanLatitude) {
|
|
109
|
+
return (md, dec) => {
|
|
110
|
+
const a = tanLatitude * Math.tan(dec * DEG);
|
|
111
|
+
const asin = (x) => Math.asin(Math.min(1, Math.max(-1, x))) * RAD;
|
|
112
|
+
const circumpolar = Math.abs(a) > 1;
|
|
113
|
+
const reach = circumpolar ? 1 / Math.abs(a) : 1;
|
|
114
|
+
const above = md < diurnalSemiArc(tanLatitude, dec);
|
|
115
|
+
const s = above ? root((t) => md - 90 * t - asin(t * a), 0, reach) : root((t) => md - 90 - 90 * t - asin((1 - t) * a), 1 - reach, 1);
|
|
116
|
+
const circle = s ?? (circumpolar ? null : above ? 1 : 0);
|
|
117
|
+
if (circle === null) return null;
|
|
118
|
+
return above ? 270 + 90 * circle : 90 * circle;
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
function alcabitiusEast(place, asc, tanLatitude) {
|
|
122
|
+
const declination = Math.asin(Math.sin(place.obliquity * DEG) * Math.sin(asc * DEG)) * RAD;
|
|
123
|
+
const day = Math.acos(Math.min(1, Math.max(-1, -tanLatitude * Math.tan(declination * DEG)))) * RAD;
|
|
124
|
+
return (md) => md < day ? 270 + 90 * md / day : 90 * (md - day) / (180 - day);
|
|
125
|
+
}
|
|
126
|
+
function porphyryPosition(lon, asc, mc) {
|
|
127
|
+
const upper = normalize(asc - mc);
|
|
128
|
+
const lower = normalize(normalize(mc + 180) - asc);
|
|
129
|
+
const fromMc = normalize(lon - mc);
|
|
130
|
+
if (fromMc < upper) return 270 + 90 * fromMc / upper;
|
|
131
|
+
if (fromMc < 180) return 90 * (fromMc - upper) / lower;
|
|
132
|
+
if (fromMc < 180 + upper) return 90 + 90 * (fromMc - 180) / upper;
|
|
133
|
+
return 180 + 90 * (fromMc - 180 - upper) / lower;
|
|
134
|
+
}
|
|
135
|
+
function housePosition(system, input, body) {
|
|
136
|
+
const name = systemOf(system);
|
|
137
|
+
const place = placeOf(input);
|
|
138
|
+
const { asc, mc } = anglesOf(place);
|
|
139
|
+
const { md, dec } = equatorialOf(place, body);
|
|
140
|
+
const lon = inCircle(body.lon);
|
|
141
|
+
const tanLatitude = Math.tan(place.latitude * DEG);
|
|
142
|
+
let mundane;
|
|
143
|
+
switch (name) {
|
|
144
|
+
case "whole":
|
|
145
|
+
mundane = lon - Math.floor(asc / 30) * 30;
|
|
146
|
+
break;
|
|
147
|
+
case "equal":
|
|
148
|
+
mundane = lon - asc;
|
|
149
|
+
break;
|
|
150
|
+
case "vehlow":
|
|
151
|
+
mundane = lon - asc + 15;
|
|
152
|
+
break;
|
|
153
|
+
case "equal-mc":
|
|
154
|
+
mundane = lon - mc - 90;
|
|
155
|
+
break;
|
|
156
|
+
case "porphyry":
|
|
157
|
+
mundane = porphyryPosition(lon, asc, mc);
|
|
158
|
+
break;
|
|
159
|
+
case "morinus": {
|
|
160
|
+
const e = place.obliquity * DEG;
|
|
161
|
+
mundane = Math.atan2(Math.sin(lon * DEG), Math.cos(lon * DEG) * Math.cos(e)) * RAD - place.ramc - 90;
|
|
162
|
+
break;
|
|
163
|
+
}
|
|
164
|
+
case "meridian":
|
|
165
|
+
mundane = md - 90;
|
|
166
|
+
break;
|
|
167
|
+
case "campanus":
|
|
168
|
+
case "regiomontanus": {
|
|
169
|
+
const phi = place.latitude * DEG;
|
|
170
|
+
const east = Math.cos(dec * DEG) * Math.sin(md * DEG);
|
|
171
|
+
const zenith = Math.cos(phi) * Math.cos(dec * DEG) * Math.cos(md * DEG) + Math.sin(phi) * Math.sin(dec * DEG);
|
|
172
|
+
mundane = Math.atan2(name === "campanus" ? east : east * Math.cos(phi), zenith) * RAD - 90;
|
|
173
|
+
break;
|
|
174
|
+
}
|
|
175
|
+
case "placidus":
|
|
176
|
+
mundane = byQuadrants(md, dec, placidusEast(tanLatitude));
|
|
177
|
+
break;
|
|
178
|
+
case "koch": {
|
|
179
|
+
const east = kochEast(place, tanLatitude);
|
|
180
|
+
mundane = east === null ? null : byQuadrants(md, dec, east);
|
|
181
|
+
break;
|
|
182
|
+
}
|
|
183
|
+
case "topocentric":
|
|
184
|
+
mundane = byQuadrants(md, dec, topocentricEast(tanLatitude));
|
|
185
|
+
break;
|
|
186
|
+
case "alcabitius":
|
|
187
|
+
mundane = byQuadrants(md, dec, alcabitiusEast(place, asc, tanLatitude));
|
|
188
|
+
break;
|
|
189
|
+
default:
|
|
190
|
+
throw new RangeError(`Unknown house system ${String(name)}.`);
|
|
191
|
+
}
|
|
192
|
+
return mundane === null ? null : inCircle(mundane) / 30 + 1;
|
|
193
|
+
}
|
|
194
|
+
function coAscendants(input) {
|
|
195
|
+
const { ramc, latitude, obliquity } = placeOf(input);
|
|
196
|
+
const polar = obliqueLongitude(ramc + 270, latitude, obliquity);
|
|
197
|
+
return {
|
|
198
|
+
equatorialAscendant: obliqueLongitude(ramc + 90, 0, obliquity),
|
|
199
|
+
kochCoAscendant: normalize(polar + 180),
|
|
200
|
+
munkaseyCoAscendant: obliqueLongitude(ramc + 90, latitude >= 0 ? 90 - latitude : -90 - latitude, obliquity),
|
|
201
|
+
polarAscendant: polar
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
function obliqueRate(ascension, tanPole, obliquity) {
|
|
205
|
+
const a = ascension * DEG;
|
|
206
|
+
const e = obliquity * DEG;
|
|
207
|
+
const k = tanPole * Math.sin(e);
|
|
208
|
+
const across = Math.cos(a) * Math.cos(e) - k;
|
|
209
|
+
return (Math.cos(e) - k * Math.cos(a)) / (Math.sin(a) ** 2 + across * across);
|
|
210
|
+
}
|
|
211
|
+
function ascensionalRate(q, x) {
|
|
212
|
+
const sine = Math.sin(x * DEG);
|
|
213
|
+
return q * Math.cos(x * DEG) / Math.sqrt(1 - q * q * sine * sine);
|
|
214
|
+
}
|
|
215
|
+
function quadrantRates(asc, mc, c11, c12, c2, c3) {
|
|
216
|
+
return [asc, c2, c3, mc, c11, c12, asc, c2, c3, mc, c11, c12];
|
|
217
|
+
}
|
|
218
|
+
function placidusAscension(ramc, offset, m, q) {
|
|
219
|
+
const low = ramc + offset - 90 * m - 1;
|
|
220
|
+
const high = ramc + offset + 90 * m + 1;
|
|
221
|
+
const found = root(
|
|
222
|
+
(alpha) => alpha - ramc - offset - m * Math.asin(Math.min(1, Math.max(-1, q * Math.sin(alpha * DEG)))) * RAD,
|
|
223
|
+
low,
|
|
224
|
+
high
|
|
225
|
+
);
|
|
226
|
+
return found ?? (low + high) / 2;
|
|
227
|
+
}
|
|
228
|
+
function cuspRates(system, place, asc, ascRate, mcRate) {
|
|
229
|
+
const { ramc, latitude, obliquity } = place;
|
|
230
|
+
const tanLatitude = Math.tan(latitude * DEG);
|
|
231
|
+
const q = tanLatitude * Math.tan(obliquity * DEG);
|
|
232
|
+
const circles = (ascensions, tanPoles) => {
|
|
233
|
+
const [c11, c12, c2, c3] = ascensions.map((offset, index) => obliqueRate(ramc + offset, tanPoles[index], obliquity));
|
|
234
|
+
return quadrantRates(ascRate, mcRate, c11, c12, c2, c3);
|
|
235
|
+
};
|
|
236
|
+
switch (system) {
|
|
237
|
+
case "whole":
|
|
238
|
+
return Array.from({ length: 12 }, () => 0);
|
|
239
|
+
case "equal":
|
|
240
|
+
case "vehlow":
|
|
241
|
+
return Array.from({ length: 12 }, () => ascRate);
|
|
242
|
+
case "equal-mc":
|
|
243
|
+
return Array.from({ length: 12 }, () => mcRate);
|
|
244
|
+
case "porphyry": {
|
|
245
|
+
const third = (ascRate - mcRate) / 3;
|
|
246
|
+
return quadrantRates(ascRate, mcRate, mcRate + third, mcRate + 2 * third, ascRate - third, ascRate - 2 * third);
|
|
247
|
+
}
|
|
248
|
+
case "meridian":
|
|
249
|
+
return Array.from({ length: 12 }, (_, index) => obliqueRate(ramc + 90 + index * 30, 0, obliquity));
|
|
250
|
+
case "morinus": {
|
|
251
|
+
const cosine = Math.cos(obliquity * DEG);
|
|
252
|
+
return Array.from({ length: 12 }, (_, index) => {
|
|
253
|
+
const a = (ramc + 90 + index * 30) * DEG;
|
|
254
|
+
return cosine / (Math.cos(a) ** 2 + Math.sin(a) ** 2 * cosine * cosine);
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
case "regiomontanus": {
|
|
258
|
+
const near = tanLatitude * 0.5;
|
|
259
|
+
const far = tanLatitude * Math.cos(30 * DEG);
|
|
260
|
+
return circles([30, 60, 120, 150], [near, far, far, near]);
|
|
261
|
+
}
|
|
262
|
+
case "topocentric": {
|
|
263
|
+
const near = tanLatitude / 3;
|
|
264
|
+
const far = tanLatitude * 2 / 3;
|
|
265
|
+
return circles([30, 60, 120, 150], [near, far, far, near]);
|
|
266
|
+
}
|
|
267
|
+
case "campanus": {
|
|
268
|
+
const sine = Math.sin(latitude * DEG);
|
|
269
|
+
const cosine = Math.cos(latitude * DEG);
|
|
270
|
+
const near = Math.tan(Math.asin(sine / 2));
|
|
271
|
+
const far = Math.tan(Math.asin(Math.sqrt(3) / 2 * sine));
|
|
272
|
+
const wide = Math.atan(Math.sqrt(3) / cosine) * RAD;
|
|
273
|
+
const narrow = Math.atan(1 / (Math.sqrt(3) * cosine)) * RAD;
|
|
274
|
+
return circles([90 - wide, 90 - narrow, 90 + narrow, 90 + wide], [near, far, far, near]);
|
|
275
|
+
}
|
|
276
|
+
case "alcabitius": {
|
|
277
|
+
const e = obliquity * DEG;
|
|
278
|
+
const declination = Math.asin(Math.sin(e) * Math.sin(asc * DEG));
|
|
279
|
+
const u = -tanLatitude * Math.tan(declination);
|
|
280
|
+
const day = Math.acos(Math.min(1, Math.max(-1, u))) * RAD;
|
|
281
|
+
const tanRate = Math.sin(e) * Math.cos(asc * DEG) * ascRate / Math.cos(declination) ** 3;
|
|
282
|
+
const dayRate = Math.abs(u) < 1 ? tanLatitude * tanRate / Math.sqrt(1 - u * u) : 0;
|
|
283
|
+
const at = (ascension, share) => obliqueRate(ramc + ascension, 0, obliquity) * (1 + share * dayRate);
|
|
284
|
+
return quadrantRates(
|
|
285
|
+
ascRate,
|
|
286
|
+
mcRate,
|
|
287
|
+
at(day / 3, 1 / 3),
|
|
288
|
+
at(2 * day / 3, 2 / 3),
|
|
289
|
+
at(60 + 2 * day / 3, 2 / 3),
|
|
290
|
+
at(120 + day / 3, 1 / 3)
|
|
291
|
+
);
|
|
292
|
+
}
|
|
293
|
+
case "koch": {
|
|
294
|
+
if (Math.abs(latitude) >= 90 - obliquity) return null;
|
|
295
|
+
const third = (90 + Math.asin(q * Math.sin(ramc * DEG)) * RAD) / 3;
|
|
296
|
+
const thirdRate = ascensionalRate(q, ramc) / 3;
|
|
297
|
+
const at = (thirds) => obliqueRate(ramc + 90 + thirds * third, tanLatitude, obliquity) * (1 + thirds * thirdRate);
|
|
298
|
+
return quadrantRates(ascRate, mcRate, at(-2), at(-1), at(1), at(2));
|
|
299
|
+
}
|
|
300
|
+
case "placidus": {
|
|
301
|
+
if (Math.abs(latitude) >= 90 - obliquity) return null;
|
|
302
|
+
const cosine = Math.cos(obliquity * DEG);
|
|
303
|
+
const at = (offset, m) => {
|
|
304
|
+
const alpha = placidusAscension(ramc, offset, m, q);
|
|
305
|
+
const a = alpha * DEG;
|
|
306
|
+
const longitudeRate = cosine / (Math.sin(a) ** 2 + Math.cos(a) ** 2 * cosine * cosine);
|
|
307
|
+
return longitudeRate / (1 - m * ascensionalRate(q, alpha));
|
|
308
|
+
};
|
|
309
|
+
return quadrantRates(ascRate, mcRate, at(30, 1 / 3), at(60, 2 / 3), at(120, 2 / 3), at(150, 1 / 3));
|
|
310
|
+
}
|
|
311
|
+
default:
|
|
312
|
+
throw new RangeError(`Unknown house system ${String(system)}.`);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
function houseSpeeds(system, input) {
|
|
316
|
+
const name = systemOf(system);
|
|
317
|
+
const place = placeOf(input);
|
|
318
|
+
const { asc } = anglesOf(place);
|
|
319
|
+
const ascRate = obliqueRate(place.ramc + 90, Math.tan(place.latitude * DEG), place.obliquity);
|
|
320
|
+
const mcRate = obliqueRate(place.ramc, 0, place.obliquity);
|
|
321
|
+
const rates = cuspRates(name, place, asc, ascRate, mcRate);
|
|
322
|
+
const perDay = (rate) => rate * SIDEREAL_RATE;
|
|
323
|
+
const ascSpeed = perDay(ascRate);
|
|
324
|
+
const mcSpeed = perDay(mcRate);
|
|
325
|
+
return {
|
|
326
|
+
system: rates === null ? "whole" : name,
|
|
327
|
+
fellBack: rates === null,
|
|
328
|
+
cusps: rates === null ? Array.from({ length: 12 }, () => 0) : rates.map(perDay),
|
|
329
|
+
angles: { asc: ascSpeed, mc: mcSpeed, dsc: ascSpeed, ic: mcSpeed }
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
export {
|
|
333
|
+
SIDEREAL_RATE,
|
|
334
|
+
coAscendants,
|
|
335
|
+
housePosition,
|
|
336
|
+
houseSpeeds
|
|
337
|
+
};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { A as Angles, H as HouseSystem, a as Houses, b as HouseNumber } from './types-B4MCoCCS.js';
|
|
2
|
+
|
|
3
|
+
declare const HOUSE_SYSTEMS: readonly ["whole", "placidus", "porphyry", "equal", "equal-mc", "vehlow", "koch", "regiomontanus", "campanus", "topocentric", "alcabitius", "morinus", "meridian"];
|
|
4
|
+
/**
|
|
5
|
+
* The systems that are undefined inside the polar circle, |latitude| ≥ 90° − ε,
|
|
6
|
+
* where part of the ecliptic never rises or sets: Placidus and Koch both divide
|
|
7
|
+
* a semi-arc that no longer exists there.
|
|
8
|
+
*/
|
|
9
|
+
declare const POLAR_UNDEFINED_HOUSE_SYSTEMS: readonly ["placidus", "koch"];
|
|
10
|
+
/**
|
|
11
|
+
* The system Placidus and Koch fall back to where they are undefined. The chart
|
|
12
|
+
* then carries the `polar-fallback` flag. Swiss Ephemeris falls back to
|
|
13
|
+
* Porphyry there instead; ask for `"porphyry"` to get that system at any latitude.
|
|
14
|
+
*/
|
|
15
|
+
declare const POLAR_FALLBACK: "whole";
|
|
16
|
+
/** The system Placidus falls back to; the same as {@link POLAR_FALLBACK}. */
|
|
17
|
+
declare const PLACIDUS_POLAR_FALLBACK: "whole";
|
|
18
|
+
/** Whether `system` is one that falls back inside the polar circle. */
|
|
19
|
+
declare function isPolarUndefinedHouseSystem(system: HouseSystem): boolean;
|
|
20
|
+
/** Mean obliquity of the ecliptic (IAU 2006), in degrees. */
|
|
21
|
+
declare function meanObliquity(julianCenturies: number): number;
|
|
22
|
+
interface AngleInput {
|
|
23
|
+
/** Greenwich apparent sidereal time, in hours. */
|
|
24
|
+
gastHours: number;
|
|
25
|
+
latitude: number;
|
|
26
|
+
/** East-positive longitude, in degrees. */
|
|
27
|
+
longitude: number;
|
|
28
|
+
obliquity: number;
|
|
29
|
+
}
|
|
30
|
+
declare function ramcOf(input: Pick<AngleInput, "gastHours" | "longitude">): number;
|
|
31
|
+
declare function computeAngles(input: AngleInput): Angles;
|
|
32
|
+
declare function wholeSignCusps(ascendant: number): number[];
|
|
33
|
+
/**
|
|
34
|
+
* Placidus intermediate cusps using iterative semi-arc trisection.
|
|
35
|
+
* Returns `null` inside the polar circle, |latitude| ≥ 90° − ε, where part of
|
|
36
|
+
* the ecliptic never rises or sets and the semi-arcs are undefined.
|
|
37
|
+
*
|
|
38
|
+
* Each cusp's right ascension α solves α = RAMC + offset + m·AD(α), with AD
|
|
39
|
+
* the ascensional difference asin(tan φ tan δ(α)) and m = 1/3 or 2/3. With
|
|
40
|
+
* tan δ = tan ε sin α, |dAD/dα| <= q = |tan φ| tan ε < 1 outside the polar
|
|
41
|
+
* circle, so the map is a contraction with slope at most 2q/3. The iteration
|
|
42
|
+
* settles to 1e-9° within 64 steps except within about 1e-8° of the polar
|
|
43
|
+
* limit, near the sidereal times at which a cusp's right ascension reaches 90°
|
|
44
|
+
* or 270°: it needs up to 63 steps there, and the rounding of asin near ±1
|
|
45
|
+
* moves each step by about the tolerance. Where it does not settle, the cusp
|
|
46
|
+
* is found by bisection on RAMC + offset ± (90° m + 1°), across which
|
|
47
|
+
* α − RAMC − offset − m·AD(α) increases strictly, so below the limit Placidus
|
|
48
|
+
* never falls back. Near the limit, either way, a cusp carries the rounding of
|
|
49
|
+
* asin near ±1: up to 6.5e-7° one unit in the last place below it.
|
|
50
|
+
*/
|
|
51
|
+
declare function placidusCusps(input: AngleInput, angles: Angles): number[] | null;
|
|
52
|
+
/**
|
|
53
|
+
* Porphyry cusps: each quadrant between the angles, measured in ecliptic
|
|
54
|
+
* longitude, divided into three equal parts. Defined wherever the angles are.
|
|
55
|
+
*/
|
|
56
|
+
declare function porphyryCusps(angles: Angles): number[];
|
|
57
|
+
/** Equal houses: thirty degrees each, the first beginning at the ascendant. */
|
|
58
|
+
declare function equalCusps(angles: Angles): number[];
|
|
59
|
+
/**
|
|
60
|
+
* Equal houses from the midheaven: thirty degrees each, the 10th beginning at
|
|
61
|
+
* the midheaven, so the 1st begins 90° past it. Neither the ascendant nor the
|
|
62
|
+
* latitude enters, so the system is the same at every latitude.
|
|
63
|
+
*/
|
|
64
|
+
declare function equalMcCusps(angles: Angles): number[];
|
|
65
|
+
/** Vehlow's equal houses: thirty degrees each, with the ascendant in the middle of the first. */
|
|
66
|
+
declare function vehlowCusps(angles: Angles): number[];
|
|
67
|
+
/**
|
|
68
|
+
* Koch (birthplace) cusps: the ascendants at the sidereal times when the
|
|
69
|
+
* midheaven degree has run a third and two thirds of its diurnal semi-arc,
|
|
70
|
+
* before and after culmination. Returns `null` inside the polar circle, where
|
|
71
|
+
* that semi-arc is undefined for part of the ecliptic.
|
|
72
|
+
*/
|
|
73
|
+
declare function kochCusps(input: AngleInput, angles: Angles): number[] | null;
|
|
74
|
+
/**
|
|
75
|
+
* Regiomontanus cusps: house circles through the north and south points of
|
|
76
|
+
* the horizon that divide the celestial equator into arcs of 30°.
|
|
77
|
+
*/
|
|
78
|
+
declare function regiomontanusCusps(input: AngleInput, angles: Angles): number[];
|
|
79
|
+
/**
|
|
80
|
+
* Campanus cusps: house circles through the north and south points of the
|
|
81
|
+
* horizon that divide the prime vertical into arcs of 30°.
|
|
82
|
+
*/
|
|
83
|
+
declare function campanusCusps(input: AngleInput, angles: Angles): number[];
|
|
84
|
+
/**
|
|
85
|
+
* Topocentric (Polich–Page) cusps: the Regiomontanus ascensions with pole
|
|
86
|
+
* heights whose tangents are a third and two thirds of the latitude's.
|
|
87
|
+
*/
|
|
88
|
+
declare function topocentricCusps(input: AngleInput, angles: Angles): number[];
|
|
89
|
+
/**
|
|
90
|
+
* Alcabitius cusps: the ascendant's diurnal and nocturnal semi-arcs, divided
|
|
91
|
+
* into thirds on the equator and carried to the ecliptic along hour circles.
|
|
92
|
+
*/
|
|
93
|
+
declare function alcabitiusCusps(input: AngleInput, angles: Angles): number[];
|
|
94
|
+
/**
|
|
95
|
+
* Meridian (axial rotation) cusps: the ecliptic points whose right ascensions
|
|
96
|
+
* divide the equator into 30° arcs from the midheaven's. The 10th cusp is the
|
|
97
|
+
* midheaven; the 1st is the equatorial ascendant, not the ascendant.
|
|
98
|
+
*/
|
|
99
|
+
declare function meridianCusps(input: AngleInput): number[];
|
|
100
|
+
/**
|
|
101
|
+
* Morinus cusps: the equator divided into 30° arcs from the midheaven's right
|
|
102
|
+
* ascension, each point carried to the ecliptic along a circle through the
|
|
103
|
+
* ecliptic poles. Neither the ascendant nor the midheaven is a cusp.
|
|
104
|
+
*/
|
|
105
|
+
declare function morinusCusps(input: AngleInput): number[];
|
|
106
|
+
/**
|
|
107
|
+
* The East Point, or equatorial ascendant: the ecliptic point rising where the
|
|
108
|
+
* celestial equator meets the eastern horizon, with right ascension RAMC + 90°.
|
|
109
|
+
* It depends on the sidereal time and the obliquity, not on the latitude.
|
|
110
|
+
*/
|
|
111
|
+
declare function eastPointOf(input: AngleInput): number;
|
|
112
|
+
/**
|
|
113
|
+
* The Vertex: where the prime vertical, the great circle through the zenith
|
|
114
|
+
* and the east and west points, meets the ecliptic in the west. It is the
|
|
115
|
+
* descendant of the colatitude, taken on the western side of the meridian. At
|
|
116
|
+
* the equator the prime vertical is the celestial equator, and the Vertex is
|
|
117
|
+
* the equinox west of the meridian. Where the ecliptic passes through the
|
|
118
|
+
* zenith, the two circles meet on the meridian and neither point is west.
|
|
119
|
+
*/
|
|
120
|
+
declare function vertexOf(input: AngleInput, angles: Angles): number;
|
|
121
|
+
declare function computeHouses(system: HouseSystem, input: AngleInput, angles: Angles): {
|
|
122
|
+
houses: Houses;
|
|
123
|
+
fellBack: boolean;
|
|
124
|
+
fallbackSystem: HouseSystem | null;
|
|
125
|
+
};
|
|
126
|
+
declare function houseOf(longitude: number, cusps: readonly number[]): HouseNumber;
|
|
127
|
+
|
|
128
|
+
export { type AngleInput as A, HOUSE_SYSTEMS as H, PLACIDUS_POLAR_FALLBACK as P, POLAR_FALLBACK as a, POLAR_UNDEFINED_HOUSE_SYSTEMS as b, alcabitiusCusps as c, campanusCusps as d, computeAngles as e, computeHouses as f, eastPointOf as g, equalCusps as h, equalMcCusps as i, houseOf as j, isPolarUndefinedHouseSystem as k, kochCusps as l, meanObliquity as m, meridianCusps as n, morinusCusps as o, placidusCusps as p, porphyryCusps as q, ramcOf as r, regiomontanusCusps as s, topocentricCusps as t, vertexOf as u, vehlowCusps as v, wholeSignCusps as w };
|