Skip to content

Commit cb31a21

Browse files
committed
Change distance calculation docs
1 parent a88a0a5 commit cb31a21

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,12 @@ $latitude = $latLng->lat;
4848
$longitude = $latLng->long;
4949
```
5050

51-
You can also calculate the distance between two `LatLong` objects by using the `distanceTo` method.
51+
You can also calculate the distance between two `LatLong` objects by using the `distanceTo` method. The
52+
distance is returned in kilometers, and takes into account the curvature of the Earth using the Haversine
53+
formula.
5254

5355
```php
54-
$kilometresDistance = $homeCoords->distanceTo($toCoords);
56+
$distance = $fromCoords->distanceTo($toCoords);
5557
```
5658

5759

0 commit comments

Comments
 (0)