PHPackages                             ldebrouwer/distance - 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. ldebrouwer/distance

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

ldebrouwer/distance
===================

Distance helps you calculate the distance between GPS coordinates, in vanilla PHP. Pure and simple.

v1.0(3mo ago)1103MITPHPPHP &gt;=8.4CI passing

Since Apr 25Pushed 3mo ago2 watchersCompare

[ Source](https://github.com/ldebrouwer/distance)[ Packagist](https://packagist.org/packages/ldebrouwer/distance)[ Docs](https://github.com/ldebrouwer/distance)[ RSS](/packages/ldebrouwer-distance/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (4)Dependencies (7)Versions (6)Used By (0)

Distance
========

[](#distance)

[![Tests](https://github.com/ldebrouwer/distance/actions/workflows/tests.yml/badge.svg)](https://github.com/ldebrouwer/distance/actions/workflows/tests.yml)[![Latest Stable Version](https://camo.githubusercontent.com/93c7b8b6b6a8b35be9b64550f8e93286dec65ecde0615b9d70f1d0ee8b4812ed/68747470733a2f2f706f7365722e707567782e6f72672f6c646562726f757765722f64697374616e63652f762f737461626c65)](https://packagist.org/packages/ldebrouwer/distance)[![Total Downloads](https://camo.githubusercontent.com/8802cef5fb85e5044e6e1d70d402f0493ed59dcfb16207cbc3b1be312a27308d/68747470733a2f2f706f7365722e707567782e6f72672f6c646562726f757765722f64697374616e63652f646f776e6c6f616473)](https://packagist.org/packages/ldebrouwer/distance)[![Latest Unstable Version](https://camo.githubusercontent.com/45f3eb2047f5e9016df27cbf4390fe33fe51440c65fbfb91b9375b9df98638ce/68747470733a2f2f706f7365722e707567782e6f72672f6c646562726f757765722f64697374616e63652f762f756e737461626c65)](https://packagist.org/packages/ldebrouwer/distance)[![License](https://camo.githubusercontent.com/caedb3d9c2e4693dff3039e4957f43538b2e5bc42fb2be588132fe419a5590ad/68747470733a2f2f706f7365722e707567782e6f72672f6c646562726f757765722f64697374616e63652f6c6963656e7365)](https://packagist.org/packages/ldebrouwer/distance)

Distance helps you calculate the distance between GPS coordinates, in vanilla PHP. Pure and simple.

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

[](#installation)

### Using Composer

[](#using-composer)

When using [Composer](https://getcomposer.org) you can always load in the latest version.

```
{
    "require": {
        "ldebrouwer/distance": "^1.0"
    }
}
```

Check it out [on Packagist](https://packagist.org/packages/ldebrouwer/distance).

Usage
-----

[](#usage)

```
$distance = new Distance()
    ->setFormula(Formula::HAVERSINE)
    ->setUnit(Unit::KILOMETRES)
    ->between(37.331741, -122.030333, 37.422546, -122.084250);
```

Still to come
-------------

[](#still-to-come)

- Expanded unit support.
- Documentation.

###  Health Score

50

—

FairBetter than 95% of packages

Maintenance80

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity84

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 64.7% 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 ~1319 days

Total

4

Last Release

106d ago

Major Versions

v0.2 → v1.02026-02-23

PHP version history (2 changes)v0.1PHP &gt;=5.5

v1.0PHP &gt;=8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/09c2bfa22b6e83cf490a8c0582be9084da9df9431697a383eb2a09f6cae79456?d=identicon)[ldebrouwer](/maintainers/ldebrouwer)

---

Top Contributors

[![ldebrouwer-rmn](https://avatars.githubusercontent.com/u/6084647?v=4)](https://github.com/ldebrouwer-rmn "ldebrouwer-rmn (11 commits)")[![ldebrouwer](https://avatars.githubusercontent.com/u/913410?v=4)](https://github.com/ldebrouwer "ldebrouwer (6 commits)")

---

Tags

phplocationlatitudelongitudedistancegpscoordinates

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/ldebrouwer-distance/health.svg)

```
[![Health](https://phpackages.com/badges/ldebrouwer-distance/health.svg)](https://phpackages.com/packages/ldebrouwer-distance)
```

###  Alternatives

[jeroendesloovere/distance

Get distance between two locations using PHP.

3664.4k](/packages/jeroendesloovere-distance)[ballen/distical

A distance (Lat/Long) calculation library for PHP

40194.3k2](/packages/ballen-distical)[data-values/geo

Geographical value objects, parsers and formatters

17646.1k21](/packages/data-values-geo)[laravie/geotools

Geo-related tools PHP 7+ library

18122.1k1](/packages/laravie-geotools)[1001pharmacies/geolocation-bundle

Provides an abstraction layer for geocoding services.

116.8k](/packages/1001pharmacies-geolocation-bundle)

PHPackages © 2026

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