Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jblond/math-functions
A collection of Math functions for PHP
https://github.com/jblond/math-functions
geodistance heatindex math php php-library temperature windchill
Last synced: 3 months ago
JSON representation
A collection of Math functions for PHP
- Host: GitHub
- URL: https://github.com/jblond/math-functions
- Owner: JBlond
- License: mit
- Created: 2022-04-19T10:22:55.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-14T14:15:12.000Z (11 months ago)
- Last Synced: 2024-02-15T13:50:41.945Z (11 months ago)
- Topics: geodistance, heatindex, math, php, php-library, temperature, windchill
- Language: PHP
- Homepage:
- Size: 43.9 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Math functions
Install via composer
```php
composer require jblond/math-functions
```## Circle
- radiusToArea(float $radius)
- areaToRadius(float $area)
- areaToCircumference(float $area)
- circumferenceToArea(float $c)
- radiusToCircumference(float $radius)
- circumferenceToRadius(float $c)## Geo distance
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
- Fibonacci
- fibonacciRecursion(int $number)
- fibonacciWithBinetFormula(int $number)## Air
- 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)## Sphere
- areaOfADisc(float $radius)
- circumference(float $radius)
- diameter(float $radius)
- surfaceArea(float $radius)
- volume(float $radius)
- heading(array $from, array $to)## Temperature
- fahrenheitToCelsius(float $temperature)
- celsiusToFahrenheit(float $temperature)
- fahrenheitToKelvin(float $temperature)
- celsiusToKelvin(float $temperature)
- kelvinToCelsius(float $temperature)