Update of /cvsroot/phpweather/phpweather-1.x
In directory usw-pr-cvs1:/tmp/cvs-serv20828
Modified Files:
phpweather.inc
Log Message:
Support for humidex thanks to Robin Senior <8r...@ql...>.
See this page for an explaination of humidex:
http://www.theweathernetwork.com/help/glossary/humidex.htm
Index: phpweather.inc
===================================================================
RCS file: /cvsroot/phpweather/phpweather-1.x/phpweather.inc,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- phpweather.inc 11 Aug 2002 11:38:58 -0000 1.10
+++ phpweather.inc 12 Aug 2002 23:59:16 -0000 1.11
@@ -952,6 +952,17 @@
(1779.75 * ($decoded_metar['dew_c'] - $decoded_metar['temp_c'])/
((237.3 + $decoded_metar['dew_c']) * (237.3 + $decoded_metar['temp_c']))
+ 2)), 1);
+
+ /*
+ * Humidity index
+ */
+ $e = 6.112 * pow(10, 7.5 * $decoded_metar['temp_c']
+ / (237.7 + $decoded_metar['temp_c']))
+ * $decoded_metar['rel_humidity']/100;
+ $decoded_metar['humidex_c'] =
+ number_format($decoded_metar['temp_c'] + 5/9 * ($e - 10),1);
+ $decoded_metar['humidex_f'] =
+ number_format($decoded_metar['humidex_c'] * 9/5 + 32, 1);
/*
* Windchill.
|