ldebrouwer/distance

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

Maintainers

Package info

github.com/ldebrouwer/distance

pkg:composer/ldebrouwer/distance

Statistics

Installs: 103

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

v1.0 2026-02-23 20:23 UTC

This package is not auto-updated.

Last update: 2026-03-09 20:37:21 UTC


README

Tests Latest Stable Version Total Downloads Latest Unstable Version License

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

Installation

Using Composer

When using Composer you can always load in the latest version.

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

Check it out on Packagist.

Usage

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

Still to come

  • Expanded unit support.
  • Documentation.