PHP Class Horde_Service_Weather, horde

Author: Michael J Rubinsky ([email protected])
Show file Open project: horde/horde Class Usage Examples

Public Methods

Method Description
calculateDewPoint ( double $temperature, double $humidity ) : double Calculate dewpoint from temperature and humidity This is only an approximation, there is no exact formula, this one here is called Magnus-Formula
calculateHumidity ( double $temperature, double $dewPoint ) : double Calculate humidity from temperature and dewpoint This is only an approximation, there is no exact formula, this one here is called Magnus-Formula
calculateWindChill ( double $temperature, double $speed ) : double Calculate windchill from temperature and windspeed.
convertDistance ( double $distance, string $from, string $to ) : double Convert distance between m, km, ft and sm
convertPressure ( double $pressure, string $from, string $to ) : float Convert pressure between in, hpa, mb, mm and atm
convertSpeed ( double $speed, string $from, string $to ) : double | integer | boolean Convert speed between mph, kph, kt, mps, fps and bft
convertTemperature ( double $temperature, string $from, string $to ) : double Convert temperature between f and c
degToDirection ( integer $degree ) : string Utility function to return textual cardinal compass directions from degress.

Method Details

calculateDewPoint() public static method

Temperature has to be entered in deg C!
public static calculateDewPoint ( double $temperature, double $humidity ) : double
$temperature double Temperature in degrees C.
$humidity double Humidity.
return double

calculateHumidity() public static method

Temperature and dewpoint have to be entered in deg C!
public static calculateHumidity ( double $temperature, double $dewPoint ) : double
$temperature double Temperature in degrees C.
$dewPoint double Dewpoint in degrees C.
return double

calculateWindChill() public static method

Temperature has to be entered in deg F, speed in mph!
public static calculateWindChill ( double $temperature, double $speed ) : double
$temperature double The temperature in degrees F.
$speed double The wind speed in MPH.
return double The windchill factor.

convertDistance() public static method

Convert distance between m, km, ft and sm
public static convertDistance ( double $distance, string $from, string $to ) : double
$distance double The distance in $from units.
$from string The units to convert from.
$to string The units to convert to.
return double

convertPressure() public static method

Convert pressure between in, hpa, mb, mm and atm
public static convertPressure ( double $pressure, string $from, string $to ) : float
$pressure double The pressure in $from units.
$from string Units converting from.
$to string Units converting to.
return float The converted pressure

convertSpeed() public static method

Function will return 'false' when trying to convert from Beaufort, as it is a scale and not a true measurement
public static convertSpeed ( double $speed, string $from, string $to ) : double | integer | boolean
$speed double The speed in $from units.
$from string The units to convert from.
$to string The units to convert to.
return double | integer | boolean

convertTemperature() public static method

Convert temperature between f and c
public static convertTemperature ( double $temperature, string $from, string $to ) : double
$temperature double The temperature in $from units.
$from string Units to convert from.
$to string Units to convert to.
return double

degToDirection() public static method

Utility function to return textual cardinal compass directions from degress.
Since: 2.3.0
public static degToDirection ( integer $degree ) : string
$degree integer The degree direction (0 - 360).
return string The cardinal direction.