Approximate implicitization of planar curves by piecewise rational approximation of the distance function