ivanciric / laracoord by ivanciric

Laravel 5 package for geolocation distance calculations
200
0
2
Package Data
Maintainer Username: ivanciric
Maintainer Contact: info@yoshi.tech (Ivan Ciric)
Package Create Date: 2016-04-03
Package Last Update: 2016-12-20
Language: PHP
License: MIT
Last Refreshed: 2025-02-05 15:00:11
Package Statistics
Total Downloads: 200
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 0
Total Watchers: 2
Total Forks: 0
Total Open Issues: 0

Laracoord

Calculate distance between two points on a globe.

getDistance() method:

No dependencies, just pass sets of coordinates to calculate distance between places.

Installation:

Add

"ivanciric/laracoord": "dev-master" 

to composer "require" array.

Run "composer update".

You can now use the class:

$g = Laracoord::getDistance(
            [
                'lon' => 25.3892,
                'lat' => 35.3172
            ],
            [
                'lon' => 28.3892,
                'lat' => 37.3172
            ],
            'km'
        );

dd($g);

[Screenshot]

Related links:

http://mathworld.wolfram.com/Haversine.html

http://www.codecodex.com/wiki/Calculate_distance_between_two_points_on_a_globe#PHP