The centroid coordinates are two thirds away from
the vertex and 1/3 away from the right angle.

Consider the right triangle shown in Figure 1. Along the hypotenuse, y =
a x.

The area of the triangle is

The x coordinate of the centroid, X, multiplied by the area is equal to
the integral of x multiplied by the area da. That is, it is the sum of the small areas da multiplied by
their x coordinate.