|
@@ -776,6 +776,11 @@ class ApiAction extends Action {
|
|
|
$lat2 = floatval($lat2) * $rad;
|
|
|
$lng2 = floatval($lng2) * $rad;
|
|
|
|
|
|
+ $lat1 = sprintf("%.8f", $lat1);
|
|
|
+ $lng1 = sprintf("%.8f", $lng1);
|
|
|
+ $lat2 = sprintf("%.8f", $lat2);
|
|
|
+ $lng2 = sprintf("%.8f", $lng2);
|
|
|
+
|
|
|
$theta = $lng2 - $lng1;
|
|
|
|
|
|
$dist = acos(sin($lat1) * sin($lat2) +
|
|
@@ -787,7 +792,8 @@ class ApiAction extends Action {
|
|
|
$dist += M_PI;
|
|
|
}
|
|
|
|
|
|
- return $dist = $dist * $radius;
|
|
|
+ $dist = $dist * $radius;
|
|
|
+ return sprintf('%.8f', $dist);
|
|
|
}
|
|
|
|
|
|
|