Detect if an ingress occurred between two positions.
Array of 12 house cusp longitudes
Current position of the body
Previous position of the body
The celestial body (for naming)
Whether the body is in retrograde motion
HouseIngress if a cusp was crossed, null otherwise
This compares the house placement at two times to determine if a house boundary was crossed. It handles both direct and retrograde motion, as well as the 12→1 house wraparound.
const cusps = [0, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330];const ingress = detectHouseIngress(cusps, 35, 25, CelestialBody.Saturn, false);// Returns: { body: 'Saturn', house: 2, previousHouse: 1, direction: 'entering', isRetrograde: false } Copy
const cusps = [0, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330];const ingress = detectHouseIngress(cusps, 35, 25, CelestialBody.Saturn, false);// Returns: { body: 'Saturn', house: 2, previousHouse: 1, direction: 'entering', isRetrograde: false }
Detect if an ingress occurred between two positions.