PostGIS  2.2.7dev-r@@SVN_REVISION@@
double distance_ellipse ( double  lat1,
double  long1,
double  lat2,
double  long2,
SPHEROID sphere 
)

Definition at line 194 of file lwgeom_spheroid.c.

References distance_ellipse_calculation(), and distance_sphere_method().

196 {
197  double result = 0;
198 #if POSTGIS_DEBUG_LEVEL >= 4
199  double result2 = 0;
200 #endif
201 
202  if ( (lat1==lat2) && (long1 == long2) )
203  {
204  return 0.0; /* same point, therefore zero distance */
205  }
206 
207  result = distance_ellipse_calculation(lat1,long1,lat2,long2,sphere);
208 
209 #if POSTGIS_DEBUG_LEVEL >= 4
210  result2 = distance_sphere_method(lat1, long1,lat2,long2, sphere);
211 
212  POSTGIS_DEBUGF(4, "delta = %lf, skae says: %.15lf,2 circle says: %.15lf",
213  (result2-result),result,result2);
214  POSTGIS_DEBUGF(4, "2 circle says: %.15lf",result2);
215 #endif
216 
217  if (result != result) /* NaN check
218  * (x==x for all x except NaN by IEEE definition)
219  */
220  {
221  result = distance_sphere_method(lat1, long1,
222  lat2,long2, sphere);
223  }
224 
225  return result;
226 }
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: