I'm looking for a way to find the centre point of a regular polygon, provided if we have the coordinates of all the vertices. searching, I have found this (Why doesn't a simple mean give the position of a centroid in a polygon?) but it discusses the two-dimensional case only. Can anyone suggest a method to find the centre of a (planar) polygon in 3D?
we will have all the vertices as follows,
p1 = [x1, y1, z1 ]
p2 = [x2. y2, z2 ]
...
pn = [xn , yn, zn ]
N.B : I'm particularly interested in the cases of hexagons and pentagons, so for the moment I don't need a general formula. Anything that works for a hexagon and pentagon is enough.