summaryrefslogtreecommitdiff
path: root/humidity.c
diff options
context:
space:
mode:
Diffstat (limited to 'humidity.c')
-rw-r--r--humidity.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/humidity.c b/humidity.c
index 527492b..6aa1cfb 100644
--- a/humidity.c
+++ b/humidity.c
@@ -4,7 +4,11 @@ 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
+ (t - dampf_temperaturen[i-1])
+ * (dampf_feuchten[i] - dampf_feuchten[i-1])
+ / (dampf_temperaturen[i] - dampf_temperaturen[i-1])
+ + dampf_feuchten[i-1];
return -1;
}
@@ -12,6 +16,10 @@ 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
+ (af - dampf_feuchten[i-1])
+ * (dampf_temperaturen[i] - dampf_temperaturen[i-1])
+ / (dampf_feuchten[i] - dampf_feuchten[i-1])
+ + dampf_temperaturen[i-1];
return -1;
}