def _normalize_scale(t, a=0, b=1):
    """Perfoms an afine translation to normalize an interval.

    Args:
        t (numpy.ndarray): Array of dim 1 or 2 with at least 2 values.
        a (float): Starting point of the new interval. Defaults 0.
        b (float): Stopping point of the new interval. Defaults 1.

    Returns:
        (numpy.ndarray): Array with the transformed interval.
    """

    t = t.T  # Broadcast to normalize multiple arrays
    t1 = (t - t[0]).astype(float)  # Translation to [0, t[-1] - t[0]]
    t1 *= (b - a) / (t[-1] - t[0])  # Scale to [0, b-a]
    t1 += a  # Translation to [a, b]
    t1[0] = a  # Fix possible round errors
    t1[-1] = b

    return t1.T