Computing the centroid of some $n$ points in 3-dimensions

centroideuclidean-geometrygeometry

Solving for the centroid of some set of points in 2-dimensions is trivial. I'd like, however, to determine the centroid in 3-dimensions, given an arbitrary set of $n$ points. How can this most easily be done?

Offhand, it seems that this should require some sort of integral. I'm not sure though.

Note that I speak of the centroid which minimizes the sum of the
squared distances.

Best Answer

Just as the squared distance between two points in 2D space is of the form $x^2+y^2$, so is the squared distance between two points in $n$-D space of the form $x_1^2+x_2^2+\cdots+x_n^2$. Thus the centroid in any dimension of Euclidean space can be computed in exactly the same way as the two-dimensional centroid – average per-coordinate.

Related Question