19 Dec
2004
19 Dec
'04
4:37 a.m.
I did some reading this afternoon[0], and I believe this is the correct algorithm for paths with straight edges (polygons):
Let S be a shape (path) with n points. Let x[i] and y[i] be the coordinates of the ith point. Let x[c] and y[c] be the coordinates of the centroid. (assign x[c] (quotient (sum x[0] x[1] ... x[n]) n)) (assign y[c] (quotient (sum y[0] y[1] ... y[n]) n))
[0] http://en.wikipedia.org/wiki/Center_of_mass
--
-trent
A monk asked Tozan when he was weighing some flax: `What is Buddha?'
Tozan said: `This flax weighs three pounds.'