PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ distance_ellipse()

double distance_ellipse ( double  lat1,
double  long1,
double  lat2,
double  long2,
SPHEROID sphere 
)

Definition at line 206 of file lwgeom_spheroid.c.

208 {
209  double result = 0;
210 #if POSTGIS_DEBUG_LEVEL >= 4
211  double result2 = 0;
212 #endif
213 
214  if ( (lat1==lat2) && (long1 == long2) )
215  {
216  return 0.0; /* same point, therefore zero distance */
217  }
218 
219  result = distance_ellipse_calculation(lat1,long1,lat2,long2,sphere);
220 
221 #if POSTGIS_DEBUG_LEVEL >= 4
222  result2 = distance_sphere_method(lat1, long1,lat2,long2, sphere);
223 
224  POSTGIS_DEBUGF(4, "delta = %lf, skae says: %.15lf,2 circle says: %.15lf",
225  (result2-result),result,result2);
226  POSTGIS_DEBUGF(4, "2 circle says: %.15lf",result2);
227 #endif
228 
229  if (result != result) /* NaN check
230  * (x==x for all x except NaN by IEEE definition)
231  */
232  {
233  result = distance_sphere_method(lat1, long1,
234  lat2,long2, sphere);
235  }
236 
237  return result;
238 }
double distance_ellipse_calculation(double lat1, double long1, double lat2, double long2, SPHEROID *sphere)
double distance_sphere_method(double lat1, double long1, double lat2, double long2, SPHEROID *sphere)

References distance_ellipse_calculation(), and distance_sphere_method().

Here is the call graph for this function: