Added planetary distance to GsweAspectData structure

This commit is contained in:
Gergely Polonkai 2013-09-03 11:26:09 +02:00
parent c25d078b7d
commit dc94217a70
2 changed files with 6 additions and 6 deletions

View File

@ -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);

View File

@ -75,6 +75,7 @@ typedef struct {
GswePlanetData *planet1;
GswePlanetData *planet2;
GsweAspect aspect;
gdouble distance;
gdouble difference;
GsweAspectInfo *aspect_info;
} GsweAspectData;