PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ init_guess()

static POINT3D init_guess ( const POINT3D points,
uint32_t  npoints 
)
static

Definition at line 119 of file lwgeom_median.c.

References POINT3D::x, POINT3D::y, and POINT3D::z.

Referenced by lwmpoint_median().

120 {
121  POINT3D guess = { 0, 0, 0 };
122  uint32_t i;
123  for (i = 0; i < npoints; i++)
124  {
125  guess.x += points[i].x / npoints;
126  guess.y += points[i].y / npoints;
127  guess.z += points[i].z / npoints;
128  }
129 
130  return guess;
131 }
double y
Definition: liblwgeom.h:340
double x
Definition: liblwgeom.h:340
double z
Definition: liblwgeom.h:340
unsigned int uint32_t
Definition: uthash.h:78
Here is the caller graph for this function: