Skip to content

Commit

Permalink
CS
Browse files Browse the repository at this point in the history
  • Loading branch information
stanislav-janu committed May 16, 2024
1 parent 0b1328d commit 24297a5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/GpsPoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,10 @@ public function distanceTo(self $point, string $google_api_key = null): float
}

/**
* @author Jakub Vrána
* Author Jakub Vrána
* @link https://php.vrana.cz/vzdalenost-dvou-zemepisnych-bodu.php
*/
return
acos(cos(deg2rad($this->lat)) * cos(deg2rad($this->lng)) * cos(deg2rad($point->lat)) * cos(deg2rad($point->lng)) + cos(deg2rad($this->lat)) * sin(deg2rad($this->lng)) * cos(deg2rad($point->lat)) * sin(deg2rad($point->lng)) + sin(deg2rad($this->lat)) * sin(deg2rad($point->lat)))
return acos(cos(deg2rad($this->lat)) * cos(deg2rad($this->lng)) * cos(deg2rad($point->lat)) * cos(deg2rad($point->lng)) + cos(deg2rad($this->lat)) * sin(deg2rad($this->lng)) * cos(deg2rad($point->lat)) * sin(deg2rad($point->lng)) + sin(deg2rad($this->lat)) * sin(deg2rad($point->lat)))
* 6372.795 // Great circle radius
* 1000; // km to m
}
Expand Down

0 comments on commit 24297a5

Please sign in to comment.