From dc94217a70955237afc667365eabf168773edec6 Mon Sep 17 00:00:00 2001 From: "Gergely POLONKAI (W00d5t0ck)" Date: Tue, 3 Sep 2013 11:26:09 +0200 Subject: [PATCH] Added planetary distance to GsweAspectData structure --- swe-glib/src/gswe-moment.c | 11 +++++------ swe-glib/src/gswe-moment.h | 1 + 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/swe-glib/src/gswe-moment.c b/swe-glib/src/gswe-moment.c index fa18d91..feae7a4 100644 --- a/swe-glib/src/gswe-moment.c +++ b/swe-glib/src/gswe-moment.c @@ -610,18 +610,17 @@ static gboolean find_aspect(gpointer aspect_p, GsweAspectInfo *aspect_info, GsweAspectData *aspect_data) { GsweAspect aspect = GPOINTER_TO_INT(aspect_p); - gdouble distance, - diff, + gdouble diff, planet_orb, aspect_orb; - distance = fabs(aspect_data->planet1->position - aspect_data->planet2->position); + aspect_data->distance = fabs(aspect_data->planet1->position - aspect_data->planet2->position); - if (distance > 180.0) { - distance = 360.0 - distance; + if (aspect_data->distance > 180.0) { + aspect_data->distance = 360.0 - aspect_data->distance; } - diff = fabs(aspect_info->size - distance); + diff = fabs(aspect_info->size - aspect_data->distance); planet_orb = fmin(aspect_data->planet1->planet_info->orb, aspect_data->planet2->planet_info->orb); aspect_orb = fmax(1.0, planet_orb - aspect_info->orb_modifier); diff --git a/swe-glib/src/gswe-moment.h b/swe-glib/src/gswe-moment.h index 1ff449c..0ff732d 100644 --- a/swe-glib/src/gswe-moment.h +++ b/swe-glib/src/gswe-moment.h @@ -75,6 +75,7 @@ typedef struct { GswePlanetData *planet1; GswePlanetData *planet2; GsweAspect aspect; + gdouble distance; gdouble difference; GsweAspectInfo *aspect_info; } GsweAspectData;