def trapezoidchar(aa,bb,cc,hh):
    """
    Calculate area and centroid of trapezoid
    """
    A = hh*(aa + bb)/2.
    xc = (2.*aa*cc + aa**2. + cc*bb + aa*bb + bb**2.)/3./(aa + bb)
    yc = hh*(2.*aa + bb)/3./(aa + bb)
    return A,xc,yc