kdata_xmax,
kdata_ymax, — find maxima in
a data source
#include <cairo.h>
#include <kplot.h>
ssize_t
kdata_xmax(const struct kdata
*data, struct kpair *kp);
ssize_t
kdata_ymax(const struct kdata
*data, struct kpair *kp);
The kdata_xmax and
kdata_ymax functions find the maximum point in a
data source, filling in kp if it is not
NULL. The maximum point is the first maximum: thus,
if multiple minima exist of the same value, the first will be returned.
If the data source has zero entries,
kdata_xmax and kdata_ymax
return -1. Otherwise, they return the index of the maximum.