Laracoord
Calculate distance between two points on a globe., (*1)
getDistance() method:, (*2)
No dependencies, just pass sets of coordinates to calculate distance between places., (*3)
Installation:, (*4)
Add, (*5)
"ivanciric/laracoord": "dev-master"
to composer "require" array., (*6)
Run "composer update"., (*7)
You can now use the class:, (*8)
$g = Laracoord::getDistance(
[
'lon' => 25.3892,
'lat' => 35.3172
],
[
'lon' => 28.3892,
'lat' => 37.3172
],
'km'
);
dd($g);
[], (*9)
Related links:, (*10)
http://mathworld.wolfram.com/Haversine.html, (*11)
http://www.codecodex.com/wiki/Calculate_distance_between_two_points_on_a_globe#PHP, (*12)