PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ lwkmeans_pt_distance()

static double lwkmeans_pt_distance ( const Pointer  a,
const Pointer  b 
)
static

Definition at line 8 of file lwkmeans.c.

References POINT2D::x, and POINT2D::y.

Referenced by lwgeom_cluster_2d_kmeans(), and lwkmeans_pt_closest().

9 {
10  POINT2D *pa = (POINT2D*)a;
11  POINT2D *pb = (POINT2D*)b;
12 
13  double dx = (pa->x - pb->x);
14  double dy = (pa->y - pb->y);
15 
16  return dx*dx + dy*dy;
17 }
double x
Definition: liblwgeom.h:328
double y
Definition: liblwgeom.h:328
Here is the caller graph for this function: