commit eb41e6a27c8cf969c1396ac06646a9300e2cb1ec parent 9ed43c53c3d839dd0aaff87b8dcb2fff3f872b3e Author: Johs <[email protected]> Date: Wed, 7 Jun 2023 08:47:48 +0200 working humidity calculator Diffstat:
M | Model/Key.php | | | 9 | ++++----- |
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/Model/Key.php b/Model/Key.php @@ -61,11 +61,10 @@ function windchill($temp, $wind){ } function humid($temp, $dewp){ - $specific_humidity = 6.11 * (10^(7.5 * $dewp) / (237.3 + $dewp)); - $saturation_point = 6.11 * (10^(7.5 * $temp) / (237.3 + $temp)); - $rel_humid = $specific_humidity / $saturation_point * 100; - echo ($specific_humidity); - return $rel_humid; + $specific_humidity = exp((17.625*$dewp)/(243.04+$dewp)); + $saturation_point = exp((17.625*$temp)/(243.04+$temp)); + + return ($specific_humidity / $saturation_point) * 100; } ?>