[R] Center of Closed Contour

white.denis@epamail.epa.gov white.denis at epamail.epa.gov
Wed Mar 19 20:19:23 CET 2003


Although I had versions of the 2-D polygon centroid algorithm written in
C and Fortran years ago, I can't find them today.  The formula can be
found at http://astronomy.swin.edu.au/~pbourke/geometry/polyarea/.
Functions for calculating polygon area in R package "splancs" (function
areapl) or in R package "tripack" (function voronoi.area), might be
adaptable.

> I am searching for a utility in R which will determine the mean
location of
> a closed contour and eventually record the location in an ASCII file.
By
> means of the contour utility in R, I am able to produce an image of a
contour,
> but I am seeking a procedure which will produce the coordinates of the
> center of mass of the contour. From my actual set of data, the contour
> utility will produce several hundered closed non-intersecting and
> non-concentric contours like a lattice of disks. I want the location
of
> those disks via a program. Is there any package in R which will lend
> itself to this problem?



More information about the R-help mailing list