def reverse_spline(tck):
    """Reverse the direction of a spline (parametric or nonparametric),
    without changing the range of the t (parametric) or x (nonparametric) values."""
    t, c, k = tck
    rt = t[-1] - t[::-1]
    rc = c[::-1]
    return rt, rc, k