In the chart above, we call each line (in blue) a median of triangle.
The median is the line that starts with a vertex and goes in the opposite side
After you build the three medians, to the point where they cross (shown in red) is the centroid
Now, if you place a triangle on the coordinate system, you can easily get the barycenter in a simple calculation
Call the centroid C, the formula for the barycenter is:
[(1_x_+_x_2_+_x_3) / 3, (y1 + y2 + y3) / 3]
Find the centroid of triangle following with veetices (1,2), (3,4) and (5.0)
C = [(1_+_3_+_5) / 3, (2 + 4 + 0) / 3] = (9/3, 6/3) = (3.2)