PHP Класс Horde_Service_Weather, horde

Автор: Michael J Rubinsky ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Описание методов

calculateDewPoint() публичный статический Метод

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.
Результат double

calculateHumidity() публичный статический Метод

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.
Результат double

calculateWindChill() публичный статический Метод

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.
Результат double The windchill factor.

convertDistance() публичный статический Метод

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.
Результат double

convertPressure() публичный статический Метод

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.
Результат float The converted pressure

convertSpeed() публичный статический Метод

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.
Результат double | integer | boolean

convertTemperature() публичный статический Метод

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.
Результат double

degToDirection() публичный статический Метод

Utility function to return textual cardinal compass directions from degress.
С версии: 2.3.0
public static degToDirection ( integer $degree ) : string
$degree integer The degree direction (0 - 360).
Результат string The cardinal direction.