PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ distance_ellipse()

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

Definition at line 207 of file lwgeom_spheroid.c.

References distance_ellipse_calculation(), and distance_sphere_method().

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