Previous: weightpos, Up: imagefcts   [Contents]


12.4 wtvar

determine the unnormalized variance of objects’ distance from a given point

Synopsis

#include <suplib/imagefcts.h>

double wtvar(
  double x,
  void *objs,
  unsigned long n_obj,
  double tot_wt,
  size_t s_obj,
  double (*get_x)(const void *obj,double *x)
);

Parameters

double x

x coordinate of point from which to determine distance

void *objs

pointer to list of objects to process

unsigned long n_obj

number of objects in list

double tot_wt

if non-zero, indicates that objects are weighted

size_t s_obj

size of an object, in bytes

double (*get_x)(const void *obj,double *x)

pointer to function which returns the coordinates of an object as well as its weight

Description

wtvar determines the unnormalized variance (from zero) of objects’ distance from a given point. It requires a user supplied function which extracts an object’s position.

Returns

It returns the variance.