Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mamantoha committed Aug 3, 2022
1 parent 6d25a1e commit d084817
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ require "haversine"

Calling `Haversine.distance` with four latitude/longitude coordinates returns a `Haversine::Distance` object which can provide output in kilometers, meters, miles, feet, or nautical miles.

Each "coordinates" member **must** be a pair of coordinates - `latitude` and `longitude`.

`Haversine.distance` accepts of either:

- `Haversine.distance(lat1, lon1, lat2, lon2)`
- `Haversine.distance({lat1, lon1}, {lat2, lon2})`
- `Haversine.distance([lat1, lon1], [lat2, lon2])`

```crystal
# Tokyo -> Paris
distance = Haversine.distance(35.61488, 139.5813, 48.85341, 2.3488)
Expand Down

0 comments on commit d084817

Please sign in to comment.