libpysal.cg.geointerpolate

libpysal.cg.geointerpolate(p0, p1, t, lonx=True)[source]

Finds a point on a sphere along the great circle distance between two points on a sphere also known as a way point in great circle navigation.

Parameters:
p0tuple

The first point decimal degrees.

p1tuple

The second point decimal degrees.

tfloat

The proportion along great circle distance between p0 and p1 (e.g., \(\mathtt{t}=0.5\) would find the mid-point).

lonxbool

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

Returns:
newpx, newpytuple

The new point in decimal degrees of (lon-lat) by default or (lat-lon) if lonx is set to False.

Examples

>>> p0 = (-87.893517, 41.981417)
>>> p1 = (-87.519295, 41.657498)
>>> geointerpolate(p0, p1, 0.1)             # using lon-lat
(-87.85592403438788, 41.949079912574796)
>>> p3 = (41.981417, -87.893517)
>>> p4 = (41.657498, -87.519295)
>>> geointerpolate(p3, p4, 0.1, lonx=False) # using lat-lon
(41.949079912574796, -87.85592403438788)