The math behind astrocartography lines
Every planet produces four lines on the world map. MC, IC, Ascendant, Descendant. Each is a different equation, and they all reduce to the same question: where on Earth was this planet exactly overhead, rising, or setting at the moment of birth?
Astrocartography is the practice of projecting a birth chart onto a world map. The idea is straightforward: at the moment of birth, each planet occupied a specific position in the sky. That position corresponds to specific geographic locations where the planet was culminating at the top of the sky, rising on the eastern horizon, setting on the western horizon, or crossing the nadir directly underfoot. Those locations form lines across the map.
Implementing this requires computing four different geometric relationships between a planet's equatorial coordinates and every point on Earth's surface. Here is how the math works.
1. The four line types
| Line | Meaning | Geometry |
|---|---|---|
| MC (Midheaven) | Planet was at the top of the sky | Vertical meridian |
| IC (Nadir) | Planet was directly underfoot | Vertical meridian, 180° from MC |
| ASC (Ascendant) | Planet was rising on the eastern horizon | Curved line across latitudes |
| DSC (Descendant) | Planet was setting on the western horizon | Curved line across latitudes |
The first step for all four lines is converting the planet's ecliptic longitude and latitude to equatorial coordinates (right ascension RA and declination dec), using the true obliquity of the ecliptic at the birth date.
2. MC and IC lines: one equation, two meridians
A planet culminates at the Midheaven when the Local Sidereal Time equals its Right Ascension. Local Sidereal Time equals Greenwich Apparent Sidereal Time plus geographic longitude. So the MC line is the meridian where:
GAST + longitude_MC = RA
longitude_MC = RA - GAST
That is a single vertical line on the map. The IC line is exactly 180° from it. In code:
const gst = getSiderealTime(birthDate) // GAST in degrees
const mcLon = wrap180(ra - gst)
const icLon = wrap180(ra - gst + 180)
GAST comes from the astronomy-engine's SiderealTime() function, which applies full IAU 2000/2006 nutation corrections. Using the simpler mean sidereal time causes a systematic error of about 0.1 degrees in the MC line position, which at mid-latitudes corresponds to roughly 10 kilometers of geographic displacement.
3. ASC and DSC curves: the horizon equation
A planet rises on the eastern horizon when its hour angle H satisfies the standard horizon equation:
cos H = -tan(latitude) * tan(declination)
The corresponding geographic longitude for the rising point is:
longitude_rise = RA - H - GAST
This is computed at every 2-degree latitude step between -70° and +70°:
for (let phi = -70; phi <= 70; phi += 2) {
const c = -Math.tan(phi * R) * Math.tan(dec * R)
if (c < -1 || c > 1) continue // circumpolar: planet never rises here
const H = Math.acos(c) * D
lever.push({ lat: phi, lon: wrap180(ra - H - gst) }) // ASC
coucher.push({ lat: phi, lon: wrap180(ra + H - gst) }) // DSC
}
When |c| exceeds 1, the planet is circumpolar at that latitude: either it never sets (always above the horizon) or it never rises (always below). The curve simply ends at that latitude. This is a physical limit of the geometry, not a code limitation.
Key fact about the lines: they depend exclusively on the birth moment (date and time), not on the birth location. The birth place determines which lines run through which cities for the person. It does not move the lines themselves.
4. Projection: equirectangular and why
The map uses an equirectangular (Plate Carrée) projection:
function px(lon) { return (lon + 180) / 360 * WIDTH }
function py(lat) { return (90 - lat) / 180 * HEIGHT }
This was chosen deliberately. MC and IC lines are geographic meridians, which in equirectangular projection are true vertical lines. In a Mercator or Robinson projection they would curve, which would misrepresent the geometry. The Ascendant and Descendant curves are not straight lines in any projection, but they look similar across common choices, so the projection decision is driven by the meridian case.
5. The antimeridian problem
The Ascendant and Descendant curves cross the antimeridian (180°/-180° boundary) somewhere in the Pacific. When two consecutive computed points jump from +179° to -179°, drawing a straight segment between them produces a horizontal line across the entire map.
The fix is to split the polyline into segments whenever consecutive points differ by more than 180° in longitude:
function splitCurve(pts) {
const segments = []
let current = []
for (const pt of pts) {
if (current.length) {
const d = Math.abs(pt.lon - current.at(-1).lon)
if (d > 180) { segments.push(current); current = [] }
}
current.push(pt)
}
if (current.length) segments.push(current)
return segments
}
The same logic runs in both the SVG renderer and the MapLibre GeoJSON layer. Each segment becomes a separate polyline. The map shows two curve fragments on either side of the antimeridian, which is the correct representation.
6. City proximity: kilometers, not degrees
The map annotates cities that fall within a threshold distance of any line. The original implementation measured proximity in degrees of longitude difference. This made the threshold twice as strict at high latitudes (where longitude degrees are narrow) as at the equator (where they are wide).
The fix is to convert longitude difference to kilometers using the cosine of latitude:
const km = (dlon, lat) =>
Math.abs(dlon) * 111.32 * Math.cos(lat * Math.PI / 180)
The threshold is 400 kilometers, which is the standard orb used in published astrocartography literature. A city at 60° north latitude needs to be within 400 km of a line, which is about 7° of longitude there, not the 3.6° that an uncorrected degree-based threshold would give.