Install via composer
composer require jblond/math-functions
- radiusToArea(float $radius)
- areaToRadius(float $area)
- areaToCircumference(float $area)
- circumferenceToArea(float $c)
- radiusToCircumference(float $radius)
- circumferenceToRadius(float $c)
Calculates the distance between two points. Choose your function.
- vincenty function
- Parameters
float $latitudeFrom Latitude of start point in [deg decimal]
float $longitudeFrom Longitude of start point in [deg decimal]
float $latitudeTo Latitude of target point in [deg decimal]
float $longitudeTo Longitude of target point in [deg decimal]
float $earthRadius Mean earth radius in [m]
OPTIONAL float|int Distance between points in [m] (same as earthRadius) default: 6371000 meters - haversine function
- Parameters
float $latitudeFrom Latitude of start point in [deg decimal]
float $longitudeFrom Longitude of start point in [deg decimal]
float $latitudeTo Latitude of target point in [deg decimal]
float $longitudeTo Longitude of target point in [deg decimal]
- greatCircle
- Parameters
float $latitudeFrom Latitude of start point in [deg decimal]
float $longitudeFrom Longitude of start point in [deg decimal]
float $latitudeTo Latitude of target point in [deg decimal]
- float $longitudeTo Longitude of target point in [deg decimal]
- equirectangularApproximation
- Parameters
float $latitudeFrom Latitude of start point in [deg decimal]
float $longitudeFrom Longitude of start point in [deg decimal]
float $latitudeTo Latitude of target point in [deg decimal]
float $longitudeTo Longitude of target point in [deg decimal]
- cosineLaw
- Parameters
float $latitudeFrom Latitude of start point in [deg decimal]
float $longitudeFrom Longitude of start point in [deg decimal]
float $latitudeTo Latitude of target point in [deg decimal]
float $longitudeTo Longitude of target point in [deg decimal]
- Fibonacci
- fibonacciRecursion(int $number)
- fibonacciWithBinetFormula(int $number)
- AbsoluteHumidity(float $relativeHumidity, float $temperature, bool $temperatureInFahrenheit = false, bool $isRelativeHumidityInPercent = true)
- density(float $temperatureInCelsius, float $airPressure, float $relativeHumidityInPercent)
- dewPoint(float $temperatureInCelsius, float $humidityInPercent)
- heatIndex(float $temperatureInCelsius, float $humidityInPercent)
- heatIndexWarning(int $heatIndex)
- wetBulbTemperature(float $temperatureInCelsius, float $humidityInPercent)
- windchill(float $temperatureInCelsius, float $windSpeedInKmPerHour)
- areaOfADisc(float $radius)
- circumference(float $radius)
- diameter(float $radius)
- surfaceArea(float $radius)
- volume(float $radius)
- heading(array $from, array $to)
- fahrenheitToCelsius(float $temperature)
- celsiusToFahrenheit(float $temperature)
- fahrenheitToKelvin(float $temperature)
- celsiusToKelvin(float $temperature)
- kelvinToCelsius(float $temperature)