[GRASS-user] Geographic Mean

Hamish hamish_nospam at yahoo.com
Wed May 24 03:10:00 EDT 2006


> > Is the centroid of the hull equivalent to the centre of gravity of
> > all the points or is it the area centroid of the hull?  Are these
> > the same?
> 
> To my (admitably limited) understanding the definition of centroid is 
> that it lies in the centre of gravity of an area. If I'm wrong, please
> correct me.


I would not make that assumption. e.g., where to put the centroid in a
2D toroid?


see Vect_get_point_in_area() in lib/vector/Vlib/poly.c

/*!
 \fn int Vect_get_point_in_area ( struct Map_info *Map, int area, double
*X, double *Y)
 \brief get point inside area and outside all islands
        Take a line and intersect it with the polygon and any islands.
        sort the list of X values from these intersections.  This will
        be a list of segments alternating  IN/OUT/IN/OUT of the polygon.
        Pick the largest IN segment and take the midpoint. 
 \return 0 on success, -1 on error
 \param Map_info structure, area number, x, y
*/


Then look in Vect_get_point_in_poly_isl()   (same file)



Hamish




More information about the grass-user mailing list