module Haversine

Overview

The haversine formula determines the great-circle distance between two points on a sphere given their latitudes and longitudes.

https://en.wikipedia.org/wiki/Haversine_formula

Extended Modules

Defined in:

haversine.cr
haversine/distance.cr
haversine/version.cr

Constant Summary

RAD_PER_DEG = Math::PI / 180
VERSION = "0.2.0"

Instance Method Summary

Instance Method Detail

def distance(lat1 : Number, lon1 : Number, lat2 : Number, lon2 : Number) : Haversine::Distance #

Calculates the haversine distance between two locations using latitude and longitude.


[View source]
def distance(coord1 : Array(Number), coord2 : Array(Number)) : Haversine::Distance #

Calculates the haversine distance between two locations using latitude and longitude.


[View source]