PHPackages                             jblond/math-functions - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. jblond/math-functions

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

jblond/math-functions
=====================

description

1.9.4(3mo ago)422MITPHPPHP &gt;= 8.0

Since Apr 19Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/JBlond/math-functions)[ Packagist](https://packagist.org/packages/jblond/math-functions)[ RSS](/packages/jblond-math-functions/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (17)Used By (0)

Math functions
==============

[](#math-functions)

[![https://packagist.org/packages/jblond/math-functions](https://camo.githubusercontent.com/6ef23df0545b6611da9e5d72bc11d235f41877e6f095ee3e73d0ea3be65bd3d9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a626c6f6e642f6d6174682d66756e6374696f6e733f6c6f676f3d7061636b6167697374266c6162656c3d5061636b6167697374)](https://camo.githubusercontent.com/6ef23df0545b6611da9e5d72bc11d235f41877e6f095ee3e73d0ea3be65bd3d9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a626c6f6e642f6d6174682d66756e6374696f6e733f6c6f676f3d7061636b6167697374266c6162656c3d5061636b6167697374)[![https://packagist.org/packages/jblond/math-functions](https://camo.githubusercontent.com/26e4c98a6c43ae7c8f47d081926f12476f529815c54313073e4db4b122db1902/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6a626c6f6e642f6d6174682d66756e6374696f6e733f6c6f676f3d706870266c6162656c3d504850)](https://camo.githubusercontent.com/26e4c98a6c43ae7c8f47d081926f12476f529815c54313073e4db4b122db1902/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6a626c6f6e642f6d6174682d66756e6374696f6e733f6c6f676f3d706870266c6162656c3d504850)[![https://packagist.org/packages/jblond/math-functions](https://camo.githubusercontent.com/49627c17e68658551c9dc3fdf544501cd36326fc73c0ef31ec441f85fc4a111c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a626c6f6e642f6d6174682d66756e6374696f6e733f6c6f676f3d636f6d706f736572266c6162656c3d446f776e6c6f616473)](https://camo.githubusercontent.com/49627c17e68658551c9dc3fdf544501cd36326fc73c0ef31ec441f85fc4a111c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a626c6f6e642f6d6174682d66756e6374696f6e733f6c6f676f3d636f6d706f736572266c6162656c3d446f776e6c6f616473)[![https://packagist.org/packages/jblond/math-functions](https://camo.githubusercontent.com/53ae0f3d4aa6f735a0dd9b3995db428f5bf574978d99961521a42415d14a9d53/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6a626c6f6e642f6d6174682d66756e6374696f6e733f6c6162656c3d4c6963656e7365)](https://camo.githubusercontent.com/53ae0f3d4aa6f735a0dd9b3995db428f5bf574978d99961521a42415d14a9d53/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6a626c6f6e642f6d6174682d66756e6374696f6e733f6c6162656c3d4c6963656e7365)

Install via composer

```
composer require jblond/math-functions
```

Circle
------

[](#circle)

- radiusToArea(float $radius)
- areaToRadius(float $area)
- areaToCircumference(float $area)
- circumferenceToArea(float $c)
- radiusToCircumference(float $radius)
- circumferenceToRadius(float $c)

Geo distance
------------

[](#geo-distance)

Calculates the distance between two points. [Choose your function](geodistance.md).

- 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)

- Fibonacci
    - fibonacciRecursion(int $number)
    - fibonacciWithBinetFormula(int $number)

Air
---

[](#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)
- iso7730(float $temperature, float $radiantTemperature, float $velocity, float $relativeHumidity, float $metabolicRate, float $clothingInsulation )
- pmvToWords(float $pmv, string $lang = 'en') See also [ISO-7730](ISO-7730.md)

Psychrometric Chart
-------------------

[](#psychrometric-chart)

- saturationVaporPressurePa(float $T)
- humidityRatioFromRH(float $T, float $RH, float $pPa = 101325.0)
- enthalpy(float $T, float $w)
- rhIsoline(float $RH, float $pPa = 101325.0, float $Tmin = 0.0, float $Tmax = 40.0, float $dT = 1.0)
- enthalpyLine(float $hTarget, float $Tmin = 0.0, float $Tmax = 40.0, float $dT = 1.0)
- stateLineAtT(float $T, float $pPa = 101325.0)

PsychrometricChartRenderer
--------------------------

[](#psychrometricchartrenderer)

- \_\_construct(int $width = 1000, int $height = 700)
- setRanges(float $tMin, float $tMax, float $wMin, float $wMax)
- setPressurePa(float $p)
- drawAxesAndGrid(float $tStep = 5.0, float $wStep = 0.005)
- drawRhIsolines(array $rhValues = \[10,20,30,40,50,60,70,80,90,100\], float $tStep = 0.5)
- drawEnthalpyLines(array $hValues = \[20, 30, 40, 50, 60, 70, 80\], float $tStep = 0.5)
- plotPointFromTRH(float $T, float $RH, int $radius = 8, string $label = '')
- savePng(string $path)

Sphere
------

[](#sphere)

- areaOfADisc(float $radius)
- circumference(float $radius)
- diameter(float $radius)
- surfaceArea(float $radius)
- volume(float $radius)
- heading(array $from, array $to)

Temperature
-----------

[](#temperature)

- fahrenheitToCelsius(float $temperature)
- celsiusToFahrenheit(float $temperature)
- fahrenheitToKelvin(float $temperature)
- celsiusToKelvin(float $temperature)
- kelvinToCelsius(float $temperature)

ISO‑52016 (Building Energy / Moisture Module)
---------------------------------------------

[](#iso52016-building-energy--moisture-module)

- vaporPressureDeficitPa(float $T, float $RH)
- degreeOfSaturation(float $T, float $RH, float $pressurePa = 101325.0)
- specificHumidity(float $T, float $RH, float $pressurePa = 101325.0)
- latentMoistureLoad(float $airFlowM3s, float $T, float $RH, float $targetRH, float $pressurePa = 101325.0)
- operativeTemperature(float $airTemp, float $radiantTemp, float $airVelocity = 0.1)
- moistureBalanceStep(float $currentW, float $moistureSourceKgPerS, float $airMassFlowKgPerS, float $targetW, float $dtSeconds)

MouldIndex
----------

[](#mouldindex)

- step(float $M, float $T, float $RH, float $dtHours, string $material = 'medium')
- accumulat(earray $samples, float $dtHours = 1.0, string $material = 'medium')

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance80

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~92 days

Recently: every ~29 days

Total

16

Last Release

105d ago

PHP version history (2 changes)1.0.0PHP &gt;= 7.4

1.7.1PHP &gt;= 8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/e29eedf6a63367a7c0841f304be766cb6745cd798ff066a00d342ada47e507b2?d=identicon)[JBlond](/maintainers/JBlond)

---

Top Contributors

[![JBlond](https://avatars.githubusercontent.com/u/2391810?v=4)](https://github.com/JBlond "JBlond (117 commits)")

---

Tags

cosine-lawenthalpyequirectangular-approximationgeodistancehaversinehaversine-formulaheatindexiso-7730iso7730mathmoistairenthalpymoldindexphpphp-libraryphp-mathtemperaturevincentyvincenty-formulawindchill

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/jblond-math-functions/health.svg)

```
[![Health](https://phpackages.com/badges/jblond-math-functions/health.svg)](https://phpackages.com/packages/jblond-math-functions)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
