def distance_between(point1, point2, options = {})
      # convert to coordinate arrays
      point1 = extract_coordinates(point1)
      point2 = extract_coordinates(point2)

      # convert degrees to radians
      point1 = to_radians(point1)
      point2 = to_radians(point2)

      # compute deltas
      dlat = point2[0] - point1[0]
      dlon = point2[1] - point1[1]

      a = (Math.sin(dlat / 2))**2 + Math.cos(point1[0]) *
          (Math.sin(dlon / 2))**2 * Math.cos(point2[0])
      c = 2 * Math.atan2( Math.sqrt(a), Math.sqrt(1-a))
      c * earth_radius(options[:units])
    end
def distance_between(point1, point2, options = {})
      # convert to coordinate arrays
      point1 = extract_coordinates(point1)
      point2 = extract_coordinates(point2)

      # convert degrees to radians
      point1 = to_radians(point1)
      point2 = to_radians(point2)

      # compute deltas
      dlat = point2[0] - point1[0]
      dlon = point2[1] - point1[1]

      a = (Math.sin(dlat / 2))**2 + Math.cos(point1[0]) *
          (Math.sin(dlon / 2))**2 * Math.cos(point2[0])
      c = 2 * Math.atan2( Math.sqrt(a), Math.sqrt(1-a))
      c * earth_radius(options[:units])
    end
Distance between two points on Earth (Haversine formula).
 Takes two points and an options hash.
 The points are given in the same way that points are given to all
 Geocoder methods that accept points as arguments. They can be:

 * an array of coordinates ([lat,lon])
 * a geocodable address (string)
 * a geocoded object (one which implements a +to_coordinates+ method
   which returns a [lat,lon] array

 The options hash supports:

 * <tt>:units</tt> - <tt>:mi</tt> or <tt>:km</tt>
   Use Geocoder.configure(:units => ...) to configure default units.