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

80.77% Correct | 19.23% Incorrect
Last solution submitted on Jun 25, 2019

Problem Comments