diff options
author | Mattias Andrée <maandree@kth.se> | 2016-07-07 09:44:25 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2016-07-07 09:44:25 +0200 |
commit | cc621c155c8d6ac9808d9613a8c21f4df624a24a (patch) | |
tree | 8cee4efe7f874b38796ddb93d3b951525bc20361 /src | |
parent | m (diff) | |
download | libred-cc621c155c8d6ac9808d9613a8c21f4df624a24a.tar.gz libred-cc621c155c8d6ac9808d9613a8c21f4df624a24a.tar.bz2 libred-cc621c155c8d6ac9808d9613a8c21f4df624a24a.tar.xz |
Fix division of twilights and sunset/sunrise
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src')
-rw-r--r-- | src/libred.h | 10 |
1 files 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)) /** |