kaabalah 3.1.0 → 3.3.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/dist/astrology/index.d.mts +20 -2
- package/dist/astrology/index.d.ts +20 -2
- package/dist/astrology/index.js +25 -9
- package/dist/astrology/index.mjs +1 -1
- package/dist/{chunk-SZXDOHKV.js → chunk-KU4LMTWD.js} +146 -33
- package/dist/{chunk-SZXDOHKV.js.map → chunk-KU4LMTWD.js.map} +1 -1
- package/dist/{chunk-AV7WBVPS.mjs → chunk-T7D3HPJZ.mjs} +143 -34
- package/dist/{chunk-AV7WBVPS.mjs.map → chunk-T7D3HPJZ.mjs.map} +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +25 -9
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
|
@@ -15,6 +15,8 @@ declare enum Planet {
|
|
|
15
15
|
PLUTO = 9,
|
|
16
16
|
MEAN_NODE = 10,
|
|
17
17
|
TRUE_NODE = 11,
|
|
18
|
+
LILITH_MEAN = 12,
|
|
19
|
+
LILITH_TRUE = 13,
|
|
18
20
|
CHIRON = 15
|
|
19
21
|
}
|
|
20
22
|
declare enum HouseSystem {
|
|
@@ -31,12 +33,20 @@ declare enum HouseSystem {
|
|
|
31
33
|
ALCABITIUS = "B"
|
|
32
34
|
}
|
|
33
35
|
declare enum CalcFlag {
|
|
36
|
+
JPL_EPH = 1,
|
|
34
37
|
SWISS_EPH = 2,
|
|
35
38
|
MOSHIER = 4,
|
|
36
39
|
HELIOCENTRIC = 8,
|
|
37
40
|
TRUE_POS = 16,
|
|
38
|
-
|
|
41
|
+
J2000 = 32,
|
|
42
|
+
NONUT = 64,
|
|
43
|
+
SPEED3 = 128,
|
|
44
|
+
SPEED = 256,
|
|
45
|
+
EQUATORIAL = 2048,
|
|
46
|
+
TOPOCTR = 32768,
|
|
47
|
+
SIDEREAL = 65536
|
|
39
48
|
}
|
|
49
|
+
declare const normalizeAngle: (deg: number) => number;
|
|
40
50
|
|
|
41
51
|
/**
|
|
42
52
|
* Initializes and returns the Swiss Ephemeris instance.
|
|
@@ -86,6 +96,7 @@ interface BirthChart {
|
|
|
86
96
|
* @returns Birth chart data
|
|
87
97
|
*/
|
|
88
98
|
declare function getBirthChart(options: BirthChartOptions): Promise<BirthChart>;
|
|
99
|
+
declare const SIGNS: readonly ["Aries", "Taurus", "Gemini", "Cancer", "Leo", "Virgo", "Libra", "Scorpio", "Sagittarius", "Capricorn", "Aquarius", "Pisces"];
|
|
89
100
|
/**
|
|
90
101
|
* Convert decimal degrees to degrees and minutes format
|
|
91
102
|
*
|
|
@@ -105,5 +116,12 @@ declare function getZodiacPosition(longitude: number): {
|
|
|
105
116
|
traditionalFormat: string;
|
|
106
117
|
decimal: string;
|
|
107
118
|
};
|
|
119
|
+
declare function formatHouseCusps(houses360: number[]): {
|
|
120
|
+
house: number;
|
|
121
|
+
sign: string;
|
|
122
|
+
degree: string;
|
|
123
|
+
longitude: number;
|
|
124
|
+
}[];
|
|
125
|
+
declare function findHouseOf(longitude: number, cusps360: number[]): number;
|
|
108
126
|
|
|
109
|
-
export { type BirthChart, type BirthChartOptions, CalcFlag, HouseSystem, Planet, closeSwissEph, formatDegreeMinutes, getBirthChart, getSwissEph, getZodiacPosition };
|
|
127
|
+
export { type BirthChart, type BirthChartOptions, CalcFlag, HouseSystem, Planet, SIGNS, closeSwissEph, findHouseOf, formatDegreeMinutes, formatHouseCusps, getBirthChart, getSwissEph, getZodiacPosition, normalizeAngle };
|
|
@@ -15,6 +15,8 @@ declare enum Planet {
|
|
|
15
15
|
PLUTO = 9,
|
|
16
16
|
MEAN_NODE = 10,
|
|
17
17
|
TRUE_NODE = 11,
|
|
18
|
+
LILITH_MEAN = 12,
|
|
19
|
+
LILITH_TRUE = 13,
|
|
18
20
|
CHIRON = 15
|
|
19
21
|
}
|
|
20
22
|
declare enum HouseSystem {
|
|
@@ -31,12 +33,20 @@ declare enum HouseSystem {
|
|
|
31
33
|
ALCABITIUS = "B"
|
|
32
34
|
}
|
|
33
35
|
declare enum CalcFlag {
|
|
36
|
+
JPL_EPH = 1,
|
|
34
37
|
SWISS_EPH = 2,
|
|
35
38
|
MOSHIER = 4,
|
|
36
39
|
HELIOCENTRIC = 8,
|
|
37
40
|
TRUE_POS = 16,
|
|
38
|
-
|
|
41
|
+
J2000 = 32,
|
|
42
|
+
NONUT = 64,
|
|
43
|
+
SPEED3 = 128,
|
|
44
|
+
SPEED = 256,
|
|
45
|
+
EQUATORIAL = 2048,
|
|
46
|
+
TOPOCTR = 32768,
|
|
47
|
+
SIDEREAL = 65536
|
|
39
48
|
}
|
|
49
|
+
declare const normalizeAngle: (deg: number) => number;
|
|
40
50
|
|
|
41
51
|
/**
|
|
42
52
|
* Initializes and returns the Swiss Ephemeris instance.
|
|
@@ -86,6 +96,7 @@ interface BirthChart {
|
|
|
86
96
|
* @returns Birth chart data
|
|
87
97
|
*/
|
|
88
98
|
declare function getBirthChart(options: BirthChartOptions): Promise<BirthChart>;
|
|
99
|
+
declare const SIGNS: readonly ["Aries", "Taurus", "Gemini", "Cancer", "Leo", "Virgo", "Libra", "Scorpio", "Sagittarius", "Capricorn", "Aquarius", "Pisces"];
|
|
89
100
|
/**
|
|
90
101
|
* Convert decimal degrees to degrees and minutes format
|
|
91
102
|
*
|
|
@@ -105,5 +116,12 @@ declare function getZodiacPosition(longitude: number): {
|
|
|
105
116
|
traditionalFormat: string;
|
|
106
117
|
decimal: string;
|
|
107
118
|
};
|
|
119
|
+
declare function formatHouseCusps(houses360: number[]): {
|
|
120
|
+
house: number;
|
|
121
|
+
sign: string;
|
|
122
|
+
degree: string;
|
|
123
|
+
longitude: number;
|
|
124
|
+
}[];
|
|
125
|
+
declare function findHouseOf(longitude: number, cusps360: number[]): number;
|
|
108
126
|
|
|
109
|
-
export { type BirthChart, type BirthChartOptions, CalcFlag, HouseSystem, Planet, closeSwissEph, formatDegreeMinutes, getBirthChart, getSwissEph, getZodiacPosition };
|
|
127
|
+
export { type BirthChart, type BirthChartOptions, CalcFlag, HouseSystem, Planet, SIGNS, closeSwissEph, findHouseOf, formatDegreeMinutes, formatHouseCusps, getBirthChart, getSwissEph, getZodiacPosition, normalizeAngle };
|
package/dist/astrology/index.js
CHANGED
|
@@ -1,41 +1,57 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkKU4LMTWD_js = require('../chunk-KU4LMTWD.js');
|
|
4
4
|
require('../chunk-2TUXWMP5.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 chunkKU4LMTWD_js.CalcFlag; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "HouseSystem", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunkKU4LMTWD_js.HouseSystem; }
|
|
15
15
|
});
|
|
16
16
|
Object.defineProperty(exports, "Planet", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunkKU4LMTWD_js.Planet; }
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports, "SIGNS", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function () { return chunkKU4LMTWD_js.SIGNS; }
|
|
19
23
|
});
|
|
20
24
|
Object.defineProperty(exports, "closeSwissEph", {
|
|
21
25
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunkKU4LMTWD_js.closeSwissEph; }
|
|
27
|
+
});
|
|
28
|
+
Object.defineProperty(exports, "findHouseOf", {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
get: function () { return chunkKU4LMTWD_js.findHouseOf; }
|
|
23
31
|
});
|
|
24
32
|
Object.defineProperty(exports, "formatDegreeMinutes", {
|
|
25
33
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
34
|
+
get: function () { return chunkKU4LMTWD_js.formatDegreeMinutes; }
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "formatHouseCusps", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () { return chunkKU4LMTWD_js.formatHouseCusps; }
|
|
27
39
|
});
|
|
28
40
|
Object.defineProperty(exports, "getBirthChart", {
|
|
29
41
|
enumerable: true,
|
|
30
|
-
get: function () { return
|
|
42
|
+
get: function () { return chunkKU4LMTWD_js.getBirthChart; }
|
|
31
43
|
});
|
|
32
44
|
Object.defineProperty(exports, "getSwissEph", {
|
|
33
45
|
enumerable: true,
|
|
34
|
-
get: function () { return
|
|
46
|
+
get: function () { return chunkKU4LMTWD_js.getSwissEph; }
|
|
35
47
|
});
|
|
36
48
|
Object.defineProperty(exports, "getZodiacPosition", {
|
|
37
49
|
enumerable: true,
|
|
38
|
-
get: function () { return
|
|
50
|
+
get: function () { return chunkKU4LMTWD_js.getZodiacPosition; }
|
|
51
|
+
});
|
|
52
|
+
Object.defineProperty(exports, "normalizeAngle", {
|
|
53
|
+
enumerable: true,
|
|
54
|
+
get: function () { return chunkKU4LMTWD_js.normalizeAngle; }
|
|
39
55
|
});
|
|
40
56
|
//# sourceMappingURL=index.js.map
|
|
41
57
|
//# sourceMappingURL=index.js.map
|
package/dist/astrology/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { CalcFlag, HouseSystem, Planet, closeSwissEph, formatDegreeMinutes, getBirthChart, getSwissEph, getZodiacPosition } from '../chunk-
|
|
1
|
+
export { CalcFlag, HouseSystem, Planet, SIGNS, closeSwissEph, findHouseOf, formatDegreeMinutes, formatHouseCusps, getBirthChart, getSwissEph, getZodiacPosition, normalizeAngle } from '../chunk-T7D3HPJZ.mjs';
|
|
2
2
|
import '../chunk-PY5SMMJB.mjs';
|
|
3
3
|
//# sourceMappingURL=index.mjs.map
|
|
4
4
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -3050,6 +3050,8 @@ var Planet = /* @__PURE__ */ ((Planet2) => {
|
|
|
3050
3050
|
Planet2[Planet2["PLUTO"] = 9] = "PLUTO";
|
|
3051
3051
|
Planet2[Planet2["MEAN_NODE"] = 10] = "MEAN_NODE";
|
|
3052
3052
|
Planet2[Planet2["TRUE_NODE"] = 11] = "TRUE_NODE";
|
|
3053
|
+
Planet2[Planet2["LILITH_MEAN"] = 12] = "LILITH_MEAN";
|
|
3054
|
+
Planet2[Planet2["LILITH_TRUE"] = 13] = "LILITH_TRUE";
|
|
3053
3055
|
Planet2[Planet2["CHIRON"] = 15] = "CHIRON";
|
|
3054
3056
|
return Planet2;
|
|
3055
3057
|
})(Planet || {});
|
|
@@ -3068,13 +3070,26 @@ var HouseSystem = /* @__PURE__ */ ((HouseSystem2) => {
|
|
|
3068
3070
|
return HouseSystem2;
|
|
3069
3071
|
})(HouseSystem || {});
|
|
3070
3072
|
var CalcFlag = /* @__PURE__ */ ((CalcFlag2) => {
|
|
3073
|
+
CalcFlag2[CalcFlag2["JPL_EPH"] = 1] = "JPL_EPH";
|
|
3071
3074
|
CalcFlag2[CalcFlag2["SWISS_EPH"] = 2] = "SWISS_EPH";
|
|
3072
3075
|
CalcFlag2[CalcFlag2["MOSHIER"] = 4] = "MOSHIER";
|
|
3073
3076
|
CalcFlag2[CalcFlag2["HELIOCENTRIC"] = 8] = "HELIOCENTRIC";
|
|
3074
3077
|
CalcFlag2[CalcFlag2["TRUE_POS"] = 16] = "TRUE_POS";
|
|
3075
|
-
CalcFlag2[CalcFlag2["
|
|
3078
|
+
CalcFlag2[CalcFlag2["J2000"] = 32] = "J2000";
|
|
3079
|
+
CalcFlag2[CalcFlag2["NONUT"] = 64] = "NONUT";
|
|
3080
|
+
CalcFlag2[CalcFlag2["SPEED3"] = 128] = "SPEED3";
|
|
3081
|
+
CalcFlag2[CalcFlag2["SPEED"] = 256] = "SPEED";
|
|
3082
|
+
CalcFlag2[CalcFlag2["EQUATORIAL"] = 2048] = "EQUATORIAL";
|
|
3083
|
+
CalcFlag2[CalcFlag2["TOPOCTR"] = 32768] = "TOPOCTR";
|
|
3084
|
+
CalcFlag2[CalcFlag2["SIDEREAL"] = 65536] = "SIDEREAL";
|
|
3076
3085
|
return CalcFlag2;
|
|
3077
3086
|
})(CalcFlag || {});
|
|
3087
|
+
var SE_AST_OFFSET = 1e4;
|
|
3088
|
+
var BODY = {
|
|
3089
|
+
MEAN_APOGEE: 12,
|
|
3090
|
+
// Lilith mean
|
|
3091
|
+
OSC_APOGEE: 13};
|
|
3092
|
+
var normalizeAngle = (deg) => (deg % 360 + 360) % 360;
|
|
3078
3093
|
var SwissEph = class {
|
|
3079
3094
|
/**
|
|
3080
3095
|
* Constructor that accepts a pre-initialized Swiss Ephemeris module
|
|
@@ -3086,13 +3101,17 @@ var SwissEph = class {
|
|
|
3086
3101
|
this.swe_house_pos = null;
|
|
3087
3102
|
this.swe_set_ephe_path = null;
|
|
3088
3103
|
this.swe_close = null;
|
|
3104
|
+
this.swe_set_topo = null;
|
|
3105
|
+
this.swe_set_sid_mode = null;
|
|
3089
3106
|
this.module = module;
|
|
3090
3107
|
this.swe_julday = this.module.cwrap("swe_julday", "number", ["number", "number", "number", "number", "number"]);
|
|
3091
3108
|
this.swe_calc_ut = this.module.cwrap("swe_calc_ut", "number", ["number", "number", "number", "number"]);
|
|
3092
|
-
this.swe_houses = this.module.cwrap("swe_houses", "number", ["number", "number", "number", "
|
|
3109
|
+
this.swe_houses = this.module.cwrap("swe_houses", "number", ["number", "number", "number", "number", "number", "number"]);
|
|
3093
3110
|
this.swe_house_pos = this.module.cwrap("swe_house_pos", "number", ["number", "number", "number", "string", "number", "number"]);
|
|
3094
3111
|
this.swe_set_ephe_path = this.module.cwrap("swe_set_ephe_path", null, ["number"]);
|
|
3095
3112
|
this.swe_close = this.module.cwrap("swe_close", null, []);
|
|
3113
|
+
this.swe_set_topo = this.module.cwrap("swe_set_topo", null, ["number", "number", "number"]);
|
|
3114
|
+
this.swe_set_sid_mode = this.module.cwrap("swe_set_sid_mode", null, ["number", "number", "number"]);
|
|
3096
3115
|
}
|
|
3097
3116
|
checkInitialized() {
|
|
3098
3117
|
if (!this.module) {
|
|
@@ -3151,7 +3170,7 @@ var SwissEph = class {
|
|
|
3151
3170
|
latitude: this.module.getValue(resultPtr + 8, "double"),
|
|
3152
3171
|
distance: this.module.getValue(resultPtr + 16, "double")
|
|
3153
3172
|
};
|
|
3154
|
-
if (flags &
|
|
3173
|
+
if (flags & 256 /* SPEED */) {
|
|
3155
3174
|
position.longitudeSpeed = this.module.getValue(resultPtr + 24, "double");
|
|
3156
3175
|
position.latitudeSpeed = this.module.getValue(resultPtr + 32, "double");
|
|
3157
3176
|
position.distanceSpeed = this.module.getValue(resultPtr + 40, "double");
|
|
@@ -3183,7 +3202,8 @@ var SwissEph = class {
|
|
|
3183
3202
|
const housesPtr = memoryPtr;
|
|
3184
3203
|
const ascmcPtr = memoryPtr + 12 * 8;
|
|
3185
3204
|
try {
|
|
3186
|
-
const
|
|
3205
|
+
const hsysCode = hsys.charCodeAt(0);
|
|
3206
|
+
const ret = this.swe_houses(julday, latitude, longitude, hsysCode, housesPtr, ascmcPtr);
|
|
3187
3207
|
if (ret < 0) {
|
|
3188
3208
|
throw new Error(`Houses calculation failed with error code ${ret}`);
|
|
3189
3209
|
}
|
|
@@ -3192,9 +3212,27 @@ var SwissEph = class {
|
|
|
3192
3212
|
const value = this.module.getValue(housesPtr + i * 8, "double");
|
|
3193
3213
|
houses.push(value);
|
|
3194
3214
|
}
|
|
3195
|
-
const ascendant = this.module.getValue(ascmcPtr, "double");
|
|
3215
|
+
const ascendant = this.module.getValue(ascmcPtr + 0, "double");
|
|
3196
3216
|
const mc = this.module.getValue(ascmcPtr + 8, "double");
|
|
3197
|
-
|
|
3217
|
+
const armc = this.module.getValue(ascmcPtr + 16, "double");
|
|
3218
|
+
const vertex = this.module.getValue(ascmcPtr + 24, "double");
|
|
3219
|
+
const equasc = this.module.getValue(ascmcPtr + 32, "double");
|
|
3220
|
+
const coasc1 = this.module.getValue(ascmcPtr + 40, "double");
|
|
3221
|
+
const coasc2 = this.module.getValue(ascmcPtr + 48, "double");
|
|
3222
|
+
const polasc = this.module.getValue(ascmcPtr + 56, "double");
|
|
3223
|
+
return {
|
|
3224
|
+
ascendant,
|
|
3225
|
+
mc,
|
|
3226
|
+
houses,
|
|
3227
|
+
ascmc: {
|
|
3228
|
+
armc,
|
|
3229
|
+
vertex,
|
|
3230
|
+
equasc,
|
|
3231
|
+
coasc1,
|
|
3232
|
+
coasc2,
|
|
3233
|
+
polasc
|
|
3234
|
+
}
|
|
3235
|
+
};
|
|
3198
3236
|
} finally {
|
|
3199
3237
|
this.module._free(memoryPtr);
|
|
3200
3238
|
}
|
|
@@ -3208,10 +3246,42 @@ var SwissEph = class {
|
|
|
3208
3246
|
this.swe_close();
|
|
3209
3247
|
}
|
|
3210
3248
|
}
|
|
3249
|
+
/**
|
|
3250
|
+
* Set topocentric observer
|
|
3251
|
+
*/
|
|
3252
|
+
setTopocentric(longitude, latitude, altitudeMeters = 0) {
|
|
3253
|
+
this.checkInitialized();
|
|
3254
|
+
if (!this.swe_set_topo) {
|
|
3255
|
+
throw new Error("Topocentric calculation function not available");
|
|
3256
|
+
}
|
|
3257
|
+
this.swe_set_topo(longitude, latitude, altitudeMeters);
|
|
3258
|
+
}
|
|
3259
|
+
/**
|
|
3260
|
+
* Set sidereal mode
|
|
3261
|
+
* Ex.: mode=1 (Lahiri). See Swiss Ephemeris mode table.
|
|
3262
|
+
*/
|
|
3263
|
+
setSiderealMode(mode, t0 = 0, ayan_t0 = 0) {
|
|
3264
|
+
this.checkInitialized();
|
|
3265
|
+
this.swe_set_sid_mode?.(mode, t0, ayan_t0);
|
|
3266
|
+
}
|
|
3267
|
+
/**
|
|
3268
|
+
* Asteroid by MPC number
|
|
3269
|
+
*/
|
|
3270
|
+
calculateAsteroidPosition(julday, mpcNumber, flags = 2 /* SWISS_EPH */) {
|
|
3271
|
+
return this.calculatePlanetPosition(julday, SE_AST_OFFSET + mpcNumber, flags);
|
|
3272
|
+
}
|
|
3273
|
+
/**
|
|
3274
|
+
* Lilith mean (12) and true (13)
|
|
3275
|
+
*/
|
|
3276
|
+
calculateLilith(julday, kind = "mean", flags = 2 /* SWISS_EPH */) {
|
|
3277
|
+
const id = kind === "mean" ? BODY.MEAN_APOGEE : BODY.OSC_APOGEE;
|
|
3278
|
+
return this.calculatePlanetPosition(julday, id, flags);
|
|
3279
|
+
}
|
|
3211
3280
|
};
|
|
3212
3281
|
|
|
3213
3282
|
// src/astrology/swisseph.ts
|
|
3214
3283
|
var swissEph = null;
|
|
3284
|
+
var DEFAULT_FLAGS = 2 /* SWISS_EPH */ | 256 /* SPEED */;
|
|
3215
3285
|
async function getSwissEph(options = {}) {
|
|
3216
3286
|
if (swissEph) {
|
|
3217
3287
|
return;
|
|
@@ -3236,6 +3306,7 @@ async function calculatePlanetaryPositions(date) {
|
|
|
3236
3306
|
try {
|
|
3237
3307
|
checkInitialization();
|
|
3238
3308
|
const julday = swissEph.getJulianDay(date);
|
|
3309
|
+
const flags = DEFAULT_FLAGS;
|
|
3239
3310
|
const planets = {
|
|
3240
3311
|
sun: 0 /* SUN */,
|
|
3241
3312
|
moon: 1 /* MOON */,
|
|
@@ -3243,12 +3314,21 @@ async function calculatePlanetaryPositions(date) {
|
|
|
3243
3314
|
venus: 3 /* VENUS */,
|
|
3244
3315
|
mars: 4 /* MARS */,
|
|
3245
3316
|
jupiter: 5 /* JUPITER */,
|
|
3246
|
-
saturn: 6 /* SATURN
|
|
3317
|
+
saturn: 6 /* SATURN */,
|
|
3318
|
+
uranus: 7 /* URANUS */,
|
|
3319
|
+
neptune: 8 /* NEPTUNE */,
|
|
3320
|
+
pluto: 9 /* PLUTO */,
|
|
3321
|
+
meanNode: 10 /* MEAN_NODE */,
|
|
3322
|
+
// trueNode: Planet.TRUE_NODE,
|
|
3323
|
+
// TODO: add chiron through seas_18.se1, seas_18.se2 and seasnam.txt files
|
|
3324
|
+
// chiron: Planet.CHIRON,
|
|
3325
|
+
lilithMean: 12 /* LILITH_MEAN */
|
|
3326
|
+
// lilithTrue: Planet.LILITH_TRUE,
|
|
3247
3327
|
};
|
|
3248
3328
|
const positions = {};
|
|
3249
3329
|
for (const [name, id] of Object.entries(planets)) {
|
|
3250
3330
|
try {
|
|
3251
|
-
positions[name] = swissEph.calculatePlanetPosition(julday, id);
|
|
3331
|
+
positions[name] = swissEph.calculatePlanetPosition(julday, id, flags);
|
|
3252
3332
|
} catch (error) {
|
|
3253
3333
|
throw new Error(`Failed to calculate position for ${name}: ${error}`);
|
|
3254
3334
|
}
|
|
@@ -3329,43 +3409,76 @@ async function getBirthChart(options) {
|
|
|
3329
3409
|
throw error;
|
|
3330
3410
|
}
|
|
3331
3411
|
}
|
|
3412
|
+
var SIGNS = [
|
|
3413
|
+
"Aries",
|
|
3414
|
+
"Taurus",
|
|
3415
|
+
"Gemini",
|
|
3416
|
+
"Cancer",
|
|
3417
|
+
"Leo",
|
|
3418
|
+
"Virgo",
|
|
3419
|
+
"Libra",
|
|
3420
|
+
"Scorpio",
|
|
3421
|
+
"Sagittarius",
|
|
3422
|
+
"Capricorn",
|
|
3423
|
+
"Aquarius",
|
|
3424
|
+
"Pisces"
|
|
3425
|
+
];
|
|
3332
3426
|
function formatDegreeMinutes(decimalDegrees) {
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3427
|
+
let deg = Math.floor(decimalDegrees);
|
|
3428
|
+
let min = Math.round((decimalDegrees - deg) * 60);
|
|
3429
|
+
if (min === 60) {
|
|
3430
|
+
min = 0;
|
|
3431
|
+
deg += 1;
|
|
3432
|
+
}
|
|
3433
|
+
return `${deg}\xB0${String(min).padStart(2, "0")}'`;
|
|
3336
3434
|
}
|
|
3337
3435
|
function getZodiacPosition(longitude) {
|
|
3338
|
-
const
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
"Gemini",
|
|
3342
|
-
"Cancer",
|
|
3343
|
-
"Leo",
|
|
3344
|
-
"Virgo",
|
|
3345
|
-
"Libra",
|
|
3346
|
-
"Scorpio",
|
|
3347
|
-
"Sagittarius",
|
|
3348
|
-
"Capricorn",
|
|
3349
|
-
"Aquarius",
|
|
3350
|
-
"Pisces"
|
|
3351
|
-
];
|
|
3352
|
-
const signIndex = Math.floor(longitude / 30) % 12;
|
|
3353
|
-
const degrees = longitude % 30;
|
|
3436
|
+
const L = normalizeAngle(longitude);
|
|
3437
|
+
const signIndex = Math.floor(L / 30) % 12;
|
|
3438
|
+
const within = L - signIndex * 30;
|
|
3354
3439
|
return {
|
|
3355
|
-
sign:
|
|
3356
|
-
decimalDegrees:
|
|
3357
|
-
traditionalFormat: formatDegreeMinutes(
|
|
3358
|
-
decimal:
|
|
3440
|
+
sign: SIGNS[signIndex],
|
|
3441
|
+
decimalDegrees: within,
|
|
3442
|
+
traditionalFormat: formatDegreeMinutes(within),
|
|
3443
|
+
decimal: within.toFixed(2) + "\xB0"
|
|
3359
3444
|
};
|
|
3360
3445
|
}
|
|
3446
|
+
function formatHouseCusps(houses360) {
|
|
3447
|
+
return houses360.map((lon, i) => {
|
|
3448
|
+
const z = getZodiacPosition(lon);
|
|
3449
|
+
return {
|
|
3450
|
+
house: i + 1,
|
|
3451
|
+
sign: z.sign,
|
|
3452
|
+
degree: z.traditionalFormat,
|
|
3453
|
+
longitude: normalizeAngle(lon)
|
|
3454
|
+
};
|
|
3455
|
+
});
|
|
3456
|
+
}
|
|
3457
|
+
function findHouseOf(longitude, cusps360) {
|
|
3458
|
+
const L = normalizeAngle(longitude);
|
|
3459
|
+
const H = cusps360.map((c, i) => ({ i: i + 1, L: normalizeAngle(c) })).sort((a, b) => a.L - b.L);
|
|
3460
|
+
for (let k = 0; k < H.length; k++) {
|
|
3461
|
+
const cur = H[k], nxt = H[(k + 1) % H.length];
|
|
3462
|
+
if (nxt.L < cur.L) {
|
|
3463
|
+
if (L >= cur.L || L < nxt.L) return cur.i;
|
|
3464
|
+
} else {
|
|
3465
|
+
if (L >= cur.L && L < nxt.L) return cur.i;
|
|
3466
|
+
}
|
|
3467
|
+
}
|
|
3468
|
+
return 1;
|
|
3469
|
+
}
|
|
3361
3470
|
|
|
3362
3471
|
exports.CalcFlag = CalcFlag;
|
|
3363
3472
|
exports.HouseSystem = HouseSystem;
|
|
3364
3473
|
exports.Planet = Planet;
|
|
3474
|
+
exports.SIGNS = SIGNS;
|
|
3365
3475
|
exports.closeSwissEph = closeSwissEph;
|
|
3476
|
+
exports.findHouseOf = findHouseOf;
|
|
3366
3477
|
exports.formatDegreeMinutes = formatDegreeMinutes;
|
|
3478
|
+
exports.formatHouseCusps = formatHouseCusps;
|
|
3367
3479
|
exports.getBirthChart = getBirthChart;
|
|
3368
3480
|
exports.getSwissEph = getSwissEph;
|
|
3369
3481
|
exports.getZodiacPosition = getZodiacPosition;
|
|
3370
|
-
|
|
3371
|
-
//# sourceMappingURL=chunk-
|
|
3482
|
+
exports.normalizeAngle = normalizeAngle;
|
|
3483
|
+
//# sourceMappingURL=chunk-KU4LMTWD.js.map
|
|
3484
|
+
//# sourceMappingURL=chunk-KU4LMTWD.js.map
|