Search code examples
c#mathcomputational-geometry

Compute the centroid of a 3D planar polygon


This is a similar question to this one here.

Given a list of 3D coordinates that define the surface( Point3D1, Point3D2, Point3D3, and so on), how to calculate the centroid of the surface?

In 2D the computation is given by the following formula:

alt text

alt text

alt text

What about the 3D analogue?


Solution

  • If it's a planar surface, you can transform to a coordinate system local to the plane, calculate the centroid using the formulas you presented, and then transform back to get its coordinates in 3D space.