Putting the FUN in Functions

Problem: We're given two datapoints and we want to interpolate a function
between them. The interpolated function could be linear or exponential or
hyperbolic or anything in between and there should be a single parameter, h, 
for picking the shape.

(Side note: You can't control the steepness with a function of the form
y=a*b^(c*x) because any functions of that form that go through two given 
points are all the same function -- plain old exponential growth.)

Exponential growth looks like this, with growth rate r:

exp(r*x)

Which is the same as the following in the limit as h ⟶ 0:

leh(h, r, x) := (1-h*r*x)^(-1/h)

So that's what we can use to generalize from an exponential function.

Here are some special cases:

h = -1  →  linear
h =  0  →  exponential
h =  1  →  hyperbolic

Bigger values of h make the leh() function grow super steeply. Values less 
than -1 make it grow sub-linearly -- starting steep and flattening out.

So now it just remains to find the growth rate r that makes leh(h, r, x)
hit the two given points. Actually what we do is shift it and scale it 
so that it hits the first point, (x1, y1), and then we solve for the r
that makes it hit the second point, (x2, y2). Before shifting and scaling, 
leh() is 1 at x=0 so we shift forward by x1 and scale up by y1:

f(h, x) := y1 * leh(h,r,x-x1)

The function f() will now go through the given points (x1,y1) and (x2,y2) as 
long as we solve for r like so:

y1*leh(h,r,x2-x1) == y2

That gives, pretty directly, r = ((y2/y1)^-h-1)/h/(x1-x2).

So plug that r back into the formula for f(h, x) and we have our function!

If we want to avoid the division by zero we still need a special case for h=0
which is just r = log(y2/y1)/(x2-x1) and leh(0, r, x) = y1*exp(r*x).

Or just set h=0.0001 above and it will be the same for all practical purposes.

Below is a plot of the function and you can play with the parameters in real
time by editing this in Glitch and watching the live preview since Glitch
literally redeploys on every keystroke and is the most fun thing ever, so 
much so that I made this whole page just for the excuse to play with it. :)

PS: This can all be made a bit more understandable by shifting and flipping 
that parameter h by 1 so that it represents concavity. Concavity 0 means 
linear. The more negative the parameter the more convex (-1 being an 
exponential function). And the more positive the parameter the more concave.