lat1 = np.array(lat1)*np.pi/180.0
lat2 = np.array(lat2)*np.pi/180.0
d = np.cos((lon1-lon2)*np.pi/180.0)*np.cos(lat1)*np.cos(lat2) \
+ np.sin(lat1)*np.sin(lat2)
// Angle is arccos of euclidean dot product. Avoid errors caused
// by numerics (possibly d>1.0 or d<-1.0, resulting in NAN. This
// can, however, only be caused by numerical errors for real
// 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