From c0711d512dc510d7ed0c0a637fe335d98eed27fd Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Tue, 20 Sep 2016 15:23:47 +0200 Subject: [PATCH] Add possibility to calculate Moon South Node position --- src/gswe-moment.c | 6 ++++++ src/gswe-types.h | 2 ++ src/swe-glib.c | 7 +++++++ 3 files changed, 15 insertions(+) diff --git a/src/gswe-moment.c b/src/gswe-moment.c index f151054..708d19e 100644 --- a/src/gswe-moment.c +++ b/src/gswe-moment.c @@ -1012,6 +1012,12 @@ gswe_moment_calculate_planet(GsweMoment *moment, ); } + // The south node is actually on the opposite side of the chart, + // so letâ€™s invert the position. + if (planet == GSWE_PLANET_MOON_SOUTH_NODE) { + x2[0] = fmod(x2[0] + 180.0, 180.0); + } + calculate_data_by_position(moment, planet, x2[0], &calc_err); if (calc_err != NULL) { diff --git a/src/gswe-types.h b/src/gswe-types.h index c4936c0..04cb626 100644 --- a/src/gswe-types.h +++ b/src/gswe-types.h @@ -39,6 +39,7 @@ * @GSWE_PLANET_VERTEX: the Vertex (the point where the ecliptic meats the * primal vertical) * @GSWE_PLANET_MOON_NODE: the mean ascending (north) Moon node + * @GSWE_PLANET_MOON_SOUTH_NODE: the mean descending (south) Moon node * @GSWE_PLANET_MOON_APOGEE: the mean Moon apogee (sometimes called Dark Moon, * or Lilith) * @GSWE_PLANET_SUN: the Sun @@ -78,6 +79,7 @@ typedef enum { GSWE_PLANET_VERTEX, GSWE_PLANET_MOON_NODE, GSWE_PLANET_MOON_APOGEE, + GSWE_PLANET_MOON_SOUTH_NODE, /* Actual astrological planets */ GSWE_PLANET_SUN = 11, diff --git a/src/swe-glib.c b/src/swe-glib.c index bf22dfb..7fe107f 100644 --- a/src/swe-glib.c +++ b/src/swe-glib.c @@ -202,6 +202,13 @@ void gswe_init_with_dir(gchar *directory) 2.0, 1 ); + ADD_PLANET(gswe_planet_info_table, planet_info, + GSWE_PLANET_MOON_SOUTH_NODE, + SE_MEAN_NODE, + TRUE, + _("Descending Moon Node"), + 2.0, + 0); ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_MOON_APOGEE, SE_MEAN_APOG,