2013-07-27 21:26:12 +00:00
|
|
|
#include <glib.h>
|
2013-07-14 12:40:26 +00:00
|
|
|
|
2013-07-27 21:22:35 +00:00
|
|
|
#include "calculate.h"
|
|
|
|
|
2013-07-14 12:40:26 +00:00
|
|
|
#include "../swe/src/swephexp.h"
|
|
|
|
|
2013-08-21 23:42:41 +00:00
|
|
|
#define EPHEDIR "/home/polesz/Projektek/c/astrognome/swe/data"
|
2013-07-14 12:40:26 +00:00
|
|
|
|
2013-08-19 21:36:54 +00:00
|
|
|
typedef struct {
|
|
|
|
int signId;
|
|
|
|
signElement_t element;
|
|
|
|
signType_t type;
|
|
|
|
} signData_t;
|
|
|
|
|
2013-08-21 15:04:43 +00:00
|
|
|
typedef struct {
|
|
|
|
int planetId;
|
|
|
|
gchar *name;
|
2013-08-21 21:39:38 +00:00
|
|
|
gdouble orb;
|
|
|
|
zodiacSign domicile1,
|
|
|
|
domicile2,
|
|
|
|
exile1,
|
|
|
|
exile2,
|
|
|
|
exalted,
|
|
|
|
fall;
|
2013-08-21 15:04:43 +00:00
|
|
|
} planetData_t;
|
|
|
|
|
2013-07-26 14:53:08 +00:00
|
|
|
const char *signTypeName[] = {
|
|
|
|
NULL,
|
|
|
|
"Cardinal",
|
|
|
|
"Fix",
|
|
|
|
"Mutable"
|
|
|
|
};
|
|
|
|
|
|
|
|
const char *signElementName[] = {
|
|
|
|
NULL,
|
|
|
|
"Fire",
|
|
|
|
"Earth",
|
|
|
|
"Air",
|
|
|
|
"Water"
|
|
|
|
};
|
|
|
|
|
|
|
|
const char *moonStateName[] = {
|
|
|
|
"New Moon",
|
|
|
|
"Waxing Crescent Moon",
|
|
|
|
"Waxing Half Moon",
|
|
|
|
"Waxing Gibbous Moon",
|
|
|
|
"Full Moon",
|
|
|
|
"Waning Gibbous Moon",
|
|
|
|
"Waning Half Moon",
|
|
|
|
"Waning Crescent Moon",
|
|
|
|
"Dark Moon"
|
|
|
|
};
|
|
|
|
|
|
|
|
const char *signName[] = {
|
|
|
|
NULL,
|
|
|
|
"Aries",
|
|
|
|
"Taurus",
|
|
|
|
"Gemini",
|
|
|
|
"Cancer",
|
|
|
|
"Leo",
|
|
|
|
"Virgo",
|
|
|
|
"Libra",
|
|
|
|
"Scorpio",
|
2013-08-21 22:35:38 +00:00
|
|
|
"Sagittarius",
|
2013-07-26 14:53:08 +00:00
|
|
|
"Capricorn",
|
|
|
|
"Aquarius",
|
|
|
|
"Pisces"
|
|
|
|
};
|
|
|
|
|
2013-08-19 22:37:39 +00:00
|
|
|
typedef struct {
|
2013-08-21 21:35:23 +00:00
|
|
|
gchar *name;
|
|
|
|
guint size;
|
2013-08-21 21:36:09 +00:00
|
|
|
guint orbModifier;
|
2013-08-21 21:35:23 +00:00
|
|
|
gboolean harmonic;
|
|
|
|
gboolean major;
|
2013-08-19 22:37:39 +00:00
|
|
|
} aspectData_t;
|
|
|
|
|
|
|
|
const aspectData_t aspectData[] = {
|
2013-08-21 21:36:09 +00:00
|
|
|
// Name Size Orb Harmonic Major
|
|
|
|
{ "Conjuction", 0, 0, TRUE, TRUE },
|
|
|
|
{ "Opposition", 180, 0, TRUE, TRUE },
|
|
|
|
{ "Trine", 120, 0, TRUE, TRUE },
|
|
|
|
{ "Square", 90, 0, FALSE, TRUE },
|
|
|
|
{ "Sextile", 60, 1, TRUE, TRUE },
|
|
|
|
{ "Quincunx", 150, 2, FALSE, FALSE },
|
|
|
|
{ "Semi-sextile", 30, 2, TRUE, FALSE },
|
|
|
|
{ "Semi-square", 45, 2, FALSE, FALSE },
|
|
|
|
{ "Sesqui-square", 135, 2, FALSE, FALSE },
|
|
|
|
{ "Quintile", 72, 3, TRUE, FALSE },
|
|
|
|
{ "Bi-quintile", 144, 3, TRUE, FALSE }
|
2013-08-19 22:37:39 +00:00
|
|
|
};
|
|
|
|
|
2013-08-21 15:03:37 +00:00
|
|
|
#define ADD_SIGN(ht, v, s, e, t) (v) = g_new0(signData_t, 1); \
|
2013-08-19 21:36:54 +00:00
|
|
|
(v)->signId = (s); \
|
|
|
|
(v)->element = (e); \
|
|
|
|
(v)->type = (t); \
|
|
|
|
g_hash_table_replace((ht), GINT_TO_POINTER(s), (v));
|
|
|
|
|
2013-08-21 21:39:38 +00:00
|
|
|
#define ADD_PLANET(ht, v, i, n, o, dom1, dom2, exi1, exi2, exa, fal) (v) = g_new0(planetData_t, 1); \
|
|
|
|
(v)->planetId = (i); \
|
|
|
|
(v)->name = g_strdup(n); \
|
|
|
|
(v)->orb = (o); \
|
|
|
|
(v)->domicile1 = (dom1); \
|
|
|
|
(v)->domicile2 = (dom2); \
|
|
|
|
(v)->exile1 = (exi1); \
|
|
|
|
(v)->exile2 = (exi2); \
|
|
|
|
(v)->exalted = (exa); \
|
|
|
|
(v)->fall = (fal); \
|
|
|
|
g_hash_table_replace((ht), GINT_TO_POINTER(i), (v));
|
2013-08-21 15:04:43 +00:00
|
|
|
|
2013-08-19 21:36:54 +00:00
|
|
|
#define INCREASE_POINTS(dts, dte, dtt, vsd, s, p, val) (vsd) = g_hash_table_lookup((dts), GINT_TO_POINTER(s)); \
|
|
|
|
g_assert((vsd) != NULL); \
|
|
|
|
\
|
|
|
|
if (((p) = g_hash_table_lookup((dte), GINT_TO_POINTER((vsd)->element))) == NULL) { \
|
|
|
|
(p) = g_new0(guint, 1); \
|
|
|
|
} \
|
|
|
|
\
|
|
|
|
*(p) += (val); \
|
|
|
|
g_hash_table_replace((dte), GINT_TO_POINTER((vsd)->element), (p)); \
|
|
|
|
\
|
|
|
|
if (((p) = g_hash_table_lookup((dtt), GINT_TO_POINTER((vsd)->type))) == NULL) { \
|
|
|
|
(p) = g_new0(guint, 1); \
|
|
|
|
} \
|
|
|
|
\
|
|
|
|
*(p) += (val); \
|
|
|
|
g_hash_table_replace((dtt), GINT_TO_POINTER((vsd)->type), (p));
|
|
|
|
|
2013-08-21 15:07:57 +00:00
|
|
|
struct aspect_check_data {
|
|
|
|
GList *planetIdList;
|
|
|
|
guint currentOuterPlanetId;
|
|
|
|
guint currentInnerPlanetId;
|
|
|
|
GHashTable *planetInfoTable;
|
|
|
|
GHashTable *planetDataTable;
|
|
|
|
};
|
|
|
|
|
|
|
|
void
|
|
|
|
check_aspects_inner_loop(gpointer data, gpointer user_data)
|
|
|
|
{
|
|
|
|
struct aspect_check_data *checkData = user_data;
|
2013-08-21 21:41:08 +00:00
|
|
|
gint outerPlanetId = GPOINTER_TO_INT(g_list_nth_data(checkData->planetIdList, checkData->currentOuterPlanetId));
|
|
|
|
gint innerPlanetId = GPOINTER_TO_INT(g_list_nth_data(checkData->planetIdList, checkData->currentInnerPlanetId));
|
2013-08-21 15:07:57 +00:00
|
|
|
planetInfo_t *outerPlanet,
|
|
|
|
*innerPlanet;
|
|
|
|
planetData_t *outerPlanetData,
|
|
|
|
*innerPlanetData;
|
2013-08-21 21:42:45 +00:00
|
|
|
gdouble planetOrb,
|
|
|
|
distance,
|
|
|
|
difference;
|
|
|
|
gint i;
|
|
|
|
const aspectData_t *aspect = NULL;
|
2013-08-21 15:07:57 +00:00
|
|
|
|
|
|
|
if (outerPlanetId == innerPlanetId) {
|
|
|
|
checkData->currentInnerPlanetId++;
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
outerPlanet = g_hash_table_lookup(checkData->planetInfoTable, GINT_TO_POINTER(outerPlanetId));
|
|
|
|
innerPlanet = g_hash_table_lookup(checkData->planetInfoTable, GINT_TO_POINTER(innerPlanetId));
|
|
|
|
|
|
|
|
g_assert(outerPlanet != NULL);
|
|
|
|
g_assert(innerPlanet != NULL);
|
|
|
|
|
|
|
|
outerPlanetData = g_hash_table_lookup(checkData->planetDataTable, GINT_TO_POINTER(outerPlanetId));
|
|
|
|
innerPlanetData = g_hash_table_lookup(checkData->planetDataTable, GINT_TO_POINTER(innerPlanetId));
|
|
|
|
|
|
|
|
g_assert(outerPlanetData != NULL);
|
|
|
|
g_assert(innerPlanetData != NULL);
|
|
|
|
|
2013-08-21 21:42:45 +00:00
|
|
|
distance = fabs(outerPlanet->position - innerPlanet->position);
|
|
|
|
planetOrb = fmin(outerPlanetData->orb, innerPlanetData->orb);
|
2013-08-21 15:07:57 +00:00
|
|
|
|
|
|
|
if (distance > 180.0) {
|
|
|
|
distance = 360.0 - distance;
|
|
|
|
}
|
|
|
|
|
2013-08-21 21:42:45 +00:00
|
|
|
for (i = 0; i < sizeof(aspectData) / sizeof(aspectData_t); i++) {
|
|
|
|
gdouble diff = fabs(aspectData[i].size - distance);
|
|
|
|
gdouble aspectOrb = fmax(1.0, planetOrb - aspectData[i].orbModifier);
|
|
|
|
|
|
|
|
if (diff <= aspectOrb) {
|
|
|
|
printf("%f ", diff);
|
|
|
|
aspect = &(aspectData[i]);
|
|
|
|
if (aspectData[i].size == 0) {
|
|
|
|
difference = (1 - ((360.0 - diff) / 360.0)) * 100.0;
|
|
|
|
} else {
|
|
|
|
difference = (1 - ((aspectData[i].size - diff) / aspectData[i].size)) * 100.0;
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (aspect != NULL) {
|
|
|
|
printf("%s vs. %s: %s (±%f%%)\n", outerPlanetData->name, innerPlanetData->name, aspect->name, difference);
|
|
|
|
}
|
2013-08-21 15:07:57 +00:00
|
|
|
|
|
|
|
checkData->currentInnerPlanetId++;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
check_aspects_outer_loop(gpointer data, gpointer user_data)
|
|
|
|
{
|
|
|
|
struct aspect_check_data *checkData = user_data;
|
|
|
|
|
|
|
|
checkData->currentInnerPlanetId = checkData->currentOuterPlanetId;
|
2013-08-21 21:42:45 +00:00
|
|
|
printf("\n");
|
2013-08-21 15:07:57 +00:00
|
|
|
|
|
|
|
g_list_foreach(g_list_nth(checkData->planetIdList, checkData->currentOuterPlanetId), check_aspects_inner_loop, user_data);
|
|
|
|
|
|
|
|
checkData->currentOuterPlanetId++;
|
|
|
|
}
|
|
|
|
|
2013-08-21 15:04:43 +00:00
|
|
|
void
|
|
|
|
free_planet_data(gpointer data)
|
|
|
|
{
|
|
|
|
planetData_t *planetData = data;
|
|
|
|
|
|
|
|
g_free(planetData->name);
|
|
|
|
g_free(planetData);
|
|
|
|
}
|
|
|
|
|
2013-07-26 14:59:09 +00:00
|
|
|
int
|
2013-07-14 16:13:41 +00:00
|
|
|
main(int argc, char *argv[])
|
2013-07-14 12:40:26 +00:00
|
|
|
{
|
2013-07-26 15:01:09 +00:00
|
|
|
int year = 1981,
|
|
|
|
month = 3,
|
|
|
|
day = 11,
|
|
|
|
hour = 23,
|
|
|
|
min = 39,
|
2013-08-21 15:05:23 +00:00
|
|
|
sec = 34,
|
2013-07-26 15:01:09 +00:00
|
|
|
p;
|
2013-08-19 21:36:54 +00:00
|
|
|
guint *point;
|
2013-07-26 15:01:09 +00:00
|
|
|
double timezone = 1.0,
|
2013-08-21 15:05:23 +00:00
|
|
|
lon = 20.766666,
|
|
|
|
lat = 48.2,
|
2013-07-26 15:01:09 +00:00
|
|
|
alt = 200,
|
|
|
|
te,
|
|
|
|
cusps[13],
|
|
|
|
ascmc[10];
|
2013-07-26 15:08:17 +00:00
|
|
|
planetInfo_t *planetInfo;
|
|
|
|
moonPhase *phase;
|
2013-08-19 21:36:54 +00:00
|
|
|
GHashTable *signDataTable,
|
2013-08-21 15:06:11 +00:00
|
|
|
*planetDataTable,
|
2013-08-19 21:36:54 +00:00
|
|
|
*elementPointsTable,
|
2013-08-19 22:35:47 +00:00
|
|
|
*typePointsTable,
|
|
|
|
*planetInfoTable;
|
2013-08-21 15:06:11 +00:00
|
|
|
planetData_t *planetData;
|
2013-08-19 21:36:54 +00:00
|
|
|
signData_t *signData;
|
2013-08-19 22:37:39 +00:00
|
|
|
GList *planetIdList;
|
2013-08-21 15:07:57 +00:00
|
|
|
struct aspect_check_data aspectCheckData;
|
2013-07-14 12:40:26 +00:00
|
|
|
|
2013-07-26 14:47:44 +00:00
|
|
|
#if 1
|
|
|
|
year = 1983;
|
|
|
|
month = 3;
|
|
|
|
day = 7;
|
|
|
|
hour = 11;
|
|
|
|
min = 54;
|
2013-08-21 15:05:23 +00:00
|
|
|
sec = 47;
|
|
|
|
lon = 19.081599;
|
|
|
|
lat = 47.462485;
|
2013-07-26 14:47:44 +00:00
|
|
|
#endif
|
|
|
|
|
2013-08-19 21:36:54 +00:00
|
|
|
signDataTable = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, g_free);
|
2013-08-21 15:04:43 +00:00
|
|
|
planetDataTable = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, free_planet_data);
|
2013-08-19 21:36:54 +00:00
|
|
|
elementPointsTable = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, NULL);
|
|
|
|
typePointsTable = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, NULL);
|
2013-08-19 22:35:47 +00:00
|
|
|
planetInfoTable = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, g_free);
|
2013-08-19 21:36:54 +00:00
|
|
|
|
2013-08-21 15:04:43 +00:00
|
|
|
// Initialize planet data table
|
|
|
|
|
2013-08-21 21:39:38 +00:00
|
|
|
ADD_PLANET(planetDataTable, planetData, SE_SUN, "Sun", 13.0, SIGN_LEO, SIGN_NONE, SIGN_AQUARIUS, SIGN_NONE, SIGN_ARIES, SIGN_LIBRA);
|
|
|
|
ADD_PLANET(planetDataTable, planetData, SE_MOON, "Moon", 9.0, SIGN_CANCER, SIGN_NONE, SIGN_CAPRICORN, SIGN_NONE, SIGN_TAURUS, SIGN_SCORPIO);
|
2013-08-21 22:35:38 +00:00
|
|
|
ADD_PLANET(planetDataTable, planetData, SE_MERCURY, "Mercury", 7.0, SIGN_GEMINI, SIGN_VIRGO, SIGN_SAGITTARIUS, SIGN_PISCES, SIGN_VIRGO, SIGN_PISCES);
|
2013-08-21 21:39:38 +00:00
|
|
|
ADD_PLANET(planetDataTable, planetData, SE_VENUS, "Venus", 7.0, SIGN_TAURUS, SIGN_LIBRA, SIGN_SCORPIO, SIGN_ARIES, SIGN_PISCES, SIGN_VIRGO);
|
|
|
|
ADD_PLANET(planetDataTable, planetData, SE_MARS, "Mars", 7.0, SIGN_ARIES, SIGN_SCORPIO, SIGN_LIBRA, SIGN_TAURUS, SIGN_CAPRICORN, SIGN_CANCER);
|
2013-08-21 22:35:38 +00:00
|
|
|
ADD_PLANET(planetDataTable, planetData, SE_JUPITER, "Jupiter", 9.0, SIGN_SAGITTARIUS, SIGN_PISCES, SIGN_GEMINI, SIGN_VIRGO, SIGN_CANCER, SIGN_CAPRICORN);
|
2013-08-21 21:39:38 +00:00
|
|
|
ADD_PLANET(planetDataTable, planetData, SE_SATURN, "Saturn", 7.0, SIGN_CAPRICORN, SIGN_AQUARIUS, SIGN_CANCER, SIGN_LEO, SIGN_LIBRA, SIGN_ARIES);
|
|
|
|
ADD_PLANET(planetDataTable, planetData, SE_URANUS, "Uranus", 5.0, SIGN_AQUARIUS, SIGN_NONE, SIGN_NONE, SIGN_NONE, SIGN_NONE, SIGN_NONE);
|
|
|
|
ADD_PLANET(planetDataTable, planetData, SE_NEPTUNE, "Neptune", 5.0, SIGN_PISCES, SIGN_NONE, SIGN_NONE, SIGN_NONE, SIGN_NONE, SIGN_NONE);
|
|
|
|
ADD_PLANET(planetDataTable, planetData, SE_PLUTO, "Pluto", 3.0, SIGN_SCORPIO, SIGN_NONE, SIGN_NONE, SIGN_NONE, SIGN_NONE, SIGN_NONE);
|
|
|
|
ADD_PLANET(planetDataTable, planetData, SE_CHIRON, "Chiron", 2.0, SIGN_NONE, SIGN_NONE, SIGN_NONE, SIGN_NONE, SIGN_NONE, SIGN_NONE);
|
|
|
|
ADD_PLANET(planetDataTable, planetData, SE_MEAN_NODE, "Ascending Moon Node", 2.0, SIGN_NONE, SIGN_NONE, SIGN_NONE, SIGN_NONE, SIGN_NONE, SIGN_NONE);
|
|
|
|
ADD_PLANET(planetDataTable, planetData, SE_MEAN_APOG, "Dark Moon", 2.0, SIGN_NONE, SIGN_NONE, SIGN_NONE, SIGN_NONE, SIGN_NONE, SIGN_NONE);
|
|
|
|
ADD_PLANET(planetDataTable, planetData, SE_CERES, "Ceres", 2.0, SIGN_NONE, SIGN_NONE, SIGN_NONE, SIGN_NONE, SIGN_NONE, SIGN_NONE);
|
|
|
|
ADD_PLANET(planetDataTable, planetData, SE_PALLAS, "Pallas", 2.0, SIGN_NONE, SIGN_NONE, SIGN_NONE, SIGN_NONE, SIGN_NONE, SIGN_NONE);
|
|
|
|
ADD_PLANET(planetDataTable, planetData, SE_JUNO, "Juno", 2.0, SIGN_NONE, SIGN_NONE, SIGN_NONE, SIGN_NONE, SIGN_NONE, SIGN_NONE);
|
|
|
|
ADD_PLANET(planetDataTable, planetData, SE_VESTA, "Vesta", 2.0, SIGN_NONE, SIGN_NONE, SIGN_NONE, SIGN_NONE, SIGN_NONE, SIGN_NONE);
|
|
|
|
ADD_PLANET(planetDataTable, planetData, SE_NPLANETS + SE_ASC, "Ascendent", 9.0, SIGN_NONE, SIGN_NONE, SIGN_NONE, SIGN_NONE, SIGN_NONE, SIGN_NONE);
|
|
|
|
ADD_PLANET(planetDataTable, planetData, SE_NPLANETS + SE_MC, "Midheaven", 5.0, SIGN_NONE, SIGN_NONE, SIGN_NONE, SIGN_NONE, SIGN_NONE, SIGN_NONE);
|
2013-08-21 15:04:43 +00:00
|
|
|
|
2013-08-19 21:36:54 +00:00
|
|
|
// Initialize sign data table
|
|
|
|
|
|
|
|
ADD_SIGN(signDataTable, signData, SIGN_ARIES, ELEMENT_FIRE, TYPE_CARDINAL);
|
|
|
|
ADD_SIGN(signDataTable, signData, SIGN_TAURUS, ELEMENT_EARTH, TYPE_FIX);
|
|
|
|
ADD_SIGN(signDataTable, signData, SIGN_GEMINI, ELEMENT_AIR, TYPE_MUTABLE);
|
|
|
|
ADD_SIGN(signDataTable, signData, SIGN_CANCER, ELEMENT_WATER, TYPE_CARDINAL);
|
|
|
|
ADD_SIGN(signDataTable, signData, SIGN_LEO, ELEMENT_FIRE, TYPE_FIX);
|
|
|
|
ADD_SIGN(signDataTable, signData, SIGN_VIRGO, ELEMENT_EARTH, TYPE_MUTABLE);
|
|
|
|
ADD_SIGN(signDataTable, signData, SIGN_LIBRA, ELEMENT_AIR, TYPE_CARDINAL);
|
|
|
|
ADD_SIGN(signDataTable, signData, SIGN_SCORPIO, ELEMENT_WATER, TYPE_FIX);
|
2013-08-21 22:35:38 +00:00
|
|
|
ADD_SIGN(signDataTable, signData, SIGN_SAGITTARIUS, ELEMENT_FIRE, TYPE_MUTABLE);
|
2013-08-19 21:36:54 +00:00
|
|
|
ADD_SIGN(signDataTable, signData, SIGN_CAPRICORN, ELEMENT_EARTH, TYPE_CARDINAL);
|
|
|
|
ADD_SIGN(signDataTable, signData, SIGN_AQUARIUS, ELEMENT_AIR, TYPE_FIX);
|
|
|
|
ADD_SIGN(signDataTable, signData, SIGN_PISCES, ELEMENT_WATER, TYPE_MUTABLE);
|
|
|
|
|
2013-07-26 15:01:09 +00:00
|
|
|
swe_set_ephe_path(EPHEDIR);
|
2013-07-14 12:40:26 +00:00
|
|
|
|
2013-07-26 15:02:55 +00:00
|
|
|
if (set_location_and_time(lon, lat, alt, year, month, day, hour, min, sec, timezone, &te) == 0) {
|
|
|
|
return 1;
|
|
|
|
}
|
2013-07-14 12:40:26 +00:00
|
|
|
|
2013-08-19 22:36:55 +00:00
|
|
|
printf("Date: %02d.%02d.%d at %02d:%02d:%02d, at %f, %f\n", year, month, day, hour, min, sec, lon, lat);
|
|
|
|
|
|
|
|
printf("\nHOUSES\n======\n\n");
|
2013-07-14 12:40:26 +00:00
|
|
|
|
2013-07-26 15:02:55 +00:00
|
|
|
swe_houses(te, lat, lon, 'P', cusps, ascmc);
|
|
|
|
|
|
|
|
for (p = 1; p < 13; p++) {
|
2013-08-19 22:36:55 +00:00
|
|
|
printf("House %2d..: %s (%f)\n", p, signName[get_sign(cusps[p])], cusps[p]);
|
2013-07-26 15:02:55 +00:00
|
|
|
}
|
2013-07-14 12:40:26 +00:00
|
|
|
|
2013-08-19 22:36:55 +00:00
|
|
|
printf("\nPLANETS AND POINTS\n==================\n\n");
|
2013-07-14 12:40:26 +00:00
|
|
|
|
2013-08-19 22:35:47 +00:00
|
|
|
planetInfo = g_new0(planetInfo_t, 1);
|
|
|
|
planetInfo->position = ascmc[0];
|
|
|
|
planetInfo->sign = get_sign(ascmc[0]);
|
|
|
|
planetInfo->house = 1;
|
|
|
|
planetInfo->retrograde = FALSE;
|
|
|
|
g_hash_table_replace(planetInfoTable, GINT_TO_POINTER(SE_NPLANETS + SE_ASC), planetInfo);
|
|
|
|
printf("Asc.......: %s (%f)\n", signName[planetInfo->sign], planetInfo->position);
|
|
|
|
INCREASE_POINTS(signDataTable, elementPointsTable, typePointsTable, signData, planetInfo->sign, point, 2);
|
|
|
|
|
|
|
|
planetInfo = g_new0(planetInfo_t, 1);
|
|
|
|
planetInfo->position = ascmc[1];
|
|
|
|
planetInfo->sign = get_sign(ascmc[1]);
|
|
|
|
planetInfo->house = 10;
|
|
|
|
planetInfo->retrograde = FALSE;
|
|
|
|
g_hash_table_replace(planetInfoTable, GINT_TO_POINTER(SE_NPLANETS + SE_MC), planetInfo);
|
|
|
|
printf("MC........: %s (%f)\n", signName[planetInfo->sign], planetInfo->position);
|
|
|
|
INCREASE_POINTS(signDataTable, elementPointsTable, typePointsTable, signData, planetInfo->sign, point, 1);
|
2013-07-14 12:40:26 +00:00
|
|
|
|
2013-07-26 15:06:43 +00:00
|
|
|
planetInfo = get_planet_info(SE_SUN, te, cusps);
|
2013-08-19 22:35:47 +00:00
|
|
|
g_hash_table_replace(planetInfoTable, GINT_TO_POINTER(SE_SUN), planetInfo);
|
2013-08-19 21:38:05 +00:00
|
|
|
printf("Sun.......: %s, House: %d (%f%s)\n", signName[planetInfo->sign], planetInfo->house, planetInfo->position, (planetInfo->retrograde) ? ", retrograde" : "");
|
2013-08-19 21:36:54 +00:00
|
|
|
INCREASE_POINTS(signDataTable, elementPointsTable, typePointsTable, signData, planetInfo->sign, point, 2);
|
2013-07-14 12:40:26 +00:00
|
|
|
|
2013-07-26 15:06:43 +00:00
|
|
|
planetInfo = get_planet_info(SE_MOON, te, cusps);
|
2013-08-19 22:35:47 +00:00
|
|
|
g_hash_table_replace(planetInfoTable, GINT_TO_POINTER(SE_MOON), planetInfo);
|
2013-07-26 15:06:43 +00:00
|
|
|
phase = get_moon_phase(year, month, day, hour, min, sec);
|
2013-08-19 21:38:05 +00:00
|
|
|
printf("Moon......: %s (%.2f%% visibility), %s, House: %d (%f%s)\n", moonStateName[phase->phase], phase->visiblePercentage, signName[planetInfo->sign], planetInfo->house, planetInfo->position, (planetInfo->retrograde) ? ", retrograde" : "");
|
2013-08-19 21:36:54 +00:00
|
|
|
INCREASE_POINTS(signDataTable, elementPointsTable, typePointsTable, signData, planetInfo->sign, point, 2);
|
2013-07-26 15:06:43 +00:00
|
|
|
g_free(phase);
|
2013-07-14 16:13:41 +00:00
|
|
|
|
2013-07-26 15:06:43 +00:00
|
|
|
planetInfo = get_planet_info(SE_MERCURY, te, cusps);
|
2013-08-19 22:35:47 +00:00
|
|
|
g_hash_table_replace(planetInfoTable, GINT_TO_POINTER(SE_MERCURY), planetInfo);
|
2013-08-19 21:38:05 +00:00
|
|
|
printf("Mercury...: %s, House: %d (%f%s)\n", signName[planetInfo->sign], planetInfo->house, planetInfo->position, (planetInfo->retrograde) ? ", retrograde" : "");
|
2013-08-19 21:36:54 +00:00
|
|
|
INCREASE_POINTS(signDataTable, elementPointsTable, typePointsTable, signData, planetInfo->sign, point, 2);
|
2013-07-14 16:13:41 +00:00
|
|
|
|
2013-07-26 15:06:43 +00:00
|
|
|
planetInfo = get_planet_info (SE_VENUS, te, cusps);
|
2013-08-19 22:35:47 +00:00
|
|
|
g_hash_table_replace(planetInfoTable, GINT_TO_POINTER(SE_VENUS), planetInfo);
|
2013-08-19 21:38:05 +00:00
|
|
|
printf("Venus.....: %s, House: %d (%f%s)\n", signName[planetInfo->sign], planetInfo->house, planetInfo->position, (planetInfo->retrograde) ? ", retrograde" : "");
|
2013-08-19 21:36:54 +00:00
|
|
|
INCREASE_POINTS(signDataTable, elementPointsTable, typePointsTable, signData, planetInfo->sign, point, 1);
|
2013-07-14 16:13:41 +00:00
|
|
|
|
2013-07-26 15:06:43 +00:00
|
|
|
planetInfo = get_planet_info(SE_MARS, te, cusps);
|
2013-08-19 22:35:47 +00:00
|
|
|
g_hash_table_replace(planetInfoTable, GINT_TO_POINTER(SE_MARS), planetInfo);
|
2013-08-19 21:38:05 +00:00
|
|
|
printf("Mars......: %s, House: %d (%f%s)\n", signName[planetInfo->sign], planetInfo->house, planetInfo->position, (planetInfo->retrograde) ? ", retrograde" : "");
|
2013-08-19 21:36:54 +00:00
|
|
|
INCREASE_POINTS(signDataTable, elementPointsTable, typePointsTable, signData, planetInfo->sign, point, 1);
|
2013-07-14 16:13:41 +00:00
|
|
|
|
2013-07-26 15:06:43 +00:00
|
|
|
planetInfo = get_planet_info(SE_JUPITER, te, cusps);
|
2013-08-19 22:35:47 +00:00
|
|
|
g_hash_table_replace(planetInfoTable, GINT_TO_POINTER(SE_JUPITER), planetInfo);
|
2013-08-19 21:38:05 +00:00
|
|
|
printf("Jupiter...: %s, House: %d (%f%s)\n", signName[planetInfo->sign], planetInfo->house, planetInfo->position, (planetInfo->retrograde) ? ", retrograde" : "");
|
2013-08-19 21:36:54 +00:00
|
|
|
INCREASE_POINTS(signDataTable, elementPointsTable, typePointsTable, signData, planetInfo->sign, point, 1);
|
2013-07-14 16:13:41 +00:00
|
|
|
|
2013-07-26 15:06:43 +00:00
|
|
|
planetInfo = get_planet_info(SE_SATURN, te, cusps);
|
2013-08-19 22:35:47 +00:00
|
|
|
g_hash_table_replace(planetInfoTable, GINT_TO_POINTER(SE_SATURN), planetInfo);
|
2013-08-19 21:38:05 +00:00
|
|
|
printf("Saturn....: %s, House: %d (%f%s)\n", signName[planetInfo->sign], planetInfo->house, planetInfo->position, (planetInfo->retrograde) ? ", retrograde" : "");
|
2013-08-19 21:36:54 +00:00
|
|
|
INCREASE_POINTS(signDataTable, elementPointsTable, typePointsTable, signData, planetInfo->sign, point, 1);
|
2013-07-14 16:13:41 +00:00
|
|
|
|
2013-07-26 15:06:43 +00:00
|
|
|
planetInfo = get_planet_info(SE_URANUS, te, cusps);
|
2013-08-19 22:35:47 +00:00
|
|
|
g_hash_table_replace(planetInfoTable, GINT_TO_POINTER(SE_URANUS), planetInfo);
|
2013-08-19 21:38:05 +00:00
|
|
|
printf("Uranus....: %s, House: %d (%f%s)\n", signName[planetInfo->sign], planetInfo->house, planetInfo->position, (planetInfo->retrograde) ? ", retrograde" : "");
|
2013-08-19 21:36:54 +00:00
|
|
|
INCREASE_POINTS(signDataTable, elementPointsTable, typePointsTable, signData, planetInfo->sign, point, 1);
|
2013-07-14 16:13:41 +00:00
|
|
|
|
2013-07-26 15:06:43 +00:00
|
|
|
planetInfo = get_planet_info(SE_NEPTUNE, te, cusps);
|
2013-08-19 22:35:47 +00:00
|
|
|
g_hash_table_replace(planetInfoTable, GINT_TO_POINTER(SE_NEPTUNE), planetInfo);
|
2013-08-19 21:38:05 +00:00
|
|
|
printf("Neptune...: %s, House: %d (%f%s)\n", signName[planetInfo->sign], planetInfo->house, planetInfo->position, (planetInfo->retrograde) ? ", retrograde" : "");
|
2013-08-19 21:36:54 +00:00
|
|
|
INCREASE_POINTS(signDataTable, elementPointsTable, typePointsTable, signData, planetInfo->sign, point, 1);
|
2013-07-26 15:06:43 +00:00
|
|
|
|
|
|
|
planetInfo = get_planet_info(SE_PLUTO, te, cusps);
|
2013-08-19 22:35:47 +00:00
|
|
|
g_hash_table_replace(planetInfoTable, GINT_TO_POINTER(SE_PLUTO), planetInfo);
|
2013-08-19 21:38:05 +00:00
|
|
|
printf("Pluto.....: %s, House: %d (%f%s)\n", signName[planetInfo->sign], planetInfo->house, planetInfo->position, (planetInfo->retrograde) ? ", retrograde" : "");
|
2013-08-19 21:36:54 +00:00
|
|
|
INCREASE_POINTS(signDataTable, elementPointsTable, typePointsTable, signData, planetInfo->sign, point, 1);
|
2013-07-26 15:06:43 +00:00
|
|
|
|
|
|
|
planetInfo = get_planet_info(SE_CHIRON, te, cusps);
|
2013-08-19 22:35:47 +00:00
|
|
|
g_hash_table_replace(planetInfoTable, GINT_TO_POINTER(SE_CHIRON), planetInfo);
|
2013-08-19 21:38:05 +00:00
|
|
|
printf("Chiron....: %s, House: %d (%f%s)\n", signName[planetInfo->sign], planetInfo->house, planetInfo->position, (planetInfo->retrograde) ? ", retrograde" : "");
|
2013-07-26 15:06:43 +00:00
|
|
|
|
|
|
|
planetInfo = get_planet_info(SE_MEAN_NODE, te, cusps);
|
2013-08-19 22:35:47 +00:00
|
|
|
g_hash_table_replace(planetInfoTable, GINT_TO_POINTER(SE_MEAN_NODE), planetInfo);
|
2013-08-19 21:38:05 +00:00
|
|
|
printf("North Node: %s, House: %d (%f%s)\n", signName[planetInfo->sign], planetInfo->house, planetInfo->position, (planetInfo->retrograde) ? ", retrograde" : "");
|
2013-08-19 21:36:54 +00:00
|
|
|
INCREASE_POINTS(signDataTable, elementPointsTable, typePointsTable, signData, planetInfo->sign, point, 1);
|
2013-07-14 16:13:41 +00:00
|
|
|
|
2013-07-26 15:07:03 +00:00
|
|
|
planetInfo = get_planet_info(SE_MEAN_APOG, te, cusps);
|
2013-08-19 22:35:47 +00:00
|
|
|
g_hash_table_replace(planetInfoTable, GINT_TO_POINTER(SE_MEAN_APOG), planetInfo);
|
2013-08-19 21:38:05 +00:00
|
|
|
printf("Dark Moon.: %s, House: %d (%f%s)\n", signName[planetInfo->sign], planetInfo->house, planetInfo->position, (planetInfo->retrograde) ? ", retrograde" : "");
|
2013-07-14 12:40:26 +00:00
|
|
|
|
2013-07-26 23:31:19 +00:00
|
|
|
planetInfo = get_planet_info(SE_CERES, te, cusps);
|
2013-08-19 22:35:47 +00:00
|
|
|
g_hash_table_replace(planetInfoTable, GINT_TO_POINTER(SE_CERES), planetInfo);
|
2013-08-19 21:38:05 +00:00
|
|
|
printf("Ceres.....: %s, House: %d (%f%s)\n", signName[planetInfo->sign], planetInfo->house, planetInfo->position, (planetInfo->retrograde) ? ", retrograde" : "");
|
2013-07-26 23:31:19 +00:00
|
|
|
|
|
|
|
planetInfo = get_planet_info(SE_PALLAS, te, cusps);
|
2013-08-19 22:35:47 +00:00
|
|
|
g_hash_table_replace(planetInfoTable, GINT_TO_POINTER(SE_PALLAS), planetInfo);
|
2013-08-19 21:38:05 +00:00
|
|
|
printf("Pallas....: %s, House: %d (%f%s)\n", signName[planetInfo->sign], planetInfo->house, planetInfo->position, (planetInfo->retrograde) ? ", retrograde" : "");
|
2013-07-26 23:31:19 +00:00
|
|
|
|
|
|
|
planetInfo = get_planet_info(SE_JUNO, te, cusps);
|
2013-08-19 22:35:47 +00:00
|
|
|
g_hash_table_replace(planetInfoTable, GINT_TO_POINTER(SE_JUNO), planetInfo);
|
2013-08-19 21:38:05 +00:00
|
|
|
printf("Juno......: %s, House: %d (%f%s)\n", signName[planetInfo->sign], planetInfo->house, planetInfo->position, (planetInfo->retrograde) ? ", retrograde" : "");
|
2013-07-26 23:31:19 +00:00
|
|
|
|
|
|
|
planetInfo = get_planet_info(SE_VESTA, te, cusps);
|
2013-08-19 22:35:47 +00:00
|
|
|
g_hash_table_replace(planetInfoTable, GINT_TO_POINTER(SE_VESTA), planetInfo);
|
2013-08-19 21:38:05 +00:00
|
|
|
printf("Vesta.....: %s, House: %d (%f%s)\n", signName[planetInfo->sign], planetInfo->house, planetInfo->position, (planetInfo->retrograde) ? ", retrograde" : "");
|
2013-07-26 23:31:19 +00:00
|
|
|
|
2013-08-19 22:36:55 +00:00
|
|
|
printf("\nELEMENTS\n========\n\n");
|
|
|
|
|
2013-08-19 21:36:54 +00:00
|
|
|
point = g_hash_table_lookup(elementPointsTable, GINT_TO_POINTER(ELEMENT_FIRE));
|
2013-08-19 22:36:55 +00:00
|
|
|
printf("Fire.: %d\n", (point == NULL) ? 0 : *point);
|
2013-08-19 21:36:54 +00:00
|
|
|
point = g_hash_table_lookup(elementPointsTable, GINT_TO_POINTER(ELEMENT_EARTH));
|
|
|
|
printf("Earth: %d\n", (point == NULL) ? 0 : *point);
|
|
|
|
point = g_hash_table_lookup(elementPointsTable, GINT_TO_POINTER(ELEMENT_AIR));
|
|
|
|
printf("Air..: %d\n", (point == NULL) ? 0 : *point);
|
|
|
|
point = g_hash_table_lookup(elementPointsTable, GINT_TO_POINTER(ELEMENT_WATER));
|
|
|
|
printf("Water: %d\n", (point == NULL) ? 0 : *point);
|
|
|
|
|
2013-08-19 22:36:55 +00:00
|
|
|
printf("\nTYPES\n=====\n\n");
|
|
|
|
|
2013-08-19 21:36:54 +00:00
|
|
|
point = g_hash_table_lookup(typePointsTable, GINT_TO_POINTER(TYPE_CARDINAL));
|
2013-08-19 22:36:55 +00:00
|
|
|
printf("Cardinal: %d\n", (point == NULL) ? 0 : *point);
|
2013-08-19 21:36:54 +00:00
|
|
|
point = g_hash_table_lookup(typePointsTable, GINT_TO_POINTER(TYPE_FIX));
|
|
|
|
printf("Fix.....: %d\n", (point == NULL) ? 0 : *point);
|
|
|
|
point = g_hash_table_lookup(typePointsTable, GINT_TO_POINTER(TYPE_MUTABLE));
|
|
|
|
printf("Mutable.: %d\n", (point == NULL) ? 0 : *point);
|
|
|
|
|
2013-08-19 22:37:39 +00:00
|
|
|
printf("\nASPECTS\n=======\n\n");
|
|
|
|
|
|
|
|
planetIdList = g_hash_table_get_keys(planetInfoTable);
|
2013-08-21 15:07:57 +00:00
|
|
|
aspectCheckData.planetIdList = planetIdList;
|
|
|
|
aspectCheckData.currentOuterPlanetId = 0;
|
|
|
|
aspectCheckData.planetInfoTable = planetInfoTable;
|
|
|
|
aspectCheckData.planetDataTable = planetDataTable;
|
|
|
|
g_list_foreach(planetIdList, check_aspects_outer_loop, &aspectCheckData);
|
2013-08-19 22:37:39 +00:00
|
|
|
g_list_free(planetIdList);
|
|
|
|
|
2013-08-19 22:35:47 +00:00
|
|
|
g_hash_table_unref(planetInfoTable);
|
2013-08-19 21:36:54 +00:00
|
|
|
g_hash_table_unref(typePointsTable);
|
|
|
|
g_hash_table_unref(elementPointsTable);
|
2013-08-21 15:04:43 +00:00
|
|
|
g_hash_table_unref(planetDataTable);
|
2013-08-19 21:36:54 +00:00
|
|
|
g_hash_table_unref(signDataTable);
|
|
|
|
|
2013-07-26 14:46:08 +00:00
|
|
|
return OK;
|
2013-07-14 12:40:26 +00:00
|
|
|
}
|
|
|
|
|