geo_bearing v0.1.0
geo_bearing
Crystal implementation of calculating initial and final bearings between two points using great-circle distance formulas.
Installation
-
Add the dependency to your
shard.yml
:dependencies: geo_bearing: github: geocrystal/geo_bearing
-
Run
shards install
Usage
require "geo_bearing"
lat1, lng1 = {48.8566, 2.3522} # Paris
lat2, lng2 = {40.7128, -74.0060} # New York
Geo::Bearing.bearing(lat1, lng1, lat2, lng2)
# => 291.7938627483058
Geo::Bearing.bearing(lat1, lng1, lat2, lng2, true)
# => 233.70448129781204
https://www.movable-type.co.uk/scripts/latlong.html
Contributing
- Fork it (https://github.com/geocrystal/geo_bearing/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- Anton Maminov - creator and maintainer
Repository
geo_bearing
Owner
Statistic
- 2
- 0
- 0
- 1
- 0
- about 1 month ago
- March 29, 2024
License
MIT License
Links
Synced at
Thu, 21 Nov 2024 02:12:13 GMT
Languages