Files
astrololo/services/logic/app/engine/points.py
T
gitea a8c3072e62 Węzły księżycowe, mean Lilith i wykrywanie stacji (LOG-02/03)
Punkty wirtualne (LOG-02):
- engine/points.py: mean Node (Ω) i mean Lilith (apogeum) wzorami Meeusa;
  prędkości numerycznie. SN = NN + 180° (ta sama prędkość), zawsze Rx.
- DEFAULT_OBJECTS + North Node / South Node / Lilith — automatycznie dostają
  domy, aspekty i A/S. Parzystość silnika B: swe.MEAN_NODE / swe.MEAN_APOG
  (uwaga: stała pyswisseph to MEAN_APOG, nie MEAN_APOGEE).
- significators: tokeny [NN / [SN / [Lilith (zgodne z SIGNIFICATORS KEY).

Stacje (LOG-03):
- engine/stations.py: skan prędkości (krok 4 dni, okno ±800 dni — pokrywa
  najdłuższe przerwy Marsa/Wenus) + bisekcja; klasyfikacja SD/SR; poprzednia/
  następna stacja (dni, data, stopień w znaku) + flaga station_soon (<7 dni).
- /chart/positions: opt-in stations:true; UI: checkbox + tabela stacji.

Walidacja:
- mean NN vs astro-seek (Gem 8°09'24"): Δ=0,3'; vs swisseph: Δ=17";
  mean Lilith vs swisseph: Δ=1,5'. NN dom 12 / SN dom 6 zgodnie z astro-seek.
- Stacje Marsa 1984 trafiają w historię: SR 5.04.1984, SD 19.06.1984;
  samospójność |speed|<0,01°/d w znalezionych momentach; flaga "blisko"
  działa (Merkury +5,3d, Jowisz -0,6d).
- E2E na realnej bazie: [SN 134 rekordy, trafienie w 6. domu. 54 testy przechodzą.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 10:51:29 +02:00

44 lines
1.6 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""Punkty wirtualne liczone analitycznie (LOG-02): mean Node i mean Lilith.
Wzory Meeusa (Astronomical Algorithms) w stuleciach juliańskich od J2000 (TT):
- Ω — średni węzeł wstępujący orbity Księżyca (mean ascending node). Porusza się
zawsze wstecz (~0,053°/dobę) — stąd węzły są wiecznie Rx.
- średnie perygeum orbity Księżyca; mean Lilith (Black Moon) = średnie APOGEUM
= perygeum + 180° (~+0,111°/dobę).
Wersje TRUE (oskulacyjne) — osobny, późniejszy krok (notatki: mean to
historyczny standard i domyślne ustawienie programów).
"""
from __future__ import annotations
from app.engine.formats import norm360
_DAYS_PER_CENTURY = 36525.0
def _t(tt_jd: float) -> float:
return (tt_jd - 2451545.0) / _DAYS_PER_CENTURY
def mean_lunar_node(tt_jd: float) -> float:
"""Długość ekliptyczna średniego Węzła Północnego (Ω) [°]."""
t = _t(tt_jd)
omega = (125.0445479 - 1934.1362891 * t + 0.0020754 * t * t
+ t ** 3 / 467441.0 - t ** 4 / 60616000.0)
return norm360(omega)
def mean_lilith(tt_jd: float) -> float:
"""Długość ekliptyczna mean Lilith (średnie apogeum Księżyca) [°]."""
t = _t(tt_jd)
perigee = (83.3532465 + 4069.0137287 * t - 0.0103200 * t * t
- t ** 3 / 80053.0 + t ** 4 / 18999000.0)
return norm360(perigee + 180.0)
def point_speed(fn, tt_jd: float, dt_days: float = 0.1) -> float:
"""Prędkość [°/dobę] punktu analitycznego — różnica po małym kroku."""
a = fn(tt_jd)
b = fn(tt_jd + dt_days)
return (((b - a + 180.0) % 360.0) - 180.0) / dt_days