Centroid of trapezoidal shape

The centroid of the trapezoidal with its one face perpendicular is given be

$$ X=-1/3* {(-2b^2-2*a*b+a^2)/(a+b)}$$

$$Y=1/3 *h* (b+2*a)/(a+b)$$

Where a, b, h and origin is as shown in the figure below.

Similarly, the centroid of any trapezoidal that does not have perpendicular face is given by

$$x= 1/3*(3a*b+3*b*c+b^2+6*a*c+3*a^2+2*c^2)/(b+2a+c)$$

$$y=1/3* h* (b+3*a+c)/(b+2*a+c)$$

Where a, b ,c, h and origin is as shown in the figure below.