chiyoyo / distance
Calculate the distance between 2 points.
0.0.1
2023-10-30 02:39 UTC
Requires
- php: ^7.1.8 || ^8.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- phpmd/phpmd: ^2.9
- phpunit/phpunit: ^10.4
README
Overview
Calculate the distance between 2 locations.
Installation
composer require chiyoyo/distance
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
Find the distance (in meters) between two points using the following method.
- Hybeny Distance Formula
- Spherical Trigonometry
- Geodesic Sailing
Author
Kouji Chihara