def tri_cent(p, q, r):
    """Compute the centre coordinates for a 2d triangle given the x,y coordinates 
    of the vertices.
            
    Parameters
    ----------
    p : tuple,list,np array
        Coordinates of triangle vertices in the form (x,y).
    q : tuple,list,np array
        Coordinates of triangle vertices in the form (x,y).
    r : tuple,list,np array
        Coordinates of triangle vertices in the form (x,y).
            
    Returns
    ----------
    coordinates : tuple
        In the format (x,y).    
    """
    Xm = (p[0] + q[0]) / 2
    Ym = (p[1] + q[1]) / 2
    k = 2 / 3
    Xc = r[0] + k * (Xm - r[0])
    Yc = r[1] + k * (Ym - r[1])
    return Xc, Yc
