PHP code example of chiyoyo / distance
1. Go to this page and download the library: Download chiyoyo/distance library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
chiyoyo / distance example snippets
// 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);