SilverShop\Geocoding\Extensions\AddressGeocoding::haversine_distance
Calculates the great-circle distance between two points, with the Haversine formula.
Signature
public function haversine_distance(float
$latitudeFrom,
float
$longitudeFrom,
float
$latitudeTo,
float
$longitudeTo,
[integer
$earthRadius = 6371000] )
Parameters
$latitudeFrom
—
float
- Latitude of start point in [deg decimal]
$longitudeFrom
—
float
- Longitude of start point in [deg decimal]
$latitudeTo
—
float
- Latitude of target point in [deg decimal]
$longitudeTo
—
float
- Longitude of target point in [deg decimal]
$earthRadius
—
integer
- Mean earth radius in [m]
Returns
- float
- Distance between points in [m] (same as earthRadius)