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

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

chiyoyo/distance
================

Calculate the distance between 2 points.

0.0.1(2y ago)0169MITPHPPHP ^7.1.8 || ^8.0

Since Oct 30Pushed 2y ago1 watchersCompare

[ Source](https://github.com/chiyoyo/distance)[ Packagist](https://packagist.org/packages/chiyoyo/distance)[ Docs](https://www.red-wing.biz/)[ RSS](/packages/chiyoyo-distance/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (2)Used By (0)

Distance
========

[](#distance)

[![PHPCS](https://github.com/chiyoyo/distance/actions/workflows/phpcs.yml/badge.svg)](https://github.com/chiyoyo/distance/actions/workflows/phpcs.yml)[![PHPMD](https://github.com/chiyoyo/distance/actions/workflows/phpmd.yml/badge.svg)](https://github.com/chiyoyo/distance/actions/workflows/phpmd.yml)[![Test](https://github.com/chiyoyo/distance/actions/workflows/phpunit.yml/badge.svg)](https://github.com/chiyoyo/distance/actions/workflows/phpunit.yml)

Overview
--------

[](#overview)

Calculate the distance between 2 locations.

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

[](#installation)

```
composer require chiyoyo/distance
```

Usage
-----

[](#usage)

```
// Coordinate Object
$coordinate1 = new Coordinate($latitude1, $longitude1);
$coordinate2 = new Coordinate($latitude2, $longitude2);

// Hybeny Distance Formula
$distance = Distance::hybeny($coordinate1, $coordinate2);

// Spherical Trigonometry
$distance = Distance::sphericalTrigonometry($coordinate1, $coordinate2);

// Geodesic Sailing
$distance = Distance::geodesicSailing($coordinate1, $coordinate2);
```

Features
--------

[](#features)

Find the distance (in meters) between two points using the following method.

- Hybeny Distance Formula
- [Spherical Trigonometry](https://en.wikipedia.org/wiki/Spherical_trigonometry)
- Geodesic Sailing

Author
------

[](#author)

Kouji Chihara

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 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

931d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

latitudelongitudedistance

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

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

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

###  Alternatives

[anthonymartin/geo-location

Powerful GeoCoding library: Retrieve bounding box coordinates, distances between geopoints, point in polygon, get longitude and latitude from addresses and more with GeoLocation for PHP

196949.5k5](/packages/anthonymartin-geo-location)[php-coord/php-coord

PHPCoord is a PHP library to aid in handling coordinates. It can convert coordinates for a point from one system to another and also calculate distance between points.

110914.5k12](/packages/php-coord-php-coord)[laravie/geotools

Geo-related tools PHP 7+ library

19105.4k1](/packages/laravie-geotools)[ballen/distical

A distance (Lat/Long) calculation library for PHP

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

Geographical value objects, parsers and formatters

20631.0k18](/packages/data-values-geo)[adlino/locations

Iran Provinces, Counties and Cities with a Google Map Location for Laravel.

171.3k](/packages/adlino-locations)

PHPackages © 2026

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