[Phphtmllib-devel] SF.net SVN: phphtmllib:[3519] trunk/open2300/lib/modules/api/ AviationWeather.in
Status: Beta
Brought to you by:
hemna
From: <he...@us...> - 2010-06-28 22:37:53
|
Revision: 3519 http://phphtmllib.svn.sourceforge.net/phphtmllib/?rev=3519&view=rev Author: hemna Date: 2010-06-28 22:37:47 +0000 (Mon, 28 Jun 2010) Log Message: ----------- added density altitude Modified Paths: -------------- trunk/open2300/lib/modules/api/AviationWeather.inc Modified: trunk/open2300/lib/modules/api/AviationWeather.inc =================================================================== --- trunk/open2300/lib/modules/api/AviationWeather.inc 2010-06-26 00:17:58 UTC (rev 3518) +++ trunk/open2300/lib/modules/api/AviationWeather.inc 2010-06-28 22:37:47 UTC (rev 3519) @@ -703,8 +703,33 @@ } - protected function density_altitude() { + /** + * + * @param unknown_type $altitude -- airport altitude + * @param unknown_type $Pmb -- pressure in millibars + * * @param unknown_type $PinHg -- pressure in inches of Mercury + * @param unknown_type $temp -- degress Celcius + * @param unknown_type $dewpoint -- degress Celcius + * @return unknown_type + * + * @link http://www.4wx.com/wxcalc/formulas/densityAltitude.php + */ + protected function density_altitude($altitude, $Pmb, $PinHg, $tempC, $dewC) { + + //get vapor pressure ($Vp) + $Vpexp = (7.5*$dewC) / (237.7+$dewC); + $Vp = 6.11*pow(10, $Vpexp); + //get virtual Temp $Tv (in Kelvin) + $TvK = ($tempC / (1-($Vp / $Pmb) * (1-0.622))); + + //convert temp to Rankine + $TvR = (9/5) * ($TvK + 764.84); + + //get density altitude + $Ad = 145366 * ( 1 - pow( ((17.326*$PinHG) / $TvR), 0.235) ); + + return $Ad; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |