kaabalah 5.1.1 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -1
- package/dist/astrology/index.d.mts +66 -1
- package/dist/astrology/index.d.ts +66 -1
- package/dist/astrology/index.js +42 -14
- package/dist/astrology/index.mjs +1 -1
- package/dist/{chunk-A5ME4PFX.mjs → chunk-CYWQV2RL.mjs} +151 -4
- package/dist/chunk-CYWQV2RL.mjs.map +1 -0
- package/dist/{chunk-7AXRFYPX.js → chunk-IAKSKHGA.js} +157 -3
- package/dist/chunk-IAKSKHGA.js.map +1 -0
- package/dist/cli.js +209 -0
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +209 -0
- package/dist/cli.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +42 -14
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-7AXRFYPX.js.map +0 -1
- package/dist/chunk-A5ME4PFX.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -93,7 +93,9 @@ npx kaabalah help
|
|
|
93
93
|
| `numerology:cycles <date> [name]` | Personal cycles (year, month, periods) |
|
|
94
94
|
| `numerology:challenges <date>` | Challenges from birth date |
|
|
95
95
|
| `numerology:fibonacci <date>` | Fibonacci cycle for current age |
|
|
96
|
-
| `astrology <date> [time]` | Calculate birth chart using Swiss Ephemeris |
|
|
96
|
+
| `astrology <date> [time]` | Calculate birth chart with aspects using Swiss Ephemeris |
|
|
97
|
+
| `astrology:synastry` | Cross-chart aspects between two birth charts (via `--input-json`) |
|
|
98
|
+
| `astrology:composite` | Midpoint composite chart from two birth charts (via `--input-json`) |
|
|
97
99
|
| `tarot [count]` | Draw tarot cards (default: 3) |
|
|
98
100
|
| `tarot:card <number>` | Look up a specific card (1-78) |
|
|
99
101
|
| `ifa <date>` | Calculate Odu from a date |
|
|
@@ -114,6 +116,12 @@ kaabalah ifa 1990-01-15
|
|
|
114
116
|
kaabalah astrology 1990-01-15 14:30 --lat=40.7128 --lon=-74.006
|
|
115
117
|
kaabalah astrology 1990-01-15 14:30 --location="New York, USA"
|
|
116
118
|
|
|
119
|
+
# Synastry (cross-chart aspects)
|
|
120
|
+
kaabalah astrology:synastry --input-json='{"chartA":{"date":"2001-10-02","time":"19:45","lat":-22.74,"lon":-47.33,"timezone":"America/Sao_Paulo"},"chartB":{"date":"1999-02-01","time":"14:30","lat":-23.96,"lon":-46.33,"timezone":"America/Sao_Paulo"}}' --json
|
|
121
|
+
|
|
122
|
+
# Composite (midpoint chart)
|
|
123
|
+
kaabalah astrology:composite --input-json='{"chartA":{"date":"2001-10-02","time":"19:45","lat":-22.74,"lon":-47.33},"chartB":{"date":"1999-02-01","time":"14:30","lat":-23.96,"lon":-46.33}}' --json
|
|
124
|
+
|
|
117
125
|
# Tree of Life correspondences
|
|
118
126
|
kaabalah tree:node path:1 --json
|
|
119
127
|
kaabalah tree:node "tarotArkAnnu:The Magician" --depth=2 --json
|
|
@@ -118,6 +118,42 @@ type TimeZoneOptions = {
|
|
|
118
118
|
treatAsUTC?: boolean;
|
|
119
119
|
};
|
|
120
120
|
|
|
121
|
+
type AspectName = "conjunction" | "duodecile" | "octile" | "sextile" | "square" | "trine" | "trioctile" | "quincunx" | "opposition";
|
|
122
|
+
interface AspectSpec {
|
|
123
|
+
name: AspectName;
|
|
124
|
+
angle: number;
|
|
125
|
+
orb: number;
|
|
126
|
+
}
|
|
127
|
+
declare const DEFAULT_ASPECT_SPECS: AspectSpec[];
|
|
128
|
+
interface AspectEdge {
|
|
129
|
+
planetA: string;
|
|
130
|
+
planetB: string;
|
|
131
|
+
longitudeA: number;
|
|
132
|
+
longitudeB: number;
|
|
133
|
+
aspect: AspectName;
|
|
134
|
+
aspectAngle: number;
|
|
135
|
+
delta: number;
|
|
136
|
+
orb: number;
|
|
137
|
+
}
|
|
138
|
+
declare function getAspectMatch(lonA: number, lonB: number, specs?: AspectSpec[]): {
|
|
139
|
+
spec: AspectSpec;
|
|
140
|
+
orb: number;
|
|
141
|
+
delta: number;
|
|
142
|
+
} | null;
|
|
143
|
+
declare function computeAspects(planets: Record<string, {
|
|
144
|
+
longitude: number;
|
|
145
|
+
}>, specs?: AspectSpec[]): AspectEdge[];
|
|
146
|
+
declare function computeSynastryAspects(planetsA: Record<string, {
|
|
147
|
+
longitude: number;
|
|
148
|
+
}>, planetsB: Record<string, {
|
|
149
|
+
longitude: number;
|
|
150
|
+
}>, specs?: AspectSpec[]): AspectEdge[];
|
|
151
|
+
declare function computeMidpoints(planetsA: Record<string, {
|
|
152
|
+
longitude: number;
|
|
153
|
+
}>, planetsB: Record<string, {
|
|
154
|
+
longitude: number;
|
|
155
|
+
}>): Record<string, number>;
|
|
156
|
+
|
|
121
157
|
/**
|
|
122
158
|
* Astrological calculations using Swiss Ephemeris
|
|
123
159
|
*/
|
|
@@ -165,6 +201,7 @@ interface BirthChart {
|
|
|
165
201
|
polasc?: ZodiacPosition;
|
|
166
202
|
};
|
|
167
203
|
};
|
|
204
|
+
aspects: AspectEdge[];
|
|
168
205
|
}
|
|
169
206
|
/**
|
|
170
207
|
* Calculate a birth chart using Swiss Ephemeris
|
|
@@ -189,5 +226,33 @@ declare function formatDegreeMinutes(decimalDegrees: number): string;
|
|
|
189
226
|
*/
|
|
190
227
|
declare function getZodiacPosition(longitude: number, houseCusps: number[]): ZodiacPosition;
|
|
191
228
|
declare function findHouseOf(longitude: number, housePositions: number[]): number;
|
|
229
|
+
interface SynastryChartOptions {
|
|
230
|
+
chartA: BirthChartOptions;
|
|
231
|
+
chartB: BirthChartOptions;
|
|
232
|
+
aspectSpecs?: AspectSpec[];
|
|
233
|
+
}
|
|
234
|
+
interface SynastryChart {
|
|
235
|
+
chartA: BirthChart;
|
|
236
|
+
chartB: BirthChart;
|
|
237
|
+
aspects: AspectEdge[];
|
|
238
|
+
}
|
|
239
|
+
declare function getSynastryChart(options: SynastryChartOptions): Promise<SynastryChart>;
|
|
240
|
+
interface CompositeChartOptions {
|
|
241
|
+
chartA: BirthChartOptions;
|
|
242
|
+
chartB: BirthChartOptions;
|
|
243
|
+
aspectSpecs?: AspectSpec[];
|
|
244
|
+
}
|
|
245
|
+
interface CompositeChart {
|
|
246
|
+
chartA: BirthChart;
|
|
247
|
+
chartB: BirthChart;
|
|
248
|
+
compositePlanets: Record<string, {
|
|
249
|
+
name: string;
|
|
250
|
+
longitude: number;
|
|
251
|
+
zodiacPosition: ZodiacPosition;
|
|
252
|
+
}>;
|
|
253
|
+
compositeHouses: ZodiacPosition[];
|
|
254
|
+
aspects: AspectEdge[];
|
|
255
|
+
}
|
|
256
|
+
declare function getCompositeChart(options: CompositeChartOptions): Promise<CompositeChart>;
|
|
192
257
|
|
|
193
|
-
export { type BirthChart, type BirthChartOptions, CalcFlag, HouseSystem, type HydratedNode, type HydratedPlanet, PLANET_AND_NODE_NAMES, Planet, SIGNS, VirtualNodes, type ZodiacPosition, closeSwissEph, findHouseOf, formatDegreeMinutes, getBirthChart, getSwissEph, getZodiacPosition, normalizeAngle };
|
|
258
|
+
export { type AspectEdge, type AspectName, type AspectSpec, type BirthChart, type BirthChartOptions, CalcFlag, type CompositeChart, type CompositeChartOptions, DEFAULT_ASPECT_SPECS, HouseSystem, type HydratedNode, type HydratedPlanet, PLANET_AND_NODE_NAMES, Planet, SIGNS, type SynastryChart, type SynastryChartOptions, VirtualNodes, type ZodiacPosition, closeSwissEph, computeAspects, computeMidpoints, computeSynastryAspects, findHouseOf, formatDegreeMinutes, getAspectMatch, getBirthChart, getCompositeChart, getSwissEph, getSynastryChart, getZodiacPosition, normalizeAngle };
|
|
@@ -118,6 +118,42 @@ type TimeZoneOptions = {
|
|
|
118
118
|
treatAsUTC?: boolean;
|
|
119
119
|
};
|
|
120
120
|
|
|
121
|
+
type AspectName = "conjunction" | "duodecile" | "octile" | "sextile" | "square" | "trine" | "trioctile" | "quincunx" | "opposition";
|
|
122
|
+
interface AspectSpec {
|
|
123
|
+
name: AspectName;
|
|
124
|
+
angle: number;
|
|
125
|
+
orb: number;
|
|
126
|
+
}
|
|
127
|
+
declare const DEFAULT_ASPECT_SPECS: AspectSpec[];
|
|
128
|
+
interface AspectEdge {
|
|
129
|
+
planetA: string;
|
|
130
|
+
planetB: string;
|
|
131
|
+
longitudeA: number;
|
|
132
|
+
longitudeB: number;
|
|
133
|
+
aspect: AspectName;
|
|
134
|
+
aspectAngle: number;
|
|
135
|
+
delta: number;
|
|
136
|
+
orb: number;
|
|
137
|
+
}
|
|
138
|
+
declare function getAspectMatch(lonA: number, lonB: number, specs?: AspectSpec[]): {
|
|
139
|
+
spec: AspectSpec;
|
|
140
|
+
orb: number;
|
|
141
|
+
delta: number;
|
|
142
|
+
} | null;
|
|
143
|
+
declare function computeAspects(planets: Record<string, {
|
|
144
|
+
longitude: number;
|
|
145
|
+
}>, specs?: AspectSpec[]): AspectEdge[];
|
|
146
|
+
declare function computeSynastryAspects(planetsA: Record<string, {
|
|
147
|
+
longitude: number;
|
|
148
|
+
}>, planetsB: Record<string, {
|
|
149
|
+
longitude: number;
|
|
150
|
+
}>, specs?: AspectSpec[]): AspectEdge[];
|
|
151
|
+
declare function computeMidpoints(planetsA: Record<string, {
|
|
152
|
+
longitude: number;
|
|
153
|
+
}>, planetsB: Record<string, {
|
|
154
|
+
longitude: number;
|
|
155
|
+
}>): Record<string, number>;
|
|
156
|
+
|
|
121
157
|
/**
|
|
122
158
|
* Astrological calculations using Swiss Ephemeris
|
|
123
159
|
*/
|
|
@@ -165,6 +201,7 @@ interface BirthChart {
|
|
|
165
201
|
polasc?: ZodiacPosition;
|
|
166
202
|
};
|
|
167
203
|
};
|
|
204
|
+
aspects: AspectEdge[];
|
|
168
205
|
}
|
|
169
206
|
/**
|
|
170
207
|
* Calculate a birth chart using Swiss Ephemeris
|
|
@@ -189,5 +226,33 @@ declare function formatDegreeMinutes(decimalDegrees: number): string;
|
|
|
189
226
|
*/
|
|
190
227
|
declare function getZodiacPosition(longitude: number, houseCusps: number[]): ZodiacPosition;
|
|
191
228
|
declare function findHouseOf(longitude: number, housePositions: number[]): number;
|
|
229
|
+
interface SynastryChartOptions {
|
|
230
|
+
chartA: BirthChartOptions;
|
|
231
|
+
chartB: BirthChartOptions;
|
|
232
|
+
aspectSpecs?: AspectSpec[];
|
|
233
|
+
}
|
|
234
|
+
interface SynastryChart {
|
|
235
|
+
chartA: BirthChart;
|
|
236
|
+
chartB: BirthChart;
|
|
237
|
+
aspects: AspectEdge[];
|
|
238
|
+
}
|
|
239
|
+
declare function getSynastryChart(options: SynastryChartOptions): Promise<SynastryChart>;
|
|
240
|
+
interface CompositeChartOptions {
|
|
241
|
+
chartA: BirthChartOptions;
|
|
242
|
+
chartB: BirthChartOptions;
|
|
243
|
+
aspectSpecs?: AspectSpec[];
|
|
244
|
+
}
|
|
245
|
+
interface CompositeChart {
|
|
246
|
+
chartA: BirthChart;
|
|
247
|
+
chartB: BirthChart;
|
|
248
|
+
compositePlanets: Record<string, {
|
|
249
|
+
name: string;
|
|
250
|
+
longitude: number;
|
|
251
|
+
zodiacPosition: ZodiacPosition;
|
|
252
|
+
}>;
|
|
253
|
+
compositeHouses: ZodiacPosition[];
|
|
254
|
+
aspects: AspectEdge[];
|
|
255
|
+
}
|
|
256
|
+
declare function getCompositeChart(options: CompositeChartOptions): Promise<CompositeChart>;
|
|
192
257
|
|
|
193
|
-
export { type BirthChart, type BirthChartOptions, CalcFlag, HouseSystem, type HydratedNode, type HydratedPlanet, PLANET_AND_NODE_NAMES, Planet, SIGNS, VirtualNodes, type ZodiacPosition, closeSwissEph, findHouseOf, formatDegreeMinutes, getBirthChart, getSwissEph, getZodiacPosition, normalizeAngle };
|
|
258
|
+
export { type AspectEdge, type AspectName, type AspectSpec, type BirthChart, type BirthChartOptions, CalcFlag, type CompositeChart, type CompositeChartOptions, DEFAULT_ASPECT_SPECS, HouseSystem, type HydratedNode, type HydratedPlanet, PLANET_AND_NODE_NAMES, Planet, SIGNS, type SynastryChart, type SynastryChartOptions, VirtualNodes, type ZodiacPosition, closeSwissEph, computeAspects, computeMidpoints, computeSynastryAspects, findHouseOf, formatDegreeMinutes, getAspectMatch, getBirthChart, getCompositeChart, getSwissEph, getSynastryChart, getZodiacPosition, normalizeAngle };
|
package/dist/astrology/index.js
CHANGED
|
@@ -1,61 +1,89 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkIAKSKHGA_js = require('../chunk-IAKSKHGA.js');
|
|
4
4
|
require('../chunk-FM7WUVZV.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "CalcFlag", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkIAKSKHGA_js.CalcFlag; }
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "DEFAULT_ASPECT_SPECS", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return chunkIAKSKHGA_js.DEFAULT_ASPECT_SPECS; }
|
|
11
15
|
});
|
|
12
16
|
Object.defineProperty(exports, "HouseSystem", {
|
|
13
17
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunkIAKSKHGA_js.HouseSystem; }
|
|
15
19
|
});
|
|
16
20
|
Object.defineProperty(exports, "PLANET_AND_NODE_NAMES", {
|
|
17
21
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunkIAKSKHGA_js.PLANET_AND_NODE_NAMES; }
|
|
19
23
|
});
|
|
20
24
|
Object.defineProperty(exports, "Planet", {
|
|
21
25
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunkIAKSKHGA_js.Planet; }
|
|
23
27
|
});
|
|
24
28
|
Object.defineProperty(exports, "SIGNS", {
|
|
25
29
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
30
|
+
get: function () { return chunkIAKSKHGA_js.SIGNS; }
|
|
27
31
|
});
|
|
28
32
|
Object.defineProperty(exports, "VirtualNodes", {
|
|
29
33
|
enumerable: true,
|
|
30
|
-
get: function () { return
|
|
34
|
+
get: function () { return chunkIAKSKHGA_js.VirtualNodes; }
|
|
31
35
|
});
|
|
32
36
|
Object.defineProperty(exports, "closeSwissEph", {
|
|
33
37
|
enumerable: true,
|
|
34
|
-
get: function () { return
|
|
38
|
+
get: function () { return chunkIAKSKHGA_js.closeSwissEph; }
|
|
39
|
+
});
|
|
40
|
+
Object.defineProperty(exports, "computeAspects", {
|
|
41
|
+
enumerable: true,
|
|
42
|
+
get: function () { return chunkIAKSKHGA_js.computeAspects; }
|
|
43
|
+
});
|
|
44
|
+
Object.defineProperty(exports, "computeMidpoints", {
|
|
45
|
+
enumerable: true,
|
|
46
|
+
get: function () { return chunkIAKSKHGA_js.computeMidpoints; }
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports, "computeSynastryAspects", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () { return chunkIAKSKHGA_js.computeSynastryAspects; }
|
|
35
51
|
});
|
|
36
52
|
Object.defineProperty(exports, "findHouseOf", {
|
|
37
53
|
enumerable: true,
|
|
38
|
-
get: function () { return
|
|
54
|
+
get: function () { return chunkIAKSKHGA_js.findHouseOf; }
|
|
39
55
|
});
|
|
40
56
|
Object.defineProperty(exports, "formatDegreeMinutes", {
|
|
41
57
|
enumerable: true,
|
|
42
|
-
get: function () { return
|
|
58
|
+
get: function () { return chunkIAKSKHGA_js.formatDegreeMinutes; }
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(exports, "getAspectMatch", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function () { return chunkIAKSKHGA_js.getAspectMatch; }
|
|
43
63
|
});
|
|
44
64
|
Object.defineProperty(exports, "getBirthChart", {
|
|
45
65
|
enumerable: true,
|
|
46
|
-
get: function () { return
|
|
66
|
+
get: function () { return chunkIAKSKHGA_js.getBirthChart; }
|
|
67
|
+
});
|
|
68
|
+
Object.defineProperty(exports, "getCompositeChart", {
|
|
69
|
+
enumerable: true,
|
|
70
|
+
get: function () { return chunkIAKSKHGA_js.getCompositeChart; }
|
|
47
71
|
});
|
|
48
72
|
Object.defineProperty(exports, "getSwissEph", {
|
|
49
73
|
enumerable: true,
|
|
50
|
-
get: function () { return
|
|
74
|
+
get: function () { return chunkIAKSKHGA_js.getSwissEph; }
|
|
75
|
+
});
|
|
76
|
+
Object.defineProperty(exports, "getSynastryChart", {
|
|
77
|
+
enumerable: true,
|
|
78
|
+
get: function () { return chunkIAKSKHGA_js.getSynastryChart; }
|
|
51
79
|
});
|
|
52
80
|
Object.defineProperty(exports, "getZodiacPosition", {
|
|
53
81
|
enumerable: true,
|
|
54
|
-
get: function () { return
|
|
82
|
+
get: function () { return chunkIAKSKHGA_js.getZodiacPosition; }
|
|
55
83
|
});
|
|
56
84
|
Object.defineProperty(exports, "normalizeAngle", {
|
|
57
85
|
enumerable: true,
|
|
58
|
-
get: function () { return
|
|
86
|
+
get: function () { return chunkIAKSKHGA_js.normalizeAngle; }
|
|
59
87
|
});
|
|
60
88
|
//# sourceMappingURL=index.js.map
|
|
61
89
|
//# sourceMappingURL=index.js.map
|
package/dist/astrology/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { CalcFlag, HouseSystem, PLANET_AND_NODE_NAMES, Planet, SIGNS, VirtualNodes, closeSwissEph, findHouseOf, formatDegreeMinutes, getBirthChart, getSwissEph, getZodiacPosition, normalizeAngle } from '../chunk-
|
|
1
|
+
export { CalcFlag, DEFAULT_ASPECT_SPECS, HouseSystem, PLANET_AND_NODE_NAMES, Planet, SIGNS, VirtualNodes, closeSwissEph, computeAspects, computeMidpoints, computeSynastryAspects, findHouseOf, formatDegreeMinutes, getAspectMatch, getBirthChart, getCompositeChart, getSwissEph, getSynastryChart, getZodiacPosition, normalizeAngle } from '../chunk-CYWQV2RL.mjs';
|
|
2
2
|
import '../chunk-WY6NIR2V.mjs';
|
|
3
3
|
//# sourceMappingURL=index.mjs.map
|
|
4
4
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -599,6 +599,96 @@ async function toUtcDate(local, latitude, longitude, options = {}) {
|
|
|
599
599
|
return localToUtcDate(local, latitude, longitude, options);
|
|
600
600
|
}
|
|
601
601
|
|
|
602
|
+
// src/astrology/aspects.ts
|
|
603
|
+
var DEFAULT_ASPECT_SPECS = [
|
|
604
|
+
{ name: "conjunction", angle: 0, orb: 8 },
|
|
605
|
+
{ name: "duodecile", angle: 30, orb: 2 },
|
|
606
|
+
{ name: "octile", angle: 45, orb: 3 },
|
|
607
|
+
{ name: "sextile", angle: 60, orb: 5 },
|
|
608
|
+
{ name: "square", angle: 90, orb: 6 },
|
|
609
|
+
{ name: "trine", angle: 120, orb: 7 },
|
|
610
|
+
{ name: "trioctile", angle: 135, orb: 3 },
|
|
611
|
+
{ name: "quincunx", angle: 150, orb: 3 },
|
|
612
|
+
{ name: "opposition", angle: 180, orb: 8 }
|
|
613
|
+
];
|
|
614
|
+
function getAspectMatch(lonA, lonB, specs = DEFAULT_ASPECT_SPECS) {
|
|
615
|
+
const a = normalizeAngle(lonA);
|
|
616
|
+
const b = normalizeAngle(lonB);
|
|
617
|
+
const delta = Math.min(
|
|
618
|
+
normalizeAngle(b - a),
|
|
619
|
+
normalizeAngle(a - b)
|
|
620
|
+
);
|
|
621
|
+
for (const spec of specs) {
|
|
622
|
+
const orb = Math.abs(delta - spec.angle);
|
|
623
|
+
if (orb <= spec.orb) {
|
|
624
|
+
return { spec, orb, delta };
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
return null;
|
|
628
|
+
}
|
|
629
|
+
function computeAspects(planets, specs = DEFAULT_ASPECT_SPECS) {
|
|
630
|
+
const keys = Object.keys(planets);
|
|
631
|
+
const edges = [];
|
|
632
|
+
for (let i = 0; i < keys.length; i++) {
|
|
633
|
+
for (let j = i + 1; j < keys.length; j++) {
|
|
634
|
+
const a = planets[keys[i]];
|
|
635
|
+
const b = planets[keys[j]];
|
|
636
|
+
const match = getAspectMatch(a.longitude, b.longitude, specs);
|
|
637
|
+
if (match) {
|
|
638
|
+
edges.push({
|
|
639
|
+
planetA: keys[i],
|
|
640
|
+
planetB: keys[j],
|
|
641
|
+
longitudeA: a.longitude,
|
|
642
|
+
longitudeB: b.longitude,
|
|
643
|
+
aspect: match.spec.name,
|
|
644
|
+
aspectAngle: match.spec.angle,
|
|
645
|
+
delta: match.delta,
|
|
646
|
+
orb: match.orb
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
return edges;
|
|
652
|
+
}
|
|
653
|
+
function computeSynastryAspects(planetsA, planetsB, specs = DEFAULT_ASPECT_SPECS) {
|
|
654
|
+
const keysA = Object.keys(planetsA);
|
|
655
|
+
const keysB = Object.keys(planetsB);
|
|
656
|
+
const edges = [];
|
|
657
|
+
for (const kA of keysA) {
|
|
658
|
+
for (const kB of keysB) {
|
|
659
|
+
const a = planetsA[kA];
|
|
660
|
+
const b = planetsB[kB];
|
|
661
|
+
const match = getAspectMatch(a.longitude, b.longitude, specs);
|
|
662
|
+
if (match) {
|
|
663
|
+
edges.push({
|
|
664
|
+
planetA: kA,
|
|
665
|
+
planetB: kB,
|
|
666
|
+
longitudeA: a.longitude,
|
|
667
|
+
longitudeB: b.longitude,
|
|
668
|
+
aspect: match.spec.name,
|
|
669
|
+
aspectAngle: match.spec.angle,
|
|
670
|
+
delta: match.delta,
|
|
671
|
+
orb: match.orb
|
|
672
|
+
});
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
return edges;
|
|
677
|
+
}
|
|
678
|
+
function computeMidpoints(planetsA, planetsB) {
|
|
679
|
+
const result = {};
|
|
680
|
+
for (const key of Object.keys(planetsA)) {
|
|
681
|
+
if (!(key in planetsB)) continue;
|
|
682
|
+
const a = planetsA[key].longitude;
|
|
683
|
+
const b = planetsB[key].longitude;
|
|
684
|
+
let diff = b - a;
|
|
685
|
+
if (diff > 180) diff -= 360;
|
|
686
|
+
if (diff < -180) diff += 360;
|
|
687
|
+
result[key] = normalizeAngle(a + diff / 2);
|
|
688
|
+
}
|
|
689
|
+
return result;
|
|
690
|
+
}
|
|
691
|
+
|
|
602
692
|
// src/astrology/index.ts
|
|
603
693
|
function validateInputs(options) {
|
|
604
694
|
if (!(options.date instanceof Date) || isNaN(options.date.getTime())) {
|
|
@@ -690,11 +780,16 @@ async function getBirthChart(options) {
|
|
|
690
780
|
name: PLANET_AND_NODE_NAMES["parsFortunae" /* PARS_FORTUNAE */]
|
|
691
781
|
}
|
|
692
782
|
};
|
|
783
|
+
const allPoints = { ...planets };
|
|
784
|
+
allPoints["ascendant"] = { longitude: houses.ascendant.longitude };
|
|
785
|
+
allPoints["mc"] = { longitude: houses.mc.longitude };
|
|
786
|
+
const aspects = computeAspects(allPoints);
|
|
693
787
|
return {
|
|
694
788
|
dateUtc: utcDate,
|
|
695
789
|
planets,
|
|
696
790
|
houses,
|
|
697
|
-
nodes
|
|
791
|
+
nodes,
|
|
792
|
+
aspects
|
|
698
793
|
};
|
|
699
794
|
} catch (error) {
|
|
700
795
|
console.error("Error calculating birth chart:", error);
|
|
@@ -754,7 +849,59 @@ function findHouseOf(longitude, housePositions) {
|
|
|
754
849
|
}
|
|
755
850
|
return 1;
|
|
756
851
|
}
|
|
852
|
+
function getAspectPoints(chart) {
|
|
853
|
+
const points = {};
|
|
854
|
+
for (const [k, v] of Object.entries(chart.planets)) {
|
|
855
|
+
points[k] = v;
|
|
856
|
+
}
|
|
857
|
+
points["ascendant"] = { longitude: chart.houses.ascendant.longitude };
|
|
858
|
+
points["mc"] = { longitude: chart.houses.mc.longitude };
|
|
859
|
+
return points;
|
|
860
|
+
}
|
|
861
|
+
async function getSynastryChart(options) {
|
|
862
|
+
const chartA = await getBirthChart(options.chartA);
|
|
863
|
+
const chartB = await getBirthChart(options.chartB);
|
|
864
|
+
const aspects = computeSynastryAspects(
|
|
865
|
+
getAspectPoints(chartA),
|
|
866
|
+
getAspectPoints(chartB),
|
|
867
|
+
options.aspectSpecs
|
|
868
|
+
);
|
|
869
|
+
return { chartA, chartB, aspects };
|
|
870
|
+
}
|
|
871
|
+
async function getCompositeChart(options) {
|
|
872
|
+
const chartA = await getBirthChart(options.chartA);
|
|
873
|
+
const chartB = await getBirthChart(options.chartB);
|
|
874
|
+
const midpointLongitudes = computeMidpoints(chartA.planets, chartB.planets);
|
|
875
|
+
const cuspsA = chartA.houses.houses.map((h) => h.longitude);
|
|
876
|
+
const cuspsB = chartB.houses.houses.map((h) => h.longitude);
|
|
877
|
+
const compositeCusps = [];
|
|
878
|
+
for (let i = 0; i < Math.min(cuspsA.length, cuspsB.length); i++) {
|
|
879
|
+
let diff = cuspsB[i] - cuspsA[i];
|
|
880
|
+
if (diff > 180) diff -= 360;
|
|
881
|
+
if (diff < -180) diff += 360;
|
|
882
|
+
compositeCusps.push(normalizeAngle(cuspsA[i] + diff / 2));
|
|
883
|
+
}
|
|
884
|
+
const compositePlanets = {};
|
|
885
|
+
for (const [key, lon] of Object.entries(midpointLongitudes)) {
|
|
886
|
+
compositePlanets[key] = {
|
|
887
|
+
name: key,
|
|
888
|
+
longitude: lon,
|
|
889
|
+
zodiacPosition: getZodiacPosition(lon, compositeCusps)
|
|
890
|
+
};
|
|
891
|
+
}
|
|
892
|
+
const compositeHouses = compositeCusps.map(
|
|
893
|
+
(lon) => getZodiacPosition(lon, compositeCusps)
|
|
894
|
+
);
|
|
895
|
+
const aspects = computeAspects(compositePlanets, options.aspectSpecs);
|
|
896
|
+
return {
|
|
897
|
+
chartA,
|
|
898
|
+
chartB,
|
|
899
|
+
compositePlanets,
|
|
900
|
+
compositeHouses,
|
|
901
|
+
aspects
|
|
902
|
+
};
|
|
903
|
+
}
|
|
757
904
|
|
|
758
|
-
export { CalcFlag, HouseSystem, PLANET_AND_NODE_NAMES, Planet, SIGNS, VirtualNodes, closeSwissEph, findHouseOf, formatDegreeMinutes, getBirthChart, getSwissEph, getZodiacPosition, normalizeAngle };
|
|
759
|
-
//# sourceMappingURL=chunk-
|
|
760
|
-
//# sourceMappingURL=chunk-
|
|
905
|
+
export { CalcFlag, DEFAULT_ASPECT_SPECS, HouseSystem, PLANET_AND_NODE_NAMES, Planet, SIGNS, VirtualNodes, closeSwissEph, computeAspects, computeMidpoints, computeSynastryAspects, findHouseOf, formatDegreeMinutes, getAspectMatch, getBirthChart, getCompositeChart, getSwissEph, getSynastryChart, getZodiacPosition, normalizeAngle };
|
|
906
|
+
//# sourceMappingURL=chunk-CYWQV2RL.mjs.map
|
|
907
|
+
//# sourceMappingURL=chunk-CYWQV2RL.mjs.map
|