Conditions | 1 |
Paths | 1 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 1 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
58 | 1 | public function calc(): float |
|
59 | { |
||
60 | 1 | $a = 17.27; |
|
61 | 1 | $b = 237.7; |
|
62 | 1 | $t = $this->getTemp(); |
|
63 | |||
64 | 1 | $humidity = $this->getHumidity() / 100; |
|
65 | |||
66 | 1 | $a1 = ($a * $t) / ($b + $t); |
|
67 | 1 | $b1 = log($humidity); |
|
68 | |||
69 | 1 | $dewPoint = ($b * ( $a1 + $b1)) / ( $a - ($a1 + $b1)); |
|
70 | |||
71 | 1 | return $dewPoint; |
|
72 | } |
||
73 | } |
||
74 |