Urgent.News

What's breaking now, across hundreds of outlets.

Tech

How I Built a Real-Time Synastry Engine for Lunary

Synastry is the astrology of relationships. Computing it properly means calculating aspects between every planet in two birth charts simultaneously.

How I Built a Real-Time Synastry Engine for Lunary

Synastry is the branch of astrology that examines relationships by comparing two birth charts. For Lunary, I implemented a real-time synastry engine that calculates 36 planetary aspects simultaneously using observatory-grade positional data. A birth chart consists of ten primary celestial bodies, including Sun, Moon, Mercury, Venus, Mars, Jupiter, Saturn, Uranus, Neptune, and Pluto.

To compute synastry between two charts, each body in chart A is compared against each body in chart B, resulting in 100 possible pairings. After filtering, around 30-40 active aspects per pair of charts remain. For each pair, the angular separation, aspect type, exactness, and applying or separating status are determined. Lunary utilizes astronomy-engine with VSOP87 planetary theory and NOVAS C 3.1 methods from the US Naval Observatory to obtain arcminute precision.

The algorithm starts by obtaining ecliptic longitude for each celestial body in both charts. It then compares every pair of bodies and calculates the angular separation, aspect type, deviation from the ideal angle, and normalised deviation. The aspect strength is determined by scoring each aspect based on planet significance and aspect type, with applying aspects considered stronger.

After scoring, the top 10-12 aspects are displayed prominently, while the full 36 are available upon request. The computation of 36 aspects for two birth charts takes under 2ms, while astronomical position calculations take approximately 10ms for 10 bodies. The entire synastry computation process occurs within 100ms, including network time, and positions are cached for efficiency.

The Circle feature in Lunary displays synastry as a grid, with chart A's planets across the top and chart B's planets down the side, highlighting strong aspects with summary interpretations based on the planet combination and aspect type.

Rewritten by urgent.news; may contain errors โ€” check the original.

Source: hackernoon.com

Read the original at hackernoon.com โ†’

More from HackerNoon on urgent.news

Report a problem with this story

Get the day's news by email. Daily, weekly or monthly. Sign up

More in Tech

More from Friday, 4 December 2026 โ†’