PostGIS 3.0.6dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ box2df_distance_leaf_centroid()

static double box2df_distance_leaf_centroid ( const BOX2DF *  a,
const BOX2DF *  b 
)
static

Calculate the centroid->centroid distance between the boxes.

Definition at line 375 of file gserialized_gist_2d.c.

376{
377 /* The centroid->centroid distance between the boxes */
378 double a_x = (a->xmax + a->xmin) / 2.0;
379 double a_y = (a->ymax + a->ymin) / 2.0;
380 double b_x = (b->xmax + b->xmin) / 2.0;
381 double b_y = (b->ymax + b->ymin) / 2.0;
382
383 /* This "distance" is only used for comparisons, */
384 return sqrt((a_x - b_x) * (a_x - b_x) + (a_y - b_y) * (a_y - b_y));
385}

Referenced by gserialized_distance_centroid_2d().

Here is the caller graph for this function: