Triangle

BlitzPlus Forums/BlitzPlus Programming/Triangle

Oh okay thanks. :)

So following on from that... in Andre Lamothe's book it says you can find the centre of mass of a polygon by attaching a weight to each vertex, multiplying the coordinates of each vertex by its weight, adding all the results together then dividing the final result by the number of vertices... (erm... I think that was it)

But it doesn't explain how you find the correct weight for each vertex. Help??!

EDIT: I suppose I could divide the polygon into triangles first, then find the centre of mass for each of those and average them out. But again I'm not sure if that's right, or if it's the fastest way to do it. :(