@@ -97,6 +97,8 @@ def loxodrome_inverse(
9797
9898 like Matlab distance('rh',...) and azimuth('rh',...)
9999
100+ If any of inputs lat1,lon1,lat2,lon2 are arrays, all must be arrays of same shape
101+
100102 Parameters
101103 ----------
102104
@@ -153,11 +155,11 @@ def loxodrome_inverse(
153155 dist = meridian_arc (lat2 , lat1 , deg = False , ell = ell ) / aux
154156
155157 # straight east or west
158+ i = aux < 1e-9
156159 try :
157- if (aux < 1e-9 ).any ():
158- dist [aux < 1e-9 ] = departure (lon2 , lon1 , lat1 , ell , deg = False )
160+ dist [i ] = departure (lon2 [i ], lon1 [i ], lat1 [i ], ell , deg = False )
159161 except (AttributeError , TypeError ):
160- if aux < 1e-9 :
162+ if i :
161163 dist = departure (lon2 , lon1 , lat1 , ell , deg = False )
162164
163165 if deg :
@@ -180,6 +182,8 @@ def loxodrome_direct(
180182 like Matlab reckon('rh', ...)
181183 except that "rng" in meters instead of "arclen" degrees of arc
182184
185+ If any of inputs lat,lon1,rng are arrays, all must be arrays of same shape
186+
183187 Parameters
184188 ----------
185189 lat1 : float
@@ -231,7 +235,7 @@ def loxodrome_direct(
231235 iso = geodetic2isometric (lat1 , ell , deg = False )
232236
233237 # stability near singularities
234- i = abs (cos (a12 )) < 1e-6
238+ i = abs (cos (a12 )) < 1e-9
235239 dlon = tan (a12 ) * (newiso - iso )
236240
237241 try :
0 commit comments