summaryrefslogtreecommitdiff
path: root/humidity.c
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-09-24 09:18:26 +0200
committerErich Eckner <git@eckner.net>2019-09-24 09:18:26 +0200
commit5a5bb02d01fce26195cff8e78e2d106b770c6507 (patch)
tree7296c39ce49486cf754b72054011d5b8a4b30baf /humidity.c
parent973ea982a7c50a53b6437c54505164f73ccfcc96 (diff)
downloadanzeige-5a5bb02d01fce26195cff8e78e2d106b770c6507.tar.xz
humidity: wip
Diffstat (limited to 'humidity.c')
-rw-r--r--humidity.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/humidity.c b/humidity.c
new file mode 100644
index 0000000..527492b
--- /dev/null
+++ b/humidity.c
@@ -0,0 +1,17 @@
+#include "humidity.h"
+
+double maximale_luftfeuchte(double t)
+{
+ for (int i=1; i<DAMPF_ANZ; i++)
+ if (dampf_temperaturen[i]>=t)
+ return (t-dampf_temperaturen[i-1])*(dampf_feuchten[i]-dampf_feuchten[i-1])/(dampf_temperaturen[i]-dampf_temperaturen[i-1]);
+ return -1;
+}
+
+double taupunkt(double af)
+{
+ for (int i=1; i<DAMPF_ANZ; i++)
+ if (dampf_feuchten[i]>=af)
+ return (af-dampf_feuchten[i-1])*(dampf_temperaturen[i]-dampf_temperaturen[i-1])/(dampf_feuchten[i]-dampf_feuchten[i-1]);
+ return -1;
+}