jblond/math-functions
Composer 安装命令:
composer require jblond/math-functions
包简介
description
README 文档
README
Install via composer
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)
- iso7730(float $temperature, float $radiantTemperature, float $velocity, float $relativeHumidity, float $metabolicRate, float $clothingInsulation )
- pmvToWords(float $pmv, string $lang = 'en') See also ISO-7730
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
- __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
- 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)
ISO‑52016 (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
- step(float $M, float $T, float $RH, float $dtHours, string $material = 'medium')
- accumulat(earray $samples, float $dtHours = 1.0, string $material = 'medium')
jblond/math-functions 适用场景与选型建议
jblond/math-functions 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 24 次下载、GitHub Stars 达 4, 最近一次更新时间为 2022 年 04 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 jblond/math-functions 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 jblond/math-functions 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 24
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-04-19