master
Zwarf 2022-01-13 12:18:08 +01:00
rodzic e8f4edca3b
commit 3197d4a246
4 zmienionych plików z 40 dodań i 19 usunięć

Wyświetl plik

@ -26,10 +26,3 @@ subdir('src')
subdir('po')
meson.add_install_script('build-aux/meson/postinstall.py')
gnome.post_install(
gtk_update_icon_cache: true,
glib_compile_schemas: true,
update_desktop_database: true,
)

Wyświetl plik

@ -30,8 +30,11 @@ float
longitude_moon = calc_deg_to_rad (longitude_moon);
latitude_moon = calc_deg_to_rad (latitude_moon);
right_ascension = atan2(cos(ecliptic)*sin(longitude_moon)-sin(ecliptic)*tan(latitude_moon), cos(longitude_moon));
declination = asin(cos(ecliptic)*sin(latitude_moon)+sin(ecliptic)*cos(latitude_moon)*sin(longitude_moon));
right_ascension = atan2(cos(ecliptic)*sin(longitude_moon)
-sin(ecliptic)*tan(latitude_moon), cos(longitude_moon));
declination = asin(cos(ecliptic)*sin(latitude_moon)
+sin(ecliptic)*cos(latitude_moon)*sin(longitude_moon));
/* g_print("time_jd: %f, ecliptic: %f, longitude_moon: %f, latitude_moon: %f, right_ascension %f\n", time_jd, ecliptic, longitude_moon, latitude_moon, right_ascension); */

Wyświetl plik

@ -20,7 +20,8 @@ calc_rad_to_deg (float rad)
int
max_day_in_month (int month, int year)
max_day_in_month (int month,
int year)
{
int max_days = 30;
/* check which month is set */
@ -45,7 +46,10 @@ max_day_in_month (int month, int year)
int
times_to_time_zone (int day_utc, int hour_utc, int day_local, int hour_local)
times_to_time_zone (int day_utc,
int hour_utc,
int day_local,
int hour_local)
{
int time_zone;
if (day_utc == day_local){
@ -85,7 +89,14 @@ int
time_zone = times_to_time_zone (tmp->tm_mday, tmp->tm_hour, tmp_local.tm_mday, tmp_local.tm_hour);
g_print ("UTC: %02d:%02d - %d.%d.%d, Time zone: %d\n", tmp->tm_hour, tmp->tm_min, tmp->tm_mday, tmp->tm_mon+1, tmp->tm_year+1900, time_zone);
g_print ("UTC: %02d:%02d - %d.%d.%d, Time zone: %d\n",
tmp->tm_hour,
tmp->tm_min,
tmp->tm_mday,
tmp->tm_mon+1,
tmp->tm_year+1900,
time_zone
);
time_utc[0] = tmp->tm_year+1900;
time_utc[1] = tmp->tm_mon+1;
@ -189,7 +200,12 @@ calc_jd (int *time_utc)
month += 12;
}
time_jd = (int)(365.25*(year+4716.)) + (int)(30.6001*(month+1.)) - (int)(year/100.) + (int)(year/400.) + day + 2. - 1524.5;
time_jd = (int)(365.25*(year+4716.))
+ (int)(30.6001*(month+1.))
- (int)(year/100.)
+ (int)(year/400.)
+ day + 2. - 1524.5;
/* g_print ("Julian Day: %f, Day JD: %f, hour JD %f\n", *time_jd, day, hour); */
/*Explanation:
@ -231,7 +247,8 @@ calc_jd (int *time_utc)
/* Calculate the Sidereal time in degree (German: Sternzeit) */
double
time_jd_to_sidereal_time(float longitude, double time_jd)
time_jd_to_sidereal_time(float longitude,
double time_jd)
{
float hours_passed;
double T;
@ -256,7 +273,10 @@ time_jd_to_sidereal_time(float longitude, double time_jd)
* This formular is NOT allowed to get julian days which end on .5 (00:00), because the formular below only considers the rotation around the sun NOT its' own prcession.
* So we only want to know in which "direktion" we look every day at 00:00 in Greenwich in comparison to the "fixed" stars. */
sidereal_time = 100.46061837 + T*(36000.770053608 + T*(0.000387933 - T/38710000.0)) + longitude + hours_passed*1.00273790935*15;
sidereal_time = 100.46061837
+ T*(36000.770053608 + T*(0.000387933 - T/38710000.0))
+ longitude + hours_passed*1.00273790935*15;
sidereal_time = remainder(sidereal_time, 360);
/* g_print("time_jd: %f, sidereal_time %f, hours_passed: %f\n", *time_jd, *sidereal_time, hours_passed); */
@ -289,7 +309,9 @@ time_jd_to_sidereal_time(float longitude, double time_jd)
/* Convert between the rotation coordinate system and the horizontal coordinate system */
float
*convert_rotational_to_horizontal_coordinate_system (float *coordinates_rot, float latitude, double time_sidereal)
*convert_rotational_to_horizontal_coordinate_system (float *coordinates_rot,
float latitude,
double time_sidereal)
{
float x, y;
float azimuth, elevation;
@ -301,7 +323,9 @@ float
right_ascension = calc_deg_to_rad (coordinates_rot[0]);
declination = calc_deg_to_rad (coordinates_rot[1]);
x = -cos (latitude) * sin (declination) + sin (latitude) * cos (declination) * cos (time_sidereal - right_ascension);
x = -cos (latitude) * sin (declination)
+ sin (latitude) * cos (declination) * cos (time_sidereal - right_ascension);
y = cos (declination) * sin (time_sidereal - right_ascension);
if (x < 0 && y <= 0)
@ -330,7 +354,8 @@ float
g_print("Error calculating azimuth!");
}
elevation = asin (sin (latitude) * sin (declination) + cos (latitude) * cos (declination) * cos (time_sidereal - right_ascension));
elevation = asin (sin (latitude) * sin (declination)
+ cos (latitude) * cos (declination) * cos (time_sidereal - right_ascension));
/* TODO
* explanation missing!!

Wyświetl plik

@ -18,7 +18,7 @@ picplanner_deps = [
gnome = import('gnome')
picplanner_sources += gnome.compile_resources('picplanner-resources',
'picplanner.gresource.xml', source_dir: '.',
'picplanner.gresource.xml',
c_name: 'picplanner'
)