Info: https://en.wikipedia.org/wiki/Centroid
Example
Input:
x = [0 0 1]; % x-coordinate y = [0 1 0]; % y-coordinate
Output:
x_centroid = 0.33333; y_centroid = 0.33333;
Is this triangle 2D or 3D, because input parametrs are only x and y arrays?
The only issue I have with this problem is that it assumes the input points actually form a triangle. One example where this does not hold is three collinear points.
2531 Solvers
Cell Counting: How Many Draws?
255 Solvers
279 Solvers
206 Solvers
91 Solvers