Vedākṣha

Integration Guide

House Systems

Vedākṣha supports 10 house systems through a single unified API. Pass any HouseSystem variant and receive the 12 cusp longitudes, the Ascendant, and the Midheaven.

Computing House Cusps

House computation requires four inputs: the house system, the Right Ascension of the Midheaven (RAMC), the geographic latitude of the location, and the true obliquity of the ecliptic at the moment of interest. Vedākṣha computes obliquity and RAMC internally when you call compute_houses.

houses.rs
use vedaksha::prelude::*;

fn main() -> Result<(), VedakshaError> {
    let jd = calendar_to_jd(2024, 3, 20, 12.0);

    // Geographic coordinates: New Delhi
    let latitude  = 28.6139_f64;
    let longitude = 77.2090_f64;

    let houses = compute_houses(
        HouseSystem::Placidus,
        jd,
        latitude,
        longitude,
    )?;

    println!("ASC : {:.4}°", houses.ascendant);
    println!("MC  : {:.4}°", houses.midheaven);

    for (i, cusp) in houses.cusps.iter().enumerate() {
        println!("H{:<2} : {:.4}°", i + 1, cusp);
    }

    Ok(())
}

Output Structure

.cusps[f64; 12]

Array of 12 ecliptic longitudes (0–360°), one per house cusp, starting with the 1st house.

.ascendantf64

Ecliptic longitude of the Ascendant (1st house cusp). Equivalent to cusps[0] in most systems.

.midheavenf64

Ecliptic longitude of the Midheaven (MC). The 10th house cusp in most systems.

.systemHouseSystem

The system used for this computation, echoed back for validation and serialization.

Switching Systems at Runtime

The house system is a plain enum variant passed per-call. There is no global state to set. Computing the same chart in multiple systems is a loop over variants.

compare_systems.rs
let systems = [
    HouseSystem::Placidus,
    HouseSystem::Koch,
    HouseSystem::WholeSign,
    HouseSystem::Sripathi,
];

for system in systems {
    let h = compute_houses(system, jd, lat, lon)?;
    println!("{:?} ASC: {:.2}°", system, h.ascendant);
}

Polar Latitude Fallback

Time-based systems such as Placidus and Koch become geometrically undefined at latitudes above roughly 66° (the Arctic/Antarctic circles). When a computation fails due to an extreme latitude, Vedākṣha automatically retries with the Equal house system and attaches a structured warning to the result.

if let Some(warning) = houses.warning {
    // warning.code == "POLAR_FALLBACK"
    // warning.system_used == HouseSystem::Equal
    println!("Fell back to {:?}: {}", warning.system_used, warning.message);
}

All 10 Systems

Variant
When Used
HouseSystem::Placidus

Time-based division of the diurnal arc. Most widely used in modern Western practice.

HouseSystem::Koch

Birthplace system. Derived from the RAMC and geographic latitude using house cusps based on the time of day.

HouseSystem::Equal

Each house spans exactly 30° from the Ascendant. Simple, predictable, and recommended at extreme latitudes.

HouseSystem::WholeSign

Each sign is one entire house. The oldest known system, standard in Hellenistic and traditional Vedic practice.

HouseSystem::Campanus

Divides the prime vertical into 12 equal arcs. Associated with Campananus of Novara (13th century).

HouseSystem::Regiomontanus

Divides the celestial equator into 12 equal arcs. Common in horary and traditional European astrology.

HouseSystem::Porphyry

Trisects each quadrant between the four angles. Simple and works at all latitudes.

HouseSystem::Morinus

Divides the celestial equator equally from the MC. Avoids the distortion problems of time-based systems.

HouseSystem::Alcabitius

Semi-arc system from medieval Arabic tradition. Divides the diurnal semi-arc of the Ascendant degree.

HouseSystem::Sripathi

Vedic Porphyry variant. Trisects the quadrants using sidereal positions; used in some Jyotish traditions.