aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-07-07 09:47:07 +0200
committerMattias Andrée <maandree@kth.se>2016-07-07 09:47:07 +0200
commit3716996e47d32ad89c13fbd9c268da33df011c38 (patch)
treea064ae00ace272f5f678dd2ccd601701736b112e /src
parentFix division of twilights and sunset/sunrise (diff)
downloadlibred-3716996e47d32ad89c13fbd9c268da33df011c38.tar.gz
libred-3716996e47d32ad89c13fbd9c268da33df011c38.tar.bz2
libred-3716996e47d32ad89c13fbd9c268da33df011c38.tar.xz
Add amateur astronomical twilight
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--src/libred.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libred.h b/src/libred.h
index d04ffb6..0bccd84 100644
--- a/src/libred.h
+++ b/src/libred.h
@@ -45,6 +45,11 @@
*/
#define LIBRED_SOLAR_ELEVATION_ASTRONOMICAL_DUSK_DAWN (-18.0)
+/**
+ * The Sun's elevation at amateur astronomical dusk and amateur astronomical dawn, measured in degrees.
+ */
+#define LIBRED_SOLAR_ELEVATION_AMATEUR_ASTRONOMICAL_DUSK_DAWN (-15.0)
+
/**
* Test whether it is twilight.
@@ -78,6 +83,14 @@
*/
#define LIBRED_IS_ASTRONOMICAL_TWILIGHT(ELEV) ((-18.0 <= (ELEV)) && ((ELEV) <= -32.0 / 60.0))
+/**
+ * Test whether it is amateur astronomical twilight.
+ *
+ * @param ELEV:double The current elevation.
+ * @return 1 if is astronomical twilight, 0 otherwise.
+ */
+#define LIBRED_IS_AMATEUR_ASTRONOMICAL_TWILIGHT(ELEV) ((-18.0 <= (ELEV)) && ((ELEV) <= -15.0))
+
/**
* Calculates the Sun's elevation as apparent