cnp/cnp-haversine

Get distance between two points of interest.

v0.2 2015-12-09 18:24 UTC

This package is auto-updated.

Last update: 2024-12-15 03:11:37 UTC


README

Get the distance between two points using the Haversine formulae.

Usage

$location = new CnpPoi(28.535153, -81.383219);
$destination = new CnpPoi(42.594018, -88.433886)
$location->getDistanceInMilesTo($destination);
$location->getDistanceInMetersTo($destination);

References

See http://rosettacode.org/wiki/Haversine_formula#PHP