haversine

package module
v0.0.0-...-bae20f0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2020 License: MIT Imports: 2 Imported by: 0

README

haversine

Calculates the Haversine distance between two Latitude and Longitude pairs, with support for the most common coordinate data types in Go.

Documentation

Index

Constants

View Source
const EarthRadius = 6371000.0

EarthRadius is the volumetric mean radius of the Earth in meters taken from https://nssdc.gsfc.nasa.gov/planetary/factsheet/earthfact.html

Variables

This section is empty.

Functions

func HaversineDistance

func HaversineDistance(pointA, pointB interface{}) float64

Distance finds the Haversine distance in meters between two points. It accepts the following types:

* google.golang.org/genproto/googleapis/type/latlng (*latlng.LatLng)

func HaversineFormula

func HaversineFormula(latA, longA, latB, longB float64) float64

HaversineFormula finds the Haversine distance (https://en.wikipedia.org/wiki/Haversine_formula) from the latitude and longitude pairs of A and B

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL