First Move Point D to (0,1)[br][br]The centroid or geometric center of a plane figure is the arithmetic mean position of all the points in the figure. (https://en.wikipedia.org/wiki/Centroid)[br][br]If the area was a thin plate parallel to the earth surface, the centroid would be at the center of gravity. The center of gravity is the point where a shape would balance. The formula for the centroid can be expressed as a ratio of integrals, [math]\overline{X}=\frac{\int x\cdot dA}{\int dA}[/math] and [math]\overline{Y}=\frac{\int y\cdot dA}{\int dA}[/math] where [math]\left(\overline{X},\overline{Y}\right)[/math] is the centroid point and the integrals are over the area divided into differential area elements [math]dA[/math]. Tables of centroids of common shapes can be used. Because of the additive property of integrals, the centroid of the combination of several basic shapes can be calculated as [math]\overline{X}=\frac{\sum\overline{x_i}\cdot A_i}{\sum A_i}[/math] and [math]\overline{Y}=\frac{\sum\overline{y_i}\cdot A_i}{\sum A_i}[/math] where [math]\left(\overline{x_i},\overline{y_i}\right)[/math]is the centroid of each basic shape and [math]A_i[/math] is the area of each corresponding shape. Shapes can also be subtracted by using a negative area.[br][br]The best way to do these calculations is with a table or spreadsheet. Here a spreadsheet is used to calculate the centroid of two rectangles. The centroid of a rectangle is in its center. The sum (total) of the table columns of [math]Area[/math], [math]\overline{x}\cdot Area[/math] and [math]\overline{y}\cdot Area[/math] are respectively the terms [math]\sum A_i[/math], [math]\sum\overline{x_i}\cdot A_i[/math], and [math]\sum\overline{y_i}\cdot A_i[/math] in the formula above for [math]\overline{X}[/math] and [math]\overline{Y}[/math] .[br]
This applet computes the centroid of two rectangles using a spreadsheet as described above. The two rectangles are defined by the points A and B for Area 1 and C and D for area 2. If area 2 overlaps area 1 it is converted into a negative area of the intersection of the rectangles. This way more interesting combined shapes can be formed. The centroids of each area are shown as pluses, + and the combined centroid is shown as a cross, x.
Move the points around and note how the centroids change. Note that the combined centroid is closer to the larger areas centroid.[br]Compare the centroids made by combining the rectangles with points A=(-3,1), B=(-1,4),C=(-1,1) and D=(0,2) with the centroids made by subtracting rectangles with points A=(-3,1),B=(0,4), C=(-1,2) and D=(0,4).