# libpysal.cg.harcdist

libpysal.cg.harcdist(p0, p1, lonx=True, radius=6371.0)

  Alternative the arc distance function, uses the haversine formula.

  Parameters:
    p0 `python:tuple`

      The first point decimal degrees.

    p1 `python:tuple`

      The second point decimal degrees.

    lonx bool

      The method to assess the order of the coordinates. `True` for (lon,lat); `False` for (lat,lon). Default is `True`.

    radius `python:float`

      The radius of a sphere. Default is Earth’s radius in kilometers, `RADIUS_EARTH_KM` (`6371.0`). Earth’s radius in miles, `RADIUS_EARTH_MILES` (`3958.76`) is also an option. Set to `None` for radians. Source: http://nssdc.gsfc.nasa.gov/planetary/factsheet/earthfact.html

  Returns:
    harc_dist `harc_dist`

      The distance in units specified, km, miles or radians.

  Notes

  Uses the `radangle` function to compute radian angle.

  Examples

      >>> p0 = (-87.893517, 41.981417)
      >>> p1 = (-87.519295, 41.657498)
      >>> harcdist(p0, p1)
      47.52873002976876

      >>> harcdist(p0, p1, radius=None)
      0.007460167953189258