PHPackages                             yrehan32/php-haversine - 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. yrehan32/php-haversine

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

yrehan32/php-haversine
======================

A package used to calculate the distance between two coordinate points using the haversine algorithm

1.0.0(3y ago)239LGPL-2.1PHPPHP &gt;=7.0

Since Dec 27Pushed 3y ago1 watchersCompare

[ Source](https://github.com/yrehan32/php-haversine)[ Packagist](https://packagist.org/packages/yrehan32/php-haversine)[ RSS](/packages/yrehan32-php-haversine/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Installation
------------

[](#installation)

Install the library via Composer

```
composer require yrehan32/php-haversine
```

After installing the library, you can use it in your code like this:

```
use Yrehan32\PhpHaversine\Haversine;

/*
 * Calculate the distance between two points
 * @param float   $latitudeFrom   Latitude of the first point
 * @param float   $longitudeFrom  Longitude of the first point
 * @param float   $latitudeTo     Latitude of the second point
 * @param float   $longitudeTo    Longitude of the second point
 * @param string  $separators     Number of digits after the comma (default: 2)
 *
 * @return float Distance between the two points
 */
$distance = Haversine::calculate(
    52.2296756,
    21.0122287,
    52.406374,
    16.9251681
);
echo $distance; // It will print 278.46
```

License
-------

[](#license)

This library is licensed under the LGPL-2.1 License.

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

1237d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3f6ce8ea443d79be95b0ec98b4a8d5a4d88ec9718f992219316962f53807570f?d=identicon)[yrehan32](/maintainers/yrehan32)

---

Top Contributors

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

---

Tags

algorithmhaversinehaversine-formulaphpphp-library

### Embed Badge

![Health badge](/badges/yrehan32-php-haversine/health.svg)

```
[![Health](https://phpackages.com/badges/yrehan32-php-haversine/health.svg)](https://phpackages.com/packages/yrehan32-php-haversine)
```

###  Alternatives

[cyd622/laravel-admin-ext-echarts

Use Echarts in laravel-admin

349.5k](/packages/cyd622-laravel-admin-ext-echarts)

PHPackages © 2026

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