// lat/lon):
d[d>1.0] = 1.0
d[d<-1.0]=-1.0
return 180.0/np.pi*np.arccos(d)
def euclid3_to_great_circle(euclid3_distance):
Convert euclidean distance between points on a unit sphere to
After Change
c1 = np.cos(lat1)
s1 = np.sin(lat1)
c2 = np.cos(lat2)
s2 = np.sin(lat2)
cd = np.cos(dlon)
// This uses the arctan version of the great-circle distance function
// from en.wikipedia.org/wiki/Great-circle_distance for increased
// numerical stability.
// Formula can be obtained from [2] combining eqns. (14)-(16)
// for spherical geometry (f=0).
return 180.0/np.pi*np.arctan2(
np.sqrt((c2*np.sin(dlon))**2 +
(c1*s2-s1*c2*cd)**2),
s1*s2+c1*c2*cd)
def euclid3_to_great_circle(euclid3_distance):
Convert euclidean distance between points on a unit sphere to