Update of /cvsroot/phpweather/phpweather
In directory usw-pr-cvs1:/tmp/cvs-serv3016
Modified Files:
phpweather.php
Log Message:
Added windchill factor
Index: phpweather.php
===================================================================
RCS file: /cvsroot/phpweather/phpweather/phpweather.php,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -3 -r1.17 -r1.18
--- phpweather.php 20 Mar 2002 19:26:50 -0000 1.17
+++ phpweather.php 24 Mar 2002 17:25:35 -0000 1.18
@@ -681,6 +681,21 @@
+ 2)), 1);
}
+
+ /*
+ * Compute windchill if temp < 40f and windspeed > 3 mph
+ */
+ if ($decoded_metar['temperature']['temp_f'] <= '40' && $decoded_metar['wind']['miles_per_hour'] > '3'){
+ $decoded_metar['windchill']['windchill_f'] =
+ number_format(35.74 + 0.6215*$decoded_metar['temperature']['temp_f']
+ - 35.75*pow($decoded_metar['wind']['miles_per_hour'],0.16)
+ + 0.4275*$decoded_metar['temperature']['temp_f']*pow($decoded_metar['wind']['miles_per_hour'],0.16));
+ $decoded_metar['windchill']['windchill_c'] =
+ number_format(13.112 + 0.6215*$decoded_metar['temperature']['temp_c']
+ - 13.37*pow(($decoded_metar['wind']['miles_per_hour']/1.609),0.16)
+ + 0.3965*$decoded_metar['temperature']['temp_c']*pow(($decoded_metar['wind']['miles_per_hour']/1.609),0.16));
+ }
+
/* Finally we store our decoded METAR in $this->decoded_metar so
* that other methods can use it.
*/
|