Centroid of contiguous polygons

115 Views Asked by At

Say that I know which are the centroids of two polygons. These polygons share a number of edges (they belong to a planar subdivision). I want to compute the union of the two polygons and also to know the centroid of the new polygon which covers the other two. I know I could recompute the centroid taking the points of the new polygon. But, is there a way to obtain the centroid by knowing the other centroids, without the need for recomputing everything from scratch?

Thank you!

1

There are 1 best solutions below

0
On BEST ANSWER

If, when you computed the centroids, you also computed the polygon areas, then the answer is yes. The new centroid is $$ c_\text{new} = \frac{A_1}{A_1+ A_2} c_1 + \frac{A_2}{A_1+ A_2} c_2, $$ where the $A_i$ are the areas and the $c_i$ are the centroid points.

By the way, you can also compute the new area with the update rule $$ A_\text{new} = A_1 + A_2. $$

I know that's silly, but if you're hoping to proceed inductively, it's actually pretty useful.

By the way, the two polygons under consideration need not be adjacent. On the other hand, they must not overlap, unless you're willing to consider the overlap area as counted twice.