Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/geocrystal/geo_bearing
Calculates initial and final bearings between two points using great-circle distance formulas
https://github.com/geocrystal/geo_bearing
bearing-calculations crystal geo
Last synced: 22 days ago
JSON representation
Calculates initial and final bearings between two points using great-circle distance formulas
- Host: GitHub
- URL: https://github.com/geocrystal/geo_bearing
- Owner: geocrystal
- License: mit
- Created: 2024-03-29T10:48:02.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-10-21T15:25:18.000Z (25 days ago)
- Last Synced: 2024-10-22T02:15:05.028Z (24 days ago)
- Topics: bearing-calculations, crystal, geo
- Language: Crystal
- Homepage:
- Size: 849 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# geo_bearing
[![Crystal CI](https://github.com/geocrystal/geo_bearing/actions/workflows/crystal.yml/badge.svg)](https://github.com/geocrystal/geo_bearing/actions/workflows/crystal.yml)
[![GitHub release](https://img.shields.io/github/release/geocrystal/geo_bearing.svg)](https://github.com/geocrystal/geo_bearing/releases)
[![License](https://img.shields.io/github/license/geocrystal/geo_bearing.svg)](https://github.com/geocrystal/geo_bearing/blob/main/LICENSE)Crystal implementation of calculating initial and final bearings between two points using great-circle distance formulas.
## Installation
1. Add the dependency to your `shard.yml`:
```yaml
dependencies:
geo_bearing:
github: geocrystal/geo_bearing
```2. Run `shards install`
## Usage
```crystal
require "geo_bearing"lat1, lng1 = {48.8566, 2.3522} # Paris
lat2, lng2 = {40.7128, -74.0060} # New YorkGeo::Bearing.bearing(lat1, lng1, lat2, lng2)
# => 291.7938627483058Geo::Bearing.bearing(lat1, lng1, lat2, lng2, true)
# => 233.70448129781204
```![convex hull](/assets/readme_image.png)
## Contributing
1. Fork it ()
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request## Contributors
- [Anton Maminov](https://github.com/mamantoha) - creator and maintainer