High-precision astrology engine for chart calculation and data analysis.
- High-Precision Ephemeris: Powered by
astronomy-engine(J2000 -> Tropical conversion). - Supported Bodies: Sun, Moon, Planets, True Nodes, Lilith, and Asteroids (Ceres, Pallas, Juno, Vesta).
- Multiple House Systems: Supports Placidus (iterative), Whole Sign, and Equal house systems.
- Advanced Interpretations:
- Dignities: Rule-based scoring (Domicile, Exaltation, Detriment, Fall).
- Elements & Modalities: Weighted breakdown of chart composition.
- Vedic Integration: Nakshatra mapping and Harmonic charts (e.g., Navamsa D9).
- Esoteric Points: Arabic Parts (Lot of Fortune with Day/Night logic) and Midpoints.
To get started, clone the repository to your local machine:
git clone https://github.com/NeaByteLab/Astrology.git
cd AstrologyThis project uses Deno. Ensure you have Deno installed on your system.
You can use the Birth class as the main coordinator to calculate charts, accurate to the second and coordinate.
import { Birth } from './src/index.ts'
// 1. Initialize with Date, Latitude, and Longitude
const birthDate = new Date('1970-01-01T12:00:00Z')
const latitude = 40.7128 // New York
const longitude = -74.006
const engine = new Birth(birthDate, latitude, longitude)
// 2. Calculate Planetary Positions (Tropical Zodiac)
const planets = engine.calculatePositions()
// 3. Calculate House Cusps (Placidus, WholeSign, etc.)
const houses = engine.calculateHouses('Placidus')
// 4. Calculate Aspects
const aspects = engine.calculateAspects(planets)
// 5. Get Extended Data (Nodes, Asteroids, etc.)
const extended = engine.calculateExtendedPositions()
console.table(planets)Initializes the engine with the subject's birth data.
Parameters:
birthDate: Date- JavaScript Date object representing the exact time of birth.latitude: number- Geographic latitude (negative for South).longitude: number- Geographic longitude (positive for East, negative for West).
Calculates geocentric positions for major planets (Sun through Pluto) in the Tropical Zodiac.
Returns: NatalPlanetPosition[] - Array of planetary coordinates and zodiac signs.
Calculates house cusps based on the specified system.
Parameters:
system: 'Placidus' | 'WholeSign' | 'Equal'- (Optional) The house system to use. Defaults to'Placidus'.
Returns: NatalHousesOutput - structured data containing Ascendant, Midheaven, and all 12 cusps.
Identifies geometric angles between planets (Conjunction, Opposition, Trine, Square, Sextile).
Parameters:
positions: NatalPlanetPosition[]- Array of planetary positions.includeMinor: boolean- (Optional) Include minor aspects (Semi-Sextile, Quincunx, etc). Defaults tofalse.
Returns: NatalAspect[] - List of aspects with orbs.
Calculates the "Lot of Fortune" and other Arabic Parts, adjusting for Day/Night charts.
Parameters:
positions: NatalPlanetPosition[]- Array of planetary positions.houses: NatalHousesOutput- Calculated house data (requires Ascendant).
Returns: NatalArabicPart[] - Calculated esoteric points.
Calculates the mathematical midpoint (average longitude) between every pair of planets.
Returns: NatalMidpoint[] - List of all planetary midpoints.
Calculates positions for a harmonic chart (e.g., Navamsa D9) by multiplying longitudes.
Parameters:
harmonicNumber: number- The harmonic multiplier (e.g., 9 for Navamsa).
Returns: NatalHarmonicPosition[] - Transformed positions.
Calculates positions for Lunar Nodes (True Node), Lilith (Mean Apogee), and the "Big Four" asteroids (Ceres, Pallas, Juno, Vesta).
Returns: NatalPlanetPosition[] - Array of extended body positions.
Generates a balance sheet of Elements (Fire, Earth, Air, Water) and Modalities (Cardinal, Fixed, Mutable).
Returns: NatalSummary - Distribution scores.
export interface NatalPlanetPosition {
/** Standard planetary body name */
name: string
/** Ecliptic longitude in degrees */
longitude: number
/** Zodiac sign name label */
sign: string
/** Degrees within the sign */
degree: number
/** Minutes within the degree */
minute: number
/** Calculated dignity strength data */
dignity?: NatalDignity
/** Vedic lunar mansion name */
nakshatra?: string
}
export interface NatalHouseResult {
/** Standard house name label */
name: string
/** Cusp ecliptic longitude degrees */
longitude: number
/** Zodiac sign name label */
sign: string
/** Degrees within the sign */
degree: number
/** Minutes within the degree */
minute: number
}This project is licensed under the MIT license. See the LICENSE file for more info.