gcd

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 2 Imported by: 0

README

Greater Circle Distance Calculation

Description

4air needs a fast calculator module that multiple projects can use. The calculator will be used to calculate the distance between two points on the Earth's surface. The distance is calculated using the Great Circle Distance formula. The formula is as follows:

Haversine Formula
d = rcos-1[cos a cos b cos(x-y) + sin a sin b]
Vincenty Formula
a = sin²(Δφ/2) + cos φ1 ⋅ cos φ2 ⋅ sin²(Δλ/2)
c = 2 ⋅ atan2( √a, √(1−a) )
d = R ⋅ c

Version 0.2.0

Documentation

Index

Constants

View Source
const EARTH_RADIUS float64 = 6371

Variables

This section is empty.

Functions

func Haversine added in v0.2.0

func Haversine(lat1, long1, lat2, long2 float64) (float64, error)

func Vincenty added in v0.2.0

func Vincenty(lat1, long1, lat2, long2 float64) (float64, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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