Cody

Problem 43640. Calculate the centroid of a triangle

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;

Solution Stats

73.37% Correct | 26.63% Incorrect
Last Solution submitted on Nov 17, 2019

Problem Comments