libpysal.cg.arcdist2linear

libpysal.cg.arcdist2linear(arc_dist, radius=6371.0)[source]

Convert an arc distance (spherical earth) to a linear distance (R3) in the unit sphere.

Parameters:
arc_distfloat

The arc distance to convert.

radiusfloat

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. Source: http://nssdc.gsfc.nasa.gov/planetary/factsheet/earthfact.html

Returns:
linear_distfloat

The linear distance conversion of arc_dist.

Examples

>>> pt0 = (0, 0)
>>> pt1 = (180, 0)
>>> d = arcdist(pt0, pt1, RADIUS_EARTH_MILES)
>>> d == math.pi * RADIUS_EARTH_MILES
True
>>> arcdist2linear(d, RADIUS_EARTH_MILES)
2.0