Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/michaelwp/go-distance
Ini adalah package bahasa pemrograman go sederhana untuk menghitung jarak antara dua titik latitude dan longitude.
https://github.com/michaelwp/go-distance
distance geolocation go latitute longitude module
Last synced: 6 days ago
JSON representation
Ini adalah package bahasa pemrograman go sederhana untuk menghitung jarak antara dua titik latitude dan longitude.
- Host: GitHub
- URL: https://github.com/michaelwp/go-distance
- Owner: michaelwp
- License: mit
- Created: 2021-04-15T07:30:30.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-04-19T07:27:35.000Z (almost 4 years ago)
- Last Synced: 2024-06-20T22:38:12.445Z (8 months ago)
- Topics: distance, geolocation, go, latitute, longitude, module
- Language: Go
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-distance v1.2.1
Ini adalah package bahasa pemrograman go sederhana untuk menghitung jarak antara dua titik latitude dan longitude.
### func Count()
```go
func (l LatLon) Count() Miles
```
### func ToKilometre()
```go
func (m Miles) ToKilometre() Kilometre
```
### func ToMiles()
```go
func (k Kilometre) ToMiles() Miles
```### Instalasi
`go get -u github.com/michaelwp/go-distance`### Contoh penggunaan
```go
package mainimport (
"fmt"
go_distance "github.com/michaelwp/go-distance"
)func main() {
var LatLon = go_distance.LatLon{
LatStart: -6.2973856,
LonStart: 106.6388177,
LatEnd: -6.3027637,
LonEnd: 106.6410986,
}fmt.Println(LatLon.Count(), "mil")
fmt.Println(LatLon.Count().ToKilometre(), "km")
}
```
#### Hasil
```text
0.5238991320272929 mil
0.8431339247333317 km
```