Skip to content

Commit

Permalink
better comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Aug 26, 2018
1 parent eb67722 commit ca3320e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pymap3d/vincenty.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ def track2(lat1: float, lon1: float, lat2: float, lon2: float,
gcarclen = 2. * np.arcsin(np.sqrt((np.sin((rlat1 - rlat2) / 2))**2 +
np.cos(rlat1) * np.cos(rlat2) * (np.sin((rlon1 - rlon2) / 2))**2))
# check to see if points are antipodal (if so, route is undefined).
if np.isclose(gcarclen, pi).any():
if np.allclose(gcarclen, pi):
raise ValueError('cannot compute intermediate points on a great circle whose endpoints are antipodal')

distance, azimuth, _ = vdist(lat1, lon1, lat2, lon2)
Expand Down

0 comments on commit ca3320e

Please sign in to comment.