I\'m wondering if there\'s a way to calculate the distance of two GPS coordinates without relying on Google Maps API.
My app may receive the coordinates in float or
You can use the geokit ruby gem. It does these calculations internally, but also supports resolving addresses via google and other services if you need it to.
require 'geokit'
current_location = Geokit::LatLng.new(37.79363,-122.396116)
destination = "37.786217,-122.41619"
current_location.distance_to(destination)
# Returns distance in miles: 1.211200074136264
You can also find out the bearing_to
(direction expressed as a float in degrees between 0-360) and midpoint_to
(returns an object you can run .latitude and .longitude methods on).