Calculate Centroid three-dimensional planar polygon

This seems like a question here .

Given a list of three-dimensional coordinates defining surface ( Point3D1, Point3D2, Point3D3etc.), how to calculate the surface center of gravity?

In 2D, the calculation is given by the following formula :

alt text

alt text

alt text

What about the 3D counterpart?

+5
source share
3 answers

If it is a flat surface, you can convert it to a coordinate system local to the plane, calculate the centroid using the formulas that you presented, and then convert it back to get your coordinates in three-dimensional space.

+2

, , z y.

, x-y, - x-z. , x, y z, .

: (x1, y1, z1), (x2, y2, z2),..., xy, (Cx, Cy), , (x1, y1), (x2, y2),... xz (Cx, Cz) (x1, z1), (x2, z2),.... - 2D-, z y . 3D- (Cx, Cy, Cz). , x-y, x-z y-z ( ).

+5

v 0, v 1,..., v N , v i= (x i, y i, z i).

(v 0, v 1, v 2), (v 0, v 2, v 3),..., (v 0, v i, v +1),..., (v 0, v N-1, v N) N-1 .

| (v i & minus; v 0) & times; (v + 1 & minus; v 0) | &; 2, & times; | & ; | .

, . (v i & minus; v 0) & times; (v + 1 & minus; v 0) & middot; (v 1 & minus; v 0) & times; (v 2 & minus; v 0). , .

2D- , (, z), , (v i & minus; v 0) & times; (v + 1 & minus; v 0) & middot; z . , .

(v 0 + v i + v + 1) & divide; 3.

, , ,

                1       N-1
centroid = ——————————    ∑  ( centroid-of-triangle-i × area-of-triangle-i )
           total-area   i=1

(For sizes ≥ 4D, the area should be calculated using A i =? Frac12; | v i & minus; v 0 | | v i + 1 ? Min 0 v sin | theta; i , where cos? Theta; i = (v i & minus; v 0 )? (v i + 1 & minus; v 0 ).)

+4
source

All Articles