🐧 Linux TippsGitHub Release: ddev/ddev v1.25.4 (04.09.2026)(04.09.2026 um 20:07 Uhr)
🔧 ProgrammierungGitHub Release: rust-lang/rust v1.98.1 (03.09.2026)(03.09.2026 um 15:14 Uhr)
🔧 AI Nachrichten GitHub Release: openai/codex vrust-v0.155.0-alpha.3.1 (11.09.2026)(11.09.2026 um 05:17 Uhr)
🔧 AI Nachrichten GitHub Release: openai/codex vrust-v0.155.0-alpha.3.2 (11.09.2026)(11.09.2026 um 06:11 Uhr)
🔧 AI Nachrichten GitHub Release: openai/codex vrust-v0.155.0-alpha.3.3 (11.09.2026)(11.09.2026 um 06:23 Uhr)
🔧 AI Nachrichten GitHub Release: openai/codex vrust-v0.155.0-alpha.3.4 (11.09.2026)(11.09.2026 um 06:44 Uhr)
🔧 AI Nachrichten GitHub Release: openai/codex vrust-v0.155.0-alpha.3.5 (11.09.2026)(11.09.2026 um 07:07 Uhr)
🔧 AI Nachrichten GitHub Release: openai/codex vrust-v0.155.0-alpha.3.6 (11.09.2026)(11.09.2026 um 08:08 Uhr)
🔧 AI Nachrichten GitHub Release: openai/codex vrust-v0.155.0-alpha.3.7 (11.09.2026)(11.09.2026 um 10:17 Uhr)
🐧 Linux TippsGitHub Release: ddev/ddev v1.25.4 (04.09.2026)(04.09.2026 um 20:07 Uhr)
🔧 ProgrammierungGitHub Release: rust-lang/rust v1.98.1 (03.09.2026)(03.09.2026 um 15:14 Uhr)
🔧 AI Nachrichten GitHub Release: openai/codex vrust-v0.155.0-alpha.3.1 (11.09.2026)(11.09.2026 um 05:17 Uhr)
🔧 AI Nachrichten GitHub Release: openai/codex vrust-v0.155.0-alpha.3.2 (11.09.2026)(11.09.2026 um 06:11 Uhr)
🔧 AI Nachrichten GitHub Release: openai/codex vrust-v0.155.0-alpha.3.3 (11.09.2026)(11.09.2026 um 06:23 Uhr)
🔧 AI Nachrichten GitHub Release: openai/codex vrust-v0.155.0-alpha.3.4 (11.09.2026)(11.09.2026 um 06:44 Uhr)
🔧 AI Nachrichten GitHub Release: openai/codex vrust-v0.155.0-alpha.3.5 (11.09.2026)(11.09.2026 um 07:07 Uhr)
🔧 AI Nachrichten GitHub Release: openai/codex vrust-v0.155.0-alpha.3.6 (11.09.2026)(11.09.2026 um 08:08 Uhr)
🔧 AI Nachrichten GitHub Release: openai/codex vrust-v0.155.0-alpha.3.7 (11.09.2026)(11.09.2026 um 10:17 Uhr)

🔧 Programmierung 🕛 vor 3 Monaten 2 Min Lesezeit
0

Building a Saju (Korean Astrology) Calculator from Scratch in Python

↗ Quelle (dev.to)
🗣️ Stimme:
📑 Inhaltsübersicht

I built a free Korean astrology (Saju) calculator and wanted to share what makes the math interesting.






What's Saju?



Saju is the Korean tradition of Chinese 4-pillar astrology (BaZi). Your birth year, month, day, and hour each get encoded as a Heavenly Stem + Earthly Branch pair, giving you 8 characters that describe your "energetic signature."






The interesting parts






1. Solar terms via Meeus algorithm



The year boundary isn't January 1 — it's the solar term Ipchun (立春, ~Feb 4), the moment the sun reaches 315° ecliptic longitude. To compute this precisely, I implemented the Meeus astronomical algorithm:




CODE
def apparent_solar_longitude(jd):
t = (jd - 2451545.0) / 36525.0
l0 = (280.46646 + 36000.76983 * t + 0.0003032 * t * t) % 360
m = math.radians((357.52911 + 35999.05029 * t - 0.0001537 * t * t) % 360)
c = ((1.914602 - 0.004817 * t - 0.000014 * t * t) * math.sin(m)
+ (0.019993 - 0.000101 * t) * math.sin(2 * m)
+ 0.000289 * math.sin(3 * m))
return (l0 + c) % 360






Then Newton-style iteration to find the exact JD when longitude crosses 315°.






2. Late-Zi hour rule



The day pillar transitions at 23:00 local time, not midnight. If you're born between 23:00 and 24:00, your day pillar rolls forward to the next day. Common bug in online calculators.






3. Sixty-pillar cycle (六十甲子)



Ten Heavenly Stems × Twelve Earthly Branches, but they pair only on matching parity (Yang-Yang or Yin-Yin), so you get LCM(10, 12) / 2 = 30 paired combos × 2 polarities = 60 pillars.




CODE
def get_pillar_index(stem, branch):
for i in range(60):
if i % 10 == stem and i % 12 == branch:
return i









Try it



Free Saju reader →



No signup, no email. Pure Python on Flask, hosted on PythonAnywhere free tier.



Open to feedback on the math or interpretation logic.

Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
2 Quellen
OpenAI pauses $200 Pro tier as Astra demand strains capacity
1 Quelle
Swiss government explores replacing Microsoft 365 with open-source software
1 Quelle
OpenAI seeks tougher AI rules. CIOs may feel the ripple effects
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Building a Saju (Korean Astrology) Calculator from Scratch in Python

Thematisch verwandte Begriffe: Building, Saju, Korean, Astrology · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...