@node-jhora/analytics 1.0.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/LICENSE +23 -0
- package/dist/ashtakavarga.d.ts +15 -0
- package/dist/ashtakavarga.js +145 -0
- package/dist/ashtakavarga.js.map +1 -0
- package/dist/aspects.d.ts +18 -0
- package/dist/aspects.js +198 -0
- package/dist/aspects.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/shadbala.d.ts +87 -0
- package/dist/shadbala.js +227 -0
- package/dist/shadbala.js.map +1 -0
- package/dist/shadbala_time.d.ts +7 -0
- package/dist/shadbala_time.js +400 -0
- package/dist/shadbala_time.js.map +1 -0
- package/dist/yogas/engine.d.ts +62 -0
- package/dist/yogas/engine.js +204 -0
- package/dist/yogas/engine.js.map +1 -0
- package/dist/yogas/library.d.ts +2 -0
- package/dist/yogas/library.js +145 -0
- package/dist/yogas/library.js.map +1 -0
- package/package.json +28 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
NODE-JHORA SOURCE AVAILABLE LICENSE AGREEMENT
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Harieshwar Jagan Abirami. All rights reserved.
|
|
4
|
+
|
|
5
|
+
1. OWNERSHIP
|
|
6
|
+
This software ("node-jhora") is the sole proprietary property of Harieshwar Jagan Abirami.
|
|
7
|
+
|
|
8
|
+
2. SOURCE AVAILABLE
|
|
9
|
+
The source code is made publicly available for inspection and educational purposes only. You are permitted to view and read the code.
|
|
10
|
+
|
|
11
|
+
3. RESTRICTIONS ON USE AND DERIVATION
|
|
12
|
+
a. **No Unauthorized Use**: You may NOT use, execute, copy, or distribute this software for any purpose (personal or commercial) without a valid Commercial License from the Owner.
|
|
13
|
+
b. **No Derivative Works**: You may NOT alter, transform, build upon, or create derivative works from this software without a valid Commercial License.
|
|
14
|
+
c. **Royalty Requirement**: Usage and creation of derivative works are strictly conditioned upon the payment of royalties and explicit written agreement with the Owner.
|
|
15
|
+
|
|
16
|
+
4. COMMERCIAL LICENSING
|
|
17
|
+
To obtain a Commercial License and negotiate royalty terms, please contact the Owner directly. Any usage or derivation without such an agreement is a violation of copyright law.
|
|
18
|
+
|
|
19
|
+
5. CONTRIBUTIONS
|
|
20
|
+
By submitting contributions, you assign all copyright and intellectual property rights to Harieshwar Jagan Abirami. Contributors may be eligible for reduced royalty terms or special licenses at the Owner's sole discretion.
|
|
21
|
+
|
|
22
|
+
6. DISCLAIMER
|
|
23
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND. IN NO EVENT SHALL THE OWNER BE LIABLE FOR ANY CLAIM OR DAMAGES.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PlanetPosition } from '@node-jhora/core';
|
|
2
|
+
export interface AshtakavargaResult {
|
|
3
|
+
bav: Record<number, number[]>;
|
|
4
|
+
sav: number[];
|
|
5
|
+
}
|
|
6
|
+
export declare class Ashtakavarga {
|
|
7
|
+
/**
|
|
8
|
+
* Calculates Ashtakavarga (BAV and SAV).
|
|
9
|
+
* @param planets List of planets (Sun..Sat, Rahu, Ketu).
|
|
10
|
+
* @param ascendantSign Ascendant Sign Index (1-based or 0-based? Let's use 1-based internally for logic ease).
|
|
11
|
+
* Wait, input is typically 1 (Aries). My sys uses 1-based houses often but normalization can be 0.
|
|
12
|
+
* Let's stick to 1-based Signs (1=Aries).
|
|
13
|
+
*/
|
|
14
|
+
static calculate(planets: PlanetPosition[], ascendantSign: number): AshtakavargaResult;
|
|
15
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ashtakavarga Points Table (Parasara).
|
|
3
|
+
* Key: Planet ID (0=Sun, 1=Moon... 6=Saturn, 99=Ascendant)
|
|
4
|
+
* Value: Benefic places from itself (1-12 houses).
|
|
5
|
+
*
|
|
6
|
+
* Note: We map Lagna ID to 99 temporarily to distinguish it from the 7 planets.
|
|
7
|
+
*/
|
|
8
|
+
// Benefic spots from Sun, Moon, Mars, Mercury, Jupiter, Venus, Saturn, Lagna
|
|
9
|
+
// Source: BPHS
|
|
10
|
+
const ASHTAKAVARGA_RULES = {
|
|
11
|
+
// Sun's BAV
|
|
12
|
+
0: {
|
|
13
|
+
0: [1, 2, 4, 7, 8, 9, 10, 11], // From Sun
|
|
14
|
+
1: [3, 6, 10, 11], // From Moon
|
|
15
|
+
4: [1, 2, 4, 7, 8, 9, 10, 11], // From Mars
|
|
16
|
+
2: [3, 5, 6, 9, 10, 11, 12], // From Mercury
|
|
17
|
+
5: [5, 6, 9, 11], // From Jupiter
|
|
18
|
+
3: [6, 7, 12], // From Venus
|
|
19
|
+
6: [1, 2, 4, 7, 8, 9, 10, 11], // From Saturn
|
|
20
|
+
99: [3, 4, 6, 10, 11, 12] // From Lagna
|
|
21
|
+
},
|
|
22
|
+
// Moon's BAV
|
|
23
|
+
1: {
|
|
24
|
+
0: [3, 6, 7, 8, 10, 11], // From Sun
|
|
25
|
+
1: [1, 3, 6, 7, 10, 11], // From Moon
|
|
26
|
+
4: [2, 3, 5, 6, 9, 10, 11], // From Mars
|
|
27
|
+
2: [1, 3, 4, 5, 7, 8, 10, 11], // From Mercury
|
|
28
|
+
5: [1, 4, 7, 8, 10, 11, 12], // From Jupiter
|
|
29
|
+
3: [3, 4, 5, 7, 9, 10, 11], // From Venus
|
|
30
|
+
6: [3, 5, 6, 11], // From Saturn
|
|
31
|
+
99: [3, 6, 10, 11] // From Lagna
|
|
32
|
+
},
|
|
33
|
+
// Mars's BAV
|
|
34
|
+
4: {
|
|
35
|
+
0: [3, 5, 6, 10, 11],
|
|
36
|
+
1: [3, 6, 11],
|
|
37
|
+
4: [1, 2, 4, 7, 8, 10, 11],
|
|
38
|
+
2: [3, 5, 6, 11],
|
|
39
|
+
5: [6, 10, 11, 12],
|
|
40
|
+
3: [6, 8, 11, 12],
|
|
41
|
+
6: [1, 4, 7, 8, 9, 10, 11],
|
|
42
|
+
99: [1, 3, 6, 10, 11]
|
|
43
|
+
},
|
|
44
|
+
// Mercury's BAV
|
|
45
|
+
2: {
|
|
46
|
+
0: [5, 6, 9, 11, 12],
|
|
47
|
+
1: [2, 4, 6, 8, 10, 11],
|
|
48
|
+
4: [1, 2, 4, 7, 8, 9, 10, 11],
|
|
49
|
+
2: [1, 3, 5, 6, 9, 10, 11, 12],
|
|
50
|
+
5: [6, 8, 11, 12],
|
|
51
|
+
3: [1, 2, 3, 4, 5, 8, 9, 11],
|
|
52
|
+
6: [1, 2, 4, 7, 8, 9, 10, 11],
|
|
53
|
+
99: [1, 2, 4, 6, 8, 10, 11]
|
|
54
|
+
},
|
|
55
|
+
// Jupiter's BAV
|
|
56
|
+
5: {
|
|
57
|
+
0: [1, 2, 3, 4, 7, 8, 9, 10, 11],
|
|
58
|
+
1: [2, 5, 7, 9, 11],
|
|
59
|
+
4: [1, 2, 4, 7, 8, 10, 11],
|
|
60
|
+
2: [1, 2, 4, 5, 6, 9, 10, 11],
|
|
61
|
+
5: [1, 2, 3, 4, 7, 8, 10, 11],
|
|
62
|
+
3: [2, 5, 6, 9, 10, 11],
|
|
63
|
+
6: [3, 5, 6, 12],
|
|
64
|
+
99: [1, 2, 4, 5, 6, 7, 9, 10, 11]
|
|
65
|
+
},
|
|
66
|
+
// Venus's BAV
|
|
67
|
+
3: {
|
|
68
|
+
0: [8, 11, 12],
|
|
69
|
+
1: [1, 2, 3, 4, 5, 8, 9, 11, 12],
|
|
70
|
+
4: [3, 4, 6, 9, 11, 12],
|
|
71
|
+
2: [3, 5, 6, 9, 11],
|
|
72
|
+
5: [5, 8, 9, 10, 11],
|
|
73
|
+
3: [1, 2, 3, 4, 5, 8, 9, 10, 11],
|
|
74
|
+
6: [3, 4, 5, 8, 9, 10, 11],
|
|
75
|
+
99: [1, 2, 3, 4, 5, 8, 9, 11]
|
|
76
|
+
},
|
|
77
|
+
// Saturn's BAV
|
|
78
|
+
6: {
|
|
79
|
+
0: [1, 2, 4, 7, 8, 10, 11],
|
|
80
|
+
1: [3, 6, 11],
|
|
81
|
+
4: [3, 5, 6, 10, 11, 12],
|
|
82
|
+
2: [6, 8, 9, 10, 11, 12],
|
|
83
|
+
5: [5, 6, 11, 12],
|
|
84
|
+
3: [6, 11, 12],
|
|
85
|
+
6: [3, 5, 6, 11],
|
|
86
|
+
99: [1, 3, 4, 6, 10, 11]
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
export class Ashtakavarga {
|
|
90
|
+
/**
|
|
91
|
+
* Calculates Ashtakavarga (BAV and SAV).
|
|
92
|
+
* @param planets List of planets (Sun..Sat, Rahu, Ketu).
|
|
93
|
+
* @param ascendantSign Ascendant Sign Index (1-based or 0-based? Let's use 1-based internally for logic ease).
|
|
94
|
+
* Wait, input is typically 1 (Aries). My sys uses 1-based houses often but normalization can be 0.
|
|
95
|
+
* Let's stick to 1-based Signs (1=Aries).
|
|
96
|
+
*/
|
|
97
|
+
static calculate(planets, ascendantSign) {
|
|
98
|
+
const bav = {};
|
|
99
|
+
// Initialize SAV (0-11, representing Signs Aries-Pisces)
|
|
100
|
+
const sav = new Array(12).fill(0);
|
|
101
|
+
// Planet IDs we care about: 0(Sun), 1(Mon), 2(Mer), 3(Ven), 4(Mar), 5(Jup), 6(Sat)
|
|
102
|
+
const targetPlanets = [0, 1, 4, 2, 5, 3, 6];
|
|
103
|
+
// Helper to get Sign (1-12)
|
|
104
|
+
const getSign = (pId) => {
|
|
105
|
+
if (pId === 99)
|
|
106
|
+
return ascendantSign;
|
|
107
|
+
const p = planets.find(pl => pl.id === pId);
|
|
108
|
+
if (!p)
|
|
109
|
+
return 0; // Error
|
|
110
|
+
return Math.floor(p.longitude / 30) + 1;
|
|
111
|
+
};
|
|
112
|
+
targetPlanets.forEach(targetId => {
|
|
113
|
+
// Scores for this planet across 12 signs (Aries...Pisces)
|
|
114
|
+
// Initialize with 0
|
|
115
|
+
const scores = new Array(12).fill(0);
|
|
116
|
+
const rules = ASHTAKAVARGA_RULES[targetId];
|
|
117
|
+
// Iterate through every Donor (Sun...Sat + Lagna)
|
|
118
|
+
[0, 1, 4, 2, 5, 3, 6, 99].forEach(donorId => {
|
|
119
|
+
const beneficHouses = rules[donorId];
|
|
120
|
+
if (!beneficHouses)
|
|
121
|
+
return;
|
|
122
|
+
const donorSign = getSign(donorId); // 1-12
|
|
123
|
+
// For each benefic house (relative to donor), add a point to that sign
|
|
124
|
+
beneficHouses.forEach(h => {
|
|
125
|
+
// Sign index = (DonorSign + House - 2) % 12 ?
|
|
126
|
+
// Ex: Donor in 1 (Aries). House 1 = Aries.
|
|
127
|
+
// (1 + 1 - 1) = 1.
|
|
128
|
+
// House 2 = Tau. (1 + 2 - 1) = 2.
|
|
129
|
+
let targetSign = (donorSign + h - 1) % 12;
|
|
130
|
+
if (targetSign === 0)
|
|
131
|
+
targetSign = 12;
|
|
132
|
+
// Map to 0-based array index (0=Aries)
|
|
133
|
+
scores[targetSign - 1]++;
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
bav[targetId] = scores;
|
|
137
|
+
// Add to SAV
|
|
138
|
+
scores.forEach((s, idx) => {
|
|
139
|
+
sav[idx] += s;
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
return { bav, sav };
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=ashtakavarga.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ashtakavarga.js","sourceRoot":"","sources":["../src/ashtakavarga.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AAEH,6EAA6E;AAC7E,eAAe;AACf,MAAM,kBAAkB,GAA6C;IACjE,YAAY;IACZ,CAAC,EAAE;QACC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,WAAW;QAC1C,CAAC,EAA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AC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;YAEH,GAAG,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC;YAEvB,aAAa;YACb,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE;gBACtB,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAClB,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;QAEH,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;IACxB,CAAC;CACJ"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { PlanetPosition } from '@node-jhora/core';
|
|
2
|
+
/**
|
|
3
|
+
* Calculates the Drishti Value (Aspect Value) of an Aspecting Planet on an Aspected Planet.
|
|
4
|
+
* Range: 0 to 60 Virupas.
|
|
5
|
+
*
|
|
6
|
+
* @param angle - Angle from Aspecting Planet to Aspected Planet (0-360).
|
|
7
|
+
* Formula: (Aspected - Aspecting + 360) % 360.
|
|
8
|
+
* @param aspectingPlanetId - ID of the planet casting the aspect (for special rules).
|
|
9
|
+
*/
|
|
10
|
+
export declare function calculateDrishtiValue(angle: number, aspectingPlanetId: number): number;
|
|
11
|
+
/**
|
|
12
|
+
* Calculates Drig Bala for a target planet.
|
|
13
|
+
* Sum of 1/4 Drishti from Benefics - 1/4 Drishti from Malefics.
|
|
14
|
+
*
|
|
15
|
+
* @param targetPlanet - The planet receiving aspects.
|
|
16
|
+
* @param allPlanets - List of all planets (containing positions).
|
|
17
|
+
*/
|
|
18
|
+
export declare function calculateDrigBala(targetPlanet: PlanetPosition, allPlanets: PlanetPosition[]): number;
|
package/dist/aspects.js
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { normalize360 } from '@node-jhora/core';
|
|
2
|
+
const SUN = 0;
|
|
3
|
+
const MOON = 1;
|
|
4
|
+
const MERCURY = 2;
|
|
5
|
+
const VENUS = 3;
|
|
6
|
+
const MARS = 4;
|
|
7
|
+
const JUPITER = 5;
|
|
8
|
+
const SATURN = 6;
|
|
9
|
+
// Natural Classification for Aspect Strength
|
|
10
|
+
// Benefics add strength, Malefics subtract strength.
|
|
11
|
+
// Simplification per user instruction: Jup, Ven, Moon, Merc are Benefics.
|
|
12
|
+
const NATURAL_BENEFICS = [JUPITER, VENUS, MOON, MERCURY];
|
|
13
|
+
const NATURAL_MALEFICS = [SUN, MARS, SATURN];
|
|
14
|
+
/**
|
|
15
|
+
* Calculates the Drishti Value (Aspect Value) of an Aspecting Planet on an Aspected Planet.
|
|
16
|
+
* Range: 0 to 60 Virupas.
|
|
17
|
+
*
|
|
18
|
+
* @param angle - Angle from Aspecting Planet to Aspected Planet (0-360).
|
|
19
|
+
* Formula: (Aspected - Aspecting + 360) % 360.
|
|
20
|
+
* @param aspectingPlanetId - ID of the planet casting the aspect (for special rules).
|
|
21
|
+
*/
|
|
22
|
+
export function calculateDrishtiValue(angle, aspectingPlanetId) {
|
|
23
|
+
let drishti = 0;
|
|
24
|
+
// Standard Aspect Formula (BPHS)
|
|
25
|
+
if (angle >= 30 && angle < 60) {
|
|
26
|
+
drishti = (angle - 30) / 2;
|
|
27
|
+
}
|
|
28
|
+
else if (angle >= 60 && angle < 90) {
|
|
29
|
+
drishti = (angle - 60) + 15;
|
|
30
|
+
}
|
|
31
|
+
else if (angle >= 90 && angle < 120) {
|
|
32
|
+
drishti = (120 - angle) / 2 + 30; // 45 down to 30? Wait. Formula Check.
|
|
33
|
+
// User Prompt: "90-120: (120 - Angle) / 2 + 30".
|
|
34
|
+
// At 90: (30)/2 + 30 = 45.
|
|
35
|
+
// At 120: 0/2 + 30 = 30.
|
|
36
|
+
// Seems correct curve (Peak at 90?? No, Standard aspect peaks at 180).
|
|
37
|
+
// Standard curve has minor peak at 90 (45) then drops to 30 at 120.
|
|
38
|
+
}
|
|
39
|
+
else if (angle >= 120 && angle < 150) {
|
|
40
|
+
drishti = 150 - angle; // 30 down to 0 ?
|
|
41
|
+
// User Prompt: "120-150: 150 - Angle".
|
|
42
|
+
// At 120: 30. At 150: 0. Correct.
|
|
43
|
+
}
|
|
44
|
+
else if (angle >= 150 && angle < 180) {
|
|
45
|
+
drishti = (angle - 150) * 2; // 0 up to 60.
|
|
46
|
+
// At 150: 0. At 180: 60. Correct. Max at 180.
|
|
47
|
+
}
|
|
48
|
+
else if (angle >= 180 && angle <= 300) {
|
|
49
|
+
drishti = (300 - angle) / 2; // 180->60. 300->0.
|
|
50
|
+
// At 180: 120/2 = 60. At 300: 0. Correct.
|
|
51
|
+
}
|
|
52
|
+
// Special Aspects (Add to Standard)
|
|
53
|
+
// Mars: Add 15 at 90 (4th house) and 210 (8th house).
|
|
54
|
+
// Jupiter: Add 30 at 120 (5th house) and 240 (9th house).
|
|
55
|
+
// Saturn: Add 45 at 60 (3rd house) and 270 (10th house).
|
|
56
|
+
// How to handle "at 90"? The aspect is a curve.
|
|
57
|
+
// Usually the special aspect is added to the computed value for the RANGE.
|
|
58
|
+
// Or is it a separate full curve?
|
|
59
|
+
// User Prompt: "Add 15 virupas at 90... Implement logic to handle the range around these peaks".
|
|
60
|
+
// Standard interpretation (Drishti Pinda):
|
|
61
|
+
// Special aspect adds a fixed value if the angle is within the "orb" or house?
|
|
62
|
+
// STRICT BPHS interpretation implies the formula CHANGES for these planets.
|
|
63
|
+
// BUT User said "Add to Standard".
|
|
64
|
+
// Let's implement a peak distribution?
|
|
65
|
+
// Simpler interpretation found in software:
|
|
66
|
+
// Special Aspects are full (60) at exact points if standard is 0?
|
|
67
|
+
// E.g. Saturn at 60 (3rd). Standard: (60-60)+15 = 15. Special: +45. Total = 60.
|
|
68
|
+
// Saturn at 270 (10th). Standard: (300-270)/2 = 15. Special: +45. Total = 60.
|
|
69
|
+
// This looks like the intention: Special aspects boost the value to 60 at the peak.
|
|
70
|
+
// How to decay?
|
|
71
|
+
// Let's apply a linear decay +/- 30 degrees around the peak?
|
|
72
|
+
// Or simply rely on the user instruction "Add X virupas".
|
|
73
|
+
// I will add the fixed value if the angle is within +/- 15 degrees of the peak?
|
|
74
|
+
// No, standard aspects are continuous functions.
|
|
75
|
+
// The "Standard Formula" covers the whole 360 circle (mostly).
|
|
76
|
+
// Mars 4th (90): Standard gives 45. Add 15 = 60.
|
|
77
|
+
// Mars 8th (210): Standard gives (300-210)/2 = 45. Add 15 = 60.
|
|
78
|
+
// Jupiter 5th (120): Standard gives 30. Add 30 = 60.
|
|
79
|
+
// Jupiter 9th (240): Standard gives (300-240)/2 = 30. Add 30 = 60.
|
|
80
|
+
// Saturn 3rd (60): Standard gives 15. Add 45 = 60.
|
|
81
|
+
// Saturn 10th (270): Standard gives 15. Add 45 = 60.
|
|
82
|
+
//
|
|
83
|
+
// CONCLUSION: The additives make the special aspects exactly 60 at the peaks.
|
|
84
|
+
// Therefore, I should add the "Boost" if the angle matches?
|
|
85
|
+
// But what about 269 deg?
|
|
86
|
+
// Standard: (300-269)/2 = 15.5.
|
|
87
|
+
// If I add 45, it becomes 60.5 (Over cap). Cap at 60.
|
|
88
|
+
// So the rule is simply: Add the user-specified amount to the standard calculation, Cap at 60.
|
|
89
|
+
// AND: Apply this boost *continuously*?
|
|
90
|
+
// No, usually special aspects are specific Ranges.
|
|
91
|
+
// But notice the standard formula already covers the range.
|
|
92
|
+
// Mars 8th (210) is inside 180-300 range.
|
|
93
|
+
// I will apply the addition everywhere?
|
|
94
|
+
// e.g. Saturn at 180 (7th). Standard 60. Special +45?? No.
|
|
95
|
+
// Saturn has special aspect on 3rd and 10th. Not 7th.
|
|
96
|
+
// So boost applies only "around" 3rd and 10th.
|
|
97
|
+
// However, the prompt says "Saturn: Add 45 virupas at 60... and 270".
|
|
98
|
+
// It doesn't define the width.
|
|
99
|
+
// Given the mathematical perfection of the peak sums (always summing to 60), I will assume the Special Values are added *only* when the standard formula applies to those sectors?
|
|
100
|
+
// Angle 60 is start of 60-90 sector.
|
|
101
|
+
// Angle 270 is inside 180-300.
|
|
102
|
+
// I will add the boost if the angle is "close" to the peak?
|
|
103
|
+
// Actually, widespread implementation:
|
|
104
|
+
// Special aspect is a separate calculation, take MAX? No, prompt says ADD.
|
|
105
|
+
// I will add the specific value only if Angle is within +/- 15 deg of peak?
|
|
106
|
+
// Or maybe the prompt implies the Addition is constant for the House?
|
|
107
|
+
// Let's look at the math again.
|
|
108
|
+
// Saturn 60: Standard = 15.
|
|
109
|
+
// If we want it to be 60, we add 45.
|
|
110
|
+
// Saturn at 61: Standard = 16. If we add 45 -> 61 (Cap 60).
|
|
111
|
+
// Saturn at 89: Standard = 44. If we add 45 -> 89 (Cap 60).
|
|
112
|
+
// This seems to imply full strength across the house?
|
|
113
|
+
// Let's assume the boosted value is applied *at the peak* and we linearly interpolate?
|
|
114
|
+
// NO, that's too complex for "Phase 5".
|
|
115
|
+
//
|
|
116
|
+
// SIMPLIFICATION:
|
|
117
|
+
// I will checking if angle is within +/- 10 degrees of the peak, and add the full value, capping at 60.
|
|
118
|
+
// Mars: Peak 90, 210.
|
|
119
|
+
// Jup: Peak 120, 240.
|
|
120
|
+
// Sat: Peak 60, 270.
|
|
121
|
+
// Better yet: Just apply the addition logic continuously using a bell curve? No.
|
|
122
|
+
//
|
|
123
|
+
// STRICT INTERPRETATION of "Add 15 virupas at 90":
|
|
124
|
+
// It likely implies the term is simply added.
|
|
125
|
+
// But WHERE?
|
|
126
|
+
// Let's assume specific "Special Aspect Value" is added if the angle falls in the *Sign* roughly?
|
|
127
|
+
// BPHS implies Full Aspect on 4th House.
|
|
128
|
+
// 4th House = 90 deg to 120 deg (Whole Sign) or Peak at 90.
|
|
129
|
+
//
|
|
130
|
+
// Let's follow the standard "Drishti Pinda" calculation method found in reputable sources (e.g. Raman/JHora logic):
|
|
131
|
+
// Special aspects are added.
|
|
132
|
+
// Mars: Add 15 to angles 30-120?? No.
|
|
133
|
+
//
|
|
134
|
+
// REVISIT PROMPT: "Implement logic to handle the range around these peaks".
|
|
135
|
+
// User left it to me.
|
|
136
|
+
// Logic: Use a simplified "orb" of +/- 15 degrees (1 sign width total).
|
|
137
|
+
// Within Peak +/- 15 deg, add the bonus.
|
|
138
|
+
let specialBoost = 0;
|
|
139
|
+
if (aspectingPlanetId === MARS) {
|
|
140
|
+
// 90 (4th) +/- 15
|
|
141
|
+
if (Math.abs(angle - 90) <= 15)
|
|
142
|
+
specialBoost += 15;
|
|
143
|
+
// 210 (8th) +/- 15
|
|
144
|
+
if (Math.abs(angle - 210) <= 15)
|
|
145
|
+
specialBoost += 15;
|
|
146
|
+
}
|
|
147
|
+
else if (aspectingPlanetId === JUPITER) {
|
|
148
|
+
// 120 (5th) +/- 15
|
|
149
|
+
if (Math.abs(angle - 120) <= 15)
|
|
150
|
+
specialBoost += 30;
|
|
151
|
+
// 240 (9th) +/- 15
|
|
152
|
+
if (Math.abs(angle - 240) <= 15)
|
|
153
|
+
specialBoost += 30;
|
|
154
|
+
}
|
|
155
|
+
else if (aspectingPlanetId === SATURN) {
|
|
156
|
+
// 60 (3rd) +/- 15
|
|
157
|
+
if (Math.abs(angle - 60) <= 15)
|
|
158
|
+
specialBoost += 45;
|
|
159
|
+
// 270 (10th) +/- 15
|
|
160
|
+
if (Math.abs(angle - 270) <= 15)
|
|
161
|
+
specialBoost += 45;
|
|
162
|
+
}
|
|
163
|
+
// Apply boost
|
|
164
|
+
drishti += specialBoost;
|
|
165
|
+
// Cap at 60
|
|
166
|
+
return Math.min(drishti, 60);
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Calculates Drig Bala for a target planet.
|
|
170
|
+
* Sum of 1/4 Drishti from Benefics - 1/4 Drishti from Malefics.
|
|
171
|
+
*
|
|
172
|
+
* @param targetPlanet - The planet receiving aspects.
|
|
173
|
+
* @param allPlanets - List of all planets (containing positions).
|
|
174
|
+
*/
|
|
175
|
+
export function calculateDrigBala(targetPlanet, allPlanets) {
|
|
176
|
+
let score = 0;
|
|
177
|
+
for (const aspectingPlanet of allPlanets) {
|
|
178
|
+
if (aspectingPlanet.id === targetPlanet.id)
|
|
179
|
+
continue;
|
|
180
|
+
if (aspectingPlanet.id > SATURN)
|
|
181
|
+
continue; // Ignore Rahu/Ketu for Aspect Strength usually
|
|
182
|
+
// Calculate Angle: (Aspected - Aspecting)
|
|
183
|
+
// Ensure 0-360 positive
|
|
184
|
+
let angle = normalize360(targetPlanet.longitude - aspectingPlanet.longitude);
|
|
185
|
+
const drishtiValue = calculateDrishtiValue(angle, aspectingPlanet.id);
|
|
186
|
+
if (drishtiValue > 0) {
|
|
187
|
+
const quarterDrishti = drishtiValue / 4;
|
|
188
|
+
if (NATURAL_BENEFICS.includes(aspectingPlanet.id)) {
|
|
189
|
+
score += quarterDrishti;
|
|
190
|
+
}
|
|
191
|
+
else if (NATURAL_MALEFICS.includes(aspectingPlanet.id)) {
|
|
192
|
+
score -= quarterDrishti;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
return score;
|
|
197
|
+
}
|
|
198
|
+
//# sourceMappingURL=aspects.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aspects.js","sourceRoot":"","sources":["../src/aspects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAuC,MAAM,kBAAkB,CAAC;AAErF,MAAM,GAAG,GAAG,CAAC,CAAC;AACd,MAAM,IAAI,GAAG,CAAC,CAAC;AACf,MAAM,OAAO,GAAG,CAAC,CAAC;AAClB,MAAM,KAAK,GAAG,CAAC,CAAC;AAChB,MAAM,IAAI,GAAG,CAAC,CAAC;AACf,MAAM,OAAO,GAAG,CAAC,CAAC;AAClB,MAAM,MAAM,GAAG,CAAC,CAAC;AAEjB,6CAA6C;AAC7C,qDAAqD;AACrD,0EAA0E;AAC1E,MAAM,gBAAgB,GAAG,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AACzD,MAAM,gBAAgB,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AAE7C;;;;;;;GAOG;AACH,MAAM,UAAU,qBAAqB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C,+CAA+C;QAE1F,0CAA0C;QAC1C,wBAAwB;QACxB,IAAI,KAAK,GAAG,YAAY,CAAC,YAAY,CAAC,SAAS,GAAG,eAAe,CAAC,SAAS,CAAC,CAAC;QAE7E,MAAM,YAAY,GAAG,qBAAqB,CAAC,KAAK,EAAE,eAAe,CAAC,EAAE,CAAC,CAAC;QAEtE,IAAI,YAAY,GAAG,CAAC,EAAE,CAAC;YACnB,MAAM,cAAc,GAAG,YAAY,GAAG,CAAC,CAAC;YAExC,IAAI,gBAAgB,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,EAAE,CAAC;gBAChD,KAAK,IAAI,cAAc,CAAC;YAC5B,CAAC;iBAAM,IAAI,gBAAgB,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,EAAE,CAAC;gBACvD,KAAK,IAAI,cAAc,CAAC;YAC5B,CAAC;QACL,CAAC;IACL,CAAC;IAED,OAAO,KAAK,CAAC;AACjB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { calculateShadbala, ShadbalaResult } from './shadbala.js';
|
|
2
|
+
import { Ashtakavarga, AshtakavargaResult } from './ashtakavarga.js';
|
|
3
|
+
import { YogaEngine, ChartData } from './yogas/engine.js';
|
|
4
|
+
import { YOGA_LIBRARY } from './yogas/library.js';
|
|
5
|
+
export type { ShadbalaResult, AshtakavargaResult, ChartData };
|
|
6
|
+
export { calculateShadbala, Ashtakavarga, YogaEngine, YOGA_LIBRARY };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { calculateShadbala } from './shadbala.js';
|
|
2
|
+
import { Ashtakavarga } from './ashtakavarga.js';
|
|
3
|
+
import { YogaEngine } from './yogas/engine.js';
|
|
4
|
+
import { YOGA_LIBRARY } from './yogas/library.js';
|
|
5
|
+
export { calculateShadbala, Ashtakavarga, YogaEngine, YOGA_LIBRARY };
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAkB,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,YAAY,EAAsB,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,UAAU,EAAa,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAIlD,OAAO,EACH,iBAAiB,EACjB,YAAY,EACZ,UAAU,EACV,YAAY,EACf,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { PlanetPosition, HouseData } from '@node-jhora/core';
|
|
2
|
+
export interface ShadbalaInput {
|
|
3
|
+
planet: PlanetPosition;
|
|
4
|
+
allPlanets: PlanetPosition[];
|
|
5
|
+
houses: HouseData;
|
|
6
|
+
sun: PlanetPosition;
|
|
7
|
+
moon: PlanetPosition;
|
|
8
|
+
timeDetails: {
|
|
9
|
+
sunrise: number;
|
|
10
|
+
sunset: number;
|
|
11
|
+
birthHour: number;
|
|
12
|
+
};
|
|
13
|
+
vargaPositions: VargaInfo[];
|
|
14
|
+
}
|
|
15
|
+
export interface ShadbalaResult {
|
|
16
|
+
total: number;
|
|
17
|
+
sthana: number;
|
|
18
|
+
dig: number;
|
|
19
|
+
kaala: number;
|
|
20
|
+
chesta: number;
|
|
21
|
+
naisargika: number;
|
|
22
|
+
drig: number;
|
|
23
|
+
ishtaPhala: number;
|
|
24
|
+
kashtaPhala: number;
|
|
25
|
+
breakdown: {
|
|
26
|
+
uchcha: number;
|
|
27
|
+
saptavargaja: number;
|
|
28
|
+
kendra: number;
|
|
29
|
+
ojayugma: number;
|
|
30
|
+
dig: number;
|
|
31
|
+
natonata: number;
|
|
32
|
+
paksha: number;
|
|
33
|
+
tribhaga: number;
|
|
34
|
+
ayana: number;
|
|
35
|
+
chesta: number;
|
|
36
|
+
naisargika: number;
|
|
37
|
+
drig: number;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Calculates Full Shadbala for a single planet.
|
|
42
|
+
*/
|
|
43
|
+
export declare function calculateShadbala(input: ShadbalaInput): ShadbalaResult;
|
|
44
|
+
/**
|
|
45
|
+
* Calculates Uchcha Bala (Exaltation Strength).
|
|
46
|
+
* Formula: (1/3) * (180 - |long - exaltPoint|)
|
|
47
|
+
* If |diff| > 180, use (360 - |diff|).
|
|
48
|
+
*/
|
|
49
|
+
export declare function calculateUchchaBala(planetId: number, longitude: number): number;
|
|
50
|
+
/**
|
|
51
|
+
* Calculates Kendra Bala (Kendra Strength).
|
|
52
|
+
* Kendra (1, 4, 7, 10): 60
|
|
53
|
+
* Panapara (2, 5, 8, 11): 30
|
|
54
|
+
* Apoklima (3, 6, 9, 12): 15
|
|
55
|
+
*
|
|
56
|
+
* @param houseNumber - 1-based house number relative to Ascendant
|
|
57
|
+
*/
|
|
58
|
+
export declare function calculateKendraBala(houseNumber: number): number;
|
|
59
|
+
/**
|
|
60
|
+
* Calculates Ojayugmarasyamsa Bala (Odd/Even Sign/Navamsa Strength).
|
|
61
|
+
* Female: 15 in Even Rashi / Even Navamsa.
|
|
62
|
+
* Male: 15 in Odd Rashi / Odd Navamsa.
|
|
63
|
+
*/
|
|
64
|
+
export declare function calculateOjayugmarasyamsaBala(planetId: number, rashiSign: number, navamsaSign: number): number;
|
|
65
|
+
/**
|
|
66
|
+
* Calculates Saptavargaja Bala (Strength in 7 Divisional Charts).
|
|
67
|
+
* D1, D2, D3, D7, D9, D12, D30.
|
|
68
|
+
* Uses Compound Relationship (Panchadha Maitri) with the Lord of the Sign occupied.
|
|
69
|
+
* Scores: GF=22.5, F=15, N=11.25, E=7.5, GE=3.75
|
|
70
|
+
*
|
|
71
|
+
* @param planetId
|
|
72
|
+
* @param vargaData - Array of objects { vargaName: string, sign: number, lordId: number, rashiSignOfLord: number }
|
|
73
|
+
* Note: We need rashiSignOfLord to calculate Tatkalika (Temprary) relationship from the Rashi Chart relative to current Planet's Rashi position?
|
|
74
|
+
* User Prompt: "Calculate the relationship of the planet with the lord of the sign it resides in."
|
|
75
|
+
* Typically, Tatkalika is from Rashi Asc? No, from Planet A to Planet B in Rashi.
|
|
76
|
+
* So we need: Planet A's Rashi Sign and Planet B (Lord)'s Rashi Sign.
|
|
77
|
+
*
|
|
78
|
+
* @param planetRashiSign - Sign of the planet in D1 (for Tatkalika calculation base)
|
|
79
|
+
* @param vargaLords - Maps vargaName/Id -> { lordId: number, lordRashiSign: number }
|
|
80
|
+
*/
|
|
81
|
+
export interface VargaInfo {
|
|
82
|
+
vargaName: string;
|
|
83
|
+
sign: number;
|
|
84
|
+
lordId: number;
|
|
85
|
+
lordRashiSign: number;
|
|
86
|
+
}
|
|
87
|
+
export declare function calculateSaptavargajaBala(planetId: number, planetRashiSign: number, vargaPositions: VargaInfo[]): number;
|