Fixed gswe_moment_calculate_planet() so it now understands Asc, MC and Vertex

This commit is contained in:
Gergely Polonkai 2013-10-01 01:48:43 +02:00
parent 2ec9bacf91
commit 981c91d702

View File

@ -675,15 +675,26 @@ gswe_moment_calculate_planet(GsweMoment *moment, GswePlanet planet, GError **err
return;
}
// TODO: This function should know about Ascendant, MC and Vertex, so it could calculate their positions, too
swe_set_topo(moment->priv->coordinates.longitude, moment->priv->coordinates.latitude, moment->priv->coordinates.altitude);
jd = gswe_timestamp_get_julian_day(moment->priv->timestamp, err);
if (planet_data->planet_info->real_body == FALSE) {
if (
(planet_data->planet_info->planet != GSWE_PLANET_ASCENDENT)
&& (planet_data->planet_info->planet != GSWE_PLANET_MC)
&& (planet_data->planet_info->planet != GSWE_PLANET_VERTEX)
) {
g_warning("The position data of planet %d can not be calculated by this function", planet);
return;
}
} else {
// gswe_moment_calculate_house_positions() calculates house cusp
// positions, together with Ascendant, MC and Vertex points
gswe_moment_calculate_house_positions(moment, err);
swe_set_topo(moment->priv->coordinates.longitude, moment->priv->coordinates.latitude, moment->priv->coordinates.altitude);
jd = gswe_timestamp_get_julian_day(moment->priv->timestamp, err);
return;
}
}
if ((err) && (*err)) {
return;