PHPackages                             frostybee/geobee - 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. frostybee/geobee

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

frostybee/geobee
================

A simple, stand-alone PHP library for calculating the distance between geographical coordinates.

v2.0.0(5mo ago)131811MITPHPPHP &gt;=8.2

Since Mar 22Pushed 5mo ago1 watchersCompare

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

READMEChangelog (3)Dependencies (1)Versions (4)Used By (0)

Geobee
======

[](#geobee)

A standalone PHP library for calculating the great-circle distance between geographical coordinates using a spherical Earth model.

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

[](#installation)

This library requires no dependencies.

To install it:

- Clone this repository.
- Or use composer: `composer require frostybee/geobee`

Units of Lengths
----------------

[](#units-of-lengths)

The following are the supported units of lengths along with their respective conversion factors:

- `m` - Meters (default, base unit)
- `km` - Kilometers (1km = 1000 meters)
- `mi` - Miles (1mi = 1609.344 meters)
- `nm` - Nautical miles (1nm = 1852 meters)
- `yd` - Yards (1yd = 0.9144 meters)
- `ft` - Feet (1ft = 0.3048 meters)

**Note**: Unit symbols are case-insensitive (e.g., 'km', 'KM', 'Km' all work).

Usage
-----

[](#usage)

Using this library is simple and straightforward. Just instantiate the `Calculator` class and supply two pairs of latitude/longitude to the `calculate()` method as shown below.

```
