From 4e53c0c77180a83de87864bcb753d97e395f82af Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Thu, 29 Sep 2016 08:36:38 +0200 Subject: [PATCH] Add opposing points: DESC, MC, ANTIVERTEX Solves #4 --- src/gswe-moment.c | 25 +++++++++++++++++++++++++ src/gswe-types.h | 6 ++++++ src/swe-glib.c | 27 +++++++++++++++++++++++++++ 3 files changed, 58 insertions(+) diff --git a/src/gswe-moment.c b/src/gswe-moment.c index 708d19e..2e5806f 100644 --- a/src/gswe-moment.c +++ b/src/gswe-moment.c @@ -805,14 +805,39 @@ gswe_moment_calculate_house_positions(GsweMoment *moment, GError **err) err ); } + if (gswe_moment_has_planet(moment, GSWE_PLANET_DESCENDANT)) { + calculate_data_by_position( + moment, + GSWE_PLANET_DESCENDANT, + fmod(ascmc[0] + 180.0, 180.0), + err + ); + } if (gswe_moment_has_planet(moment, GSWE_PLANET_MC)) { calculate_data_by_position(moment, GSWE_PLANET_MC, ascmc[1], err); } + if (gswe_moment_has_planet(moment, GSWE_PLANET_IC)) { + calculate_data_by_position( + moment, + GSWE_PLANET_IC, + fmod(ascmc[2] + 180.0, 180.0), + err + ); + } if (gswe_moment_has_planet(moment, GSWE_PLANET_VERTEX)) { calculate_data_by_position(moment, GSWE_PLANET_VERTEX, ascmc[3], err); } + + if (gswe_moment_has_planet(moment, GSWE_PLANET_ANTIVERTEX)) { + calculate_data_by_position( + moment, + GSWE_PLANET_ANTIVERTEX, + fmod(ascmc[3] + 180.0, 180.0), + err + ); + } } /** diff --git a/src/gswe-types.h b/src/gswe-types.h index 04cb626..9c256ee 100644 --- a/src/gswe-types.h +++ b/src/gswe-types.h @@ -35,9 +35,12 @@ * GswePlanet: * @GSWE_PLANET_NONE: no planet * @GSWE_PLANET_ASCENDANT: the ascendant + * @GSWE_PLANET_DESCENDANT: the descendant * @GSWE_PLANET_MC: midheaven (Medium Coeli) + * @GSWE_PLANET_IC: Immum Coeli * @GSWE_PLANET_VERTEX: the Vertex (the point where the ecliptic meats the * primal vertical) + * @GSWE_PLANET_ANTIVERTEX: the Antivertex (the point opposing the Vertex) * @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, @@ -80,6 +83,9 @@ typedef enum { GSWE_PLANET_MOON_NODE, GSWE_PLANET_MOON_APOGEE, GSWE_PLANET_MOON_SOUTH_NODE, + GSWE_PLANET_DESCENDANT, + GSWE_PLANET_IC, + GSWE_PLANET_ANTIVERTEX, /* Actual astrological planets */ GSWE_PLANET_SUN = 11, diff --git a/src/swe-glib.c b/src/swe-glib.c index 7fe107f..d3ead20 100644 --- a/src/swe-glib.c +++ b/src/swe-glib.c @@ -178,6 +178,14 @@ void gswe_init_with_dir(gchar *directory) 9.0, 2 ); + ADD_PLANET(gswe_planet_info_table, planet_info, + GSWE_PLANET_DESCENDANT, + -1, + FALSE, + _("Descendant"), + 0.0, + 0 + ); ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_MC, -1, @@ -186,6 +194,14 @@ void gswe_init_with_dir(gchar *directory) 5.0, 1 ); + ADD_PLANET(gswe_planet_info_table, planet_info, + GSWE_PLANET_IC, + -1, + FALSE, + _("Immum Coeli"), + 0.0, + 0 + ); ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_VERTEX, -1, @@ -194,6 +210,14 @@ void gswe_init_with_dir(gchar *directory) 2.0, 0 ); + ADD_PLANET(gswe_planet_info_table, planet_info, + GSWE_PLANET_ANTIVERTEX, + -1, + FALSE, + _("Anti-vertex"), + 0.0, + 0 + ); ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_MOON_NODE, SE_MEAN_NODE, @@ -204,6 +228,9 @@ void gswe_init_with_dir(gchar *directory) ); ADD_PLANET(gswe_planet_info_table, planet_info, GSWE_PLANET_MOON_SOUTH_NODE, + // As this is just the opposing point of the mean node, + // we actually calculate that, and simply add 180 + // degrees when queried. SE_MEAN_NODE, TRUE, _("Descending Moon Node"),