PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ calc_weighted_distances_3d()

static double calc_weighted_distances_3d ( const POINT3D curr,
const POINT4D points,
uint32_t  npoints,
double *  distances 
)
static

Definition at line 33 of file lwgeom_median.c.

34 {
35  uint32_t i;
36  double weight = 0.0;
37  for (i = 0; i < npoints; i++)
38  {
39  double dist = distance3d_pt_pt(curr, (POINT3D*)&points[i]);
40  distances[i] = dist / points[i].m;
41  weight += dist * points[i].m;
42  }
43 
44  return weight;
45 }
double distance3d_pt_pt(const POINT3D *p1, const POINT3D *p2)
Definition: measures3d.c:815
double m
Definition: liblwgeom.h:355
unsigned int uint32_t
Definition: uthash.h:78

References distance3d_pt_pt(), and POINT4D::m.

Referenced by iterate_4d().

Here is the call graph for this function:
Here is the caller graph for this function: