-
Notifications
You must be signed in to change notification settings - Fork 1
/
distanceMeter.php
executable file
·68 lines (58 loc) · 1.53 KB
/
distanceMeter.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
require_once '../src/Mind.php';
$Mind = new Mind();
/* These are two points in Turkey */
$point1 = array('lat' => 41.008610, 'long' => 28.971111); // Istanbul
$point2 = array('lat' => 39.925018, 'long' => 32.836956); // Anitkabir
//Array
//(
// [m] => 4188.59
// [km] => 4.19
// [mi] => 2.6
// [ft] => 13742.1
// [yd] => 4580.64
//)
$distance = $Mind->distanceMeter($point1['lat'], $point1['long'], $point2['lat'], $point2['long']);
echo '<pre>';
print_r($distance);
echo '</pre>';
//4188.59
$distance = $Mind->distanceMeter($point1['lat'], $point1['long'], $point2['lat'], $point2['long'], 'm');
echo $distance;
echo '<br>';
//4188.59
$distance = $Mind->distanceMeter($point1['lat'], $point1['long'], $point2['lat'], $point2['long'], array('m'));
echo $distance;
//Array
//(
// [m] => 4188.59
// [km] => 4.19
//)
$distance = $Mind->distanceMeter($point1['lat'], $point1['long'], $point2['lat'], $point2['long'], array('m', 'km'));
echo '<pre>';
print_r($distance);
echo '</pre>';
//Array
//(
// [m] => 4188.59
// [km] => 4.19
// [mi] => 2.6
// [ft] => 13742.1
// [yd] => 4580.64
//)
$distance = $Mind->distanceMeter($point1['lat'], $point1['long'], $point2['lat'], $point2['long'], array());
echo '<pre>';
print_r($distance);
echo '</pre>';
//Array
//(
// [m] => 4188.59
// [km] => 4.19
// [mi] => 2.6
// [ft] => 13742.1
// [yd] => 4580.64
//)
$distance = $Mind->distanceMeter($point1['lat'], $point1['long'], $point2['lat'], $point2['long'], '');
echo '<pre>';
print_r($distance);
echo '</pre>';