Skip to content

Seven Governors (七政四餘)

Chinese sidereal astrology system placing 11 celestial bodies (7 planets + 4 lunar points) in 28 lunar mansions and 12 palaces. Supports three sidereal conversion modes (modern precession, classical epoch, fixed ayanamsa) and configurable Ketu interpretation (osculating apogee or descending node).

For historical context, the Ketu/Rahu translation problem, the Schall controversy, and scholarly references: Seven Governors — Computation Methods & History

Source files

FileDescription
src/seven-governors/sidereal.tsSidereal conversion engine (three modes)
src/seven-governors/four-remainders.tsRahu, Ketu, Yuebei, Purple Qi computation
src/seven-governors/data/mansion-boundaries.ts28 mansion boundary data from Hipparcos
src/seven-governors/chart.tsChart assembly, aspects, dignities, star spirits

Chart Assembly

ExportDescription
getSevenGovernorsChart(date, location, options?)Complete 七政四餘 natal chart with all 11 bodies

Sidereal Conversion

ExportDescription
toSiderealLongitude(tropicalLon, date, mode?)Convert tropical → sidereal longitude (3 modes: modern, classical, ayanamsa)

The sidereal engine anchors 0° to Spica (α Virginis, J2000.0 tropical longitude 201.2983°). Three modes via SiderealMode:

ModeAyanamsa computationUse case
modern (default)SPICA_J2000 + precession(T)/3600 using IAU precession modelModern astronomical accuracy
classicalFixed ayanamsa from a historical epoch (開元 724 CE or 崇禎 1628 CE)Reproducing historical charts
ayanamsaUser-supplied fixed valueInteroperability with other systems

Four Remainders (四餘)

ExportDescription
getRahuPosition(date)羅睺: Moon's mean ascending node (~18.6-year retrograde cycle)
getKetuPosition(date, mode?)計都: osculating lunar apogee (default) or descending node
getYuebeiPosition(date)月孛: mean lunar apogee (Black Moon Lilith)
getPurpleQiPosition(date)紫氣: classical ~28-year prograde cycle

Ketu mode (KetuMode)

The ketuMode option controls which astronomical identification is used for 計都:

typescript
type KetuMode = 'apogee' | 'descending-node';
  • 'apogee' (default): Chinese 七政四餘 convention per 《果老星宗》 and Niu Weixing (1994) — 計都 as the osculating lunar apogee with 5-term perturbation correction
  • 'descending-node': Original Indian Jyotish convention — Ketu as the point diametrically opposite Rahu

See The Ketu–Rahu Translation Problem for the historical analysis behind this option.

Mansion & Palace Lookup

ExportDescription
getMansionForLongitude(siderealLon)Map sidereal longitude to one of 28 lunar mansions
getPalaceForLongitude(siderealLon)Map sidereal longitude to one of 12 palaces
getAscendant(date, location)Compute ascending degree from birth time and location

Mansion lookup uses binary search on the sorted boundary array, handling the wrap-around at the 軫/角 boundary (360° → 0°). Palace assignment is floor(lon / 30).

Implementation Status

FeatureStatusNotes
Seven governors positionsCompleteVSOP87D + DE441 correction for Sun; Meeus Ch. 47 for Moon; VSOP87D for planets
Four remaindersCompleteMeeus Ch. 22 polynomials + 5-term perturbation
Mansion boundariesApproximateHipparcos J2000.0 positions; may differ 1–2° from historical values
Palace starting pointNeeds verification辰宮 at 0° assumed; pending textual confirmation from 《果老星宗》
Purple Qi epochProvisionalEpoch longitude set to 0° pending sourcing
Dignity tablePartialSun/Moon complete; remaining 9 bodies default to 平
Star spirit rules3 of ~50–80Only 日月夾命, 祿存, 火鈴夾命 implemented
AscendantCompleteStandard astronomical formula via GMST + obliquity

Types

typescript
type Governor = 'sun' | 'moon' | 'mercury' | 'venus' | 'mars' | 'jupiter' | 'saturn';
type Remainder = 'rahu' | 'ketu' | 'yuebei' | 'purpleQi';
type GovernorOrRemainder = Governor | Remainder;
type SiderealMode = { type: 'modern' } | { type: 'classical'; epoch: 'kaiyuan' | 'chongzhen' | number } | { type: 'ayanamsa'; value: number };
type KetuMode = 'apogee' | 'descending-node';
type MansionName = '角' | '亢' | ... | '軫';  // 28 lunar mansion names
type PalaceName = '子宮' | '丑宮' | ... | '亥宮';  // 12 palace names
type Dignity = '廟' | '旺' | '平' | '陷';
type AspectType = '合' | '沖' | '刑' | '三合';

interface BodyPosition { siderealLon: number; tropicalLon: number; mansion: MansionName; mansionDegree: number; palace: PalaceName; }
interface PalaceInfo { name: PalaceName; role: PalaceRole; mansions: MansionName[]; occupants: GovernorOrRemainder[]; }
interface SevenGovernorsOptions { siderealMode?: SiderealMode; ketuMode?: KetuMode; }
interface SevenGovernorsChart { date: Date; location: { lat: number; lon: number }; siderealMode: SiderealMode; ketuMode: KetuMode; bodies: Record<GovernorOrRemainder, BodyPosition>; palaces: PalaceInfo[]; ascendant: { mansion: MansionName; palace: PalaceName }; starSpirits: StarSpirit[]; aspects: Aspect[]; dignities: Record<GovernorOrRemainder, Dignity>; }