Skip to content

Calculate the distance between 2 points on Earth's surface using Vincenty's formula.

License

Notifications You must be signed in to change notification settings

starboard-nz/vincenty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vincenty Go module

Calculate the distance between 2 points on Earth's surface using Vincenty's formula.

This is a Go re-implementation of the vincenty Python library.

Usage

package main

import (
        "fmt"
        "github.com/starboard-nz/vincenty"
)

func main() {
        Dunedin := vincenty.LatLng{Latitude: -45.8726082, Longitude: 170.3870355 }
        Alexandra := vincenty.LatLng{Latitude: -45.2426447, Longitude: 169.0977066 }

	dist := vincenty.Inverse(Dunedin, Alexandra)
	fmt.Printf("Distance: %vkm\n", dist.Kilometres())
}

References

About

Calculate the distance between 2 points on Earth's surface using Vincenty's formula.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages