Skip to content
This repository was archived by the owner on Jun 20, 2023. It is now read-only.

paultag/go-haversine

Folders and files

Image for: Folders and files
NameName
Last commit message
Last commit date

Latest commit

Image for: Latest commit
 

History

Image for: History
13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image for: Repository files navigation

This library is deprecated in favor of pault.ag/go/geo, which contains a strict superset of the functionality here.

haversine

This module uses the commonly used haversine formula for calculating small distances between two points.

Example

Image for: Example
package main

import (
	"fmt"
	"pault.ag/go/haversine"
)

func main() {
	whiteHouse := haversine.Point{Lat: 38.89768, Lon: -77.03653}
	eighteenAndF := haversine.Point{Lat: 38.89736, Lon: -77.04173}

	fmt.Printf("%f\n", float64(whiteHouse.MetresTo(eighteenAndF)))
	/* 451.41 Metres (float64) */
}

About

Image for: About

Haversine distance between two points

Resources

License

Stars

Watchers

Forks

Packages

Image for: Packages 0
No packages published

Contributors 3

Image for: Contributors 3
  •  
  •  
  •  

Languages

Image for: Languages