mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-16 06:18:47 +02:00
Code cleanup; fix astro example.
This commit is contained in:
@@ -62,7 +62,31 @@ ELSE
|
||||
REM [moondatetime(2)] +60 SPECIAL COLOR 0 0 0 Full moon: 🌕 [$T] %3 (%b)
|
||||
REM [moondatetime(3)] +60 SPECIAL COLOR 128 128 64 Last Quarter: 🌗 [$T] %3 (%b)
|
||||
ENDIF
|
||||
EOF
|
||||
|
||||
echo ""
|
||||
|
||||
remind -g "-i\$Latitude=\"$latitude\"" "-i\$Longitude=\"$longitude\"" -q -@2 - "$@" <<'EOF'
|
||||
SET $AddBlankLines 0
|
||||
FSET angle_to_direction(x) \
|
||||
IIF(x > 348 && x <= 11, "North", \
|
||||
x > 11 && x <= 34, "North North-East", \
|
||||
x > 34 && x <= 56, "North-East", \
|
||||
x > 56 && x <= 79, "East North-East", \
|
||||
x > 79 && x <= 101, "East", \
|
||||
x > 101 && x <= 124, "East South-East", \
|
||||
x > 124 && x <= 146, "South-East", \
|
||||
x > 146 && x <= 169, "South South-East", \
|
||||
x > 169 && x <= 191, "South", \
|
||||
x > 191 && x <= 214, "South South-West", \
|
||||
x > 214 && x <= 236, "South-West", \
|
||||
x > 236 && x <= 259, "West South-West", \
|
||||
x > 259 && x <= 281, "West", \
|
||||
x > 281 && x <= 304, "West North-West", \
|
||||
x > 304 && x <= 326, "North-West", \
|
||||
"North North-West")
|
||||
|
||||
BANNER %
|
||||
set mr moonrise()
|
||||
set ms moonset()
|
||||
set mr_a moonrisedir()
|
||||
@@ -72,11 +96,16 @@ IF mr < ms
|
||||
REM NOQUEUE [mr] MSG The moon rises %3 in the [angle_to_direction(mr_a)] ([mr_a] degrees)
|
||||
REM NOQUEUE [ms] MSG The moon sets %3 in the [angle_to_direction(ms_a)] ([ms_a] degrees)
|
||||
ELSE
|
||||
REM NOQUEUE [ms] MSG The moon sets %3 in the [angle_to_direction(mr_a)] ([mr_a] degrees)
|
||||
REM NOQUEUE [mr] MSG The moon rises %3 in the [angle_to_direction(ms_a)] ([ms_a] degrees)
|
||||
REM NOQUEUE [ms] MSG The moon sets %3 in the [angle_to_direction(ms_a)] ([ms_a] degrees)
|
||||
REM NOQUEUE [mr] MSG The moon rises %3 in the [angle_to_direction(mr_a)] ([mr_a] degrees)
|
||||
ENDIF
|
||||
REM MSG
|
||||
|
||||
IF (datepart(mr) != today())
|
||||
REM MSG There is no moonrise today
|
||||
ENDIF
|
||||
IF (datepart(ms) != today())
|
||||
REM MSG There is no moonset today
|
||||
ENDIF
|
||||
EOF
|
||||
|
||||
echo ""
|
||||
|
||||
@@ -782,9 +782,10 @@ static void test_moon_event(int k, double offset_days, struct MoonInfo *moon_inf
|
||||
hz = ha[0] + e * (ha[2] - ha[0]); // Azimuth of the moon at the event.
|
||||
nz = -cos(declination[1]) * sin(hz);
|
||||
dz = c * sin(declination[1]) - s * cos(declination[1]) * cos(hz);
|
||||
az = atan2(nz, dz) / (PI / 180);
|
||||
if (az < 0)
|
||||
az = atan2(nz, dz) * (180 / PI);
|
||||
if (az < 0) {
|
||||
az += 360;
|
||||
}
|
||||
|
||||
// If there is no previously recorded event of this type, save this event.
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user