Smooth function interpolating between two points.

functionsinterpolation

How would I find a parametric function that smoothly interpolates between two points $(0, 1)$ and $(N, 0)$, where the parameter $t \in [-1, 1]$ can be used to change the gradient. Somewhat like this.

function

I know that the functions below the straight line between the points follow some exponential decay, whereas those above follow the form $f(x) = -\tanh(k(x-N))$. I thought just adding these two functions together and providing an additional parameter $\lambda$ for the weighting of these two terms would work, but it leads to additional bumps.

Best Answer

Pick some positive real $k$. $$f(x, N, t)=\left(1-\frac xN\right)^{\exp(-kt)}$$ should be a function that gives you your desired behavior.