https://github.com/iwpnd/qhav
quick haversine distance in the terminal
https://github.com/iwpnd/qhav
Last synced: 7 months ago
JSON representation
quick haversine distance in the terminal
- Host: GitHub
- URL: https://github.com/iwpnd/qhav
- Owner: iwpnd
- License: mit
- Created: 2022-10-01T12:19:44.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-11-12T19:09:05.000Z (11 months ago)
- Last Synced: 2025-03-15T15:39:41.492Z (7 months ago)
- Language: Go
- Size: 16.6 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# qhav - quick haversine
quick haversine distance between to points
## Installation
### cli
```
go install github.com/iwpnd/qhav/cmd/qhav@latest
```### package
```
go get -u github.com/iwpnd/qhav
```## Usage
```bash
➜ qhav --from 13.37,52.25 --to 13.37,52.26 --unit m
>> 1111.9508023352598 m➜ qhav --help
NAME:
qhav - calculate the haversine distance in a given unit between to two pointsUSAGE:
qhav [global options] command [command options] [arguments...]COMMANDS:
help, h Shows a list of commands or help for one commandGLOBAL OPTIONS:
--from value [ --from value ] from point. --from 0.5,0.5
--help, -h show help (default: false)
--to value [ --to value ] to point. --to 0.0,0.0
--unit value distance unit (m, km, miles). (default: "km")
``````go
package mainimport (
"fmt""github.com/iwpnd/qhav"
)func main() {
p1 := []float64{0.0,0.0}
p2 := []float64{0.5,0.5}distance := qhav.Haversine(p1, p2, qhav.InKilometers())
fmt.Println(distance)
}>> 78.63
```## License
MIT
## Acknowledgement
## Maintainer
Benjamin Ramser - [@iwpnd](https://github.com/iwpnd)
Project Link: [https://github.com/iwpnd/qhav](https://github.com/iwpnd/qhav)