From cc621c155c8d6ac9808d9613a8c21f4df624a24a Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 7 Jul 2016 09:44:25 +0200 Subject: Fix division of twilights and sunset/sunrise MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/libred.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libred.h b/src/libred.h index 27b809d..d04ffb6 100644 --- a/src/libred.h +++ b/src/libred.h @@ -28,7 +28,7 @@ /** * The Sun's elevation at sunset and sunrise, measured in degrees. */ -#define LIBRED_SOLAR_ELEVATION_SUNSET_SUNRISE (0.0) +#define LIBRED_SOLAR_ELEVATION_SUNSET_SUNRISE (-32.0 / 60.0) /** * The Sun's elevation at civil dusk and civil dawn, measured in degrees. @@ -52,7 +52,7 @@ * @param ELEV:double The current elevation. * @return 1 if is twilight, 0 otherwise. */ -#define LIBRED_IS_TWILIGHT(ELEV) ((-18.0 <= (ELEV)) && ((ELEV) <= 0.0)) +#define LIBRED_IS_TWILIGHT(ELEV) ((-18.0 <= (ELEV)) && ((ELEV) <= -32.0 / 60.0)) /** * Test whether it is civil twilight. @@ -60,7 +60,7 @@ * @param ELEV:double The current elevation. * @return 1 if is civil twilight, 0 otherwise. */ -#define LIBRED_IS_CIVIL_TWILIGHT(ELEV) ((-6.0 <= (ELEV)) && ((ELEV) <= 0.0)) +#define LIBRED_IS_CIVIL_TWILIGHT(ELEV) ((-6.0 <= (ELEV)) && ((ELEV) <= -32.0 / 60.0)) /** * Test whether it is nautical twilight. @@ -68,7 +68,7 @@ * @param ELEV:double The current elevation. * @return 1 if is nautical twilight, 0 otherwise. */ -#define LIBRED_IS_NAUTICAL_TWILIGHT(ELEV) ((-12.0 <= (ELEV)) && ((ELEV) <= -6.0)) +#define LIBRED_IS_NAUTICAL_TWILIGHT(ELEV) ((-12.0 <= (ELEV)) && ((ELEV) <= -32.0 / 60.0)) /** * Test whether it is astronomical twilight. @@ -76,7 +76,7 @@ * @param ELEV:double The current elevation. * @return 1 if is astronomical twilight, 0 otherwise. */ -#define LIBRED_IS_ASTRONOMICAL_TWILIGHT(ELEV) ((-18.0 <= (ELEV)) && ((ELEV) <= -12.0)) +#define LIBRED_IS_ASTRONOMICAL_TWILIGHT(ELEV) ((-18.0 <= (ELEV)) && ((ELEV) <= -32.0 / 60.0)) /** -- cgit v1.2.3-70-g09d2