A class of piecewise interpolating functions based on barycentric coordinates