libpysal.cg.arcdist¶
-
libpysal.cg.arcdist(pt0, pt1, radius=6371.0)[source]¶ Arc distance between two points on a sphere.
- Parameters
- pt0
point assumed to be in form (lng,lat)
- pt1
point assumed to be in form (lng,lat)
- radius
radiusofthesphere defaults to Earth’s radius
Source: http://nssdc.gsfc.nasa.gov/planetary/factsheet/earthfact.html
- pt0
- Returns
Thearcdistancebetweenpt0andpt1usingsuppliedradius
Examples
>>> pt0 = (0,0) >>> pt1 = (180,0) >>> d = arcdist(pt0,pt1,RADIUS_EARTH_MILES) >>> d == math.pi*RADIUS_EARTH_MILES True