4

I need an exponential function that will take linear input from 0,0 to 1,1 and give me back an exponential shaped curve such that changes in X near the 0 point result in small increases in Y, but each step increases as X gets closer to 1.

Similar to the solid line in this graph:

GammaFunctionGraph

But I'd like to be able to control the curvature with a single value similar to how the gamma correction slider works, but making sure 0,0 and 1,1 are always on the curve.

Thanks!

  • 1
    But $(0,0)$ and $(1,1)$ already are always on the gamma correction curve $y=x^\gamma$. You want the function to involve $e^x$ instead of $x^\gamma$, is that it? –  Feb 08 '13 at 04:59
  • @ℝⁿ Correct, sorry if that wasn't clear. – user61442 Feb 08 '13 at 05:04

1 Answers1

6

A few options: $$\begin{align} y&=x^\gamma&\text{for}&\gamma\in[1,\infty),\\ y&=\frac{e^{kx}-1}{e^k-1}&\text{for}&k\in(0,\infty),\\ y&=\frac x{1+a(1-x)}&\text{for}&a\in[0,\infty). \end{align}$$ I guess you want the one in the middle.

We start with the usual function for exponential growth, $f(x)=e^{kx}$. We'll take $y$ to be to be an affine transformation of it, $y(x)=af(x)+b$, which is the simplest transformation that can fit two specified points. Imposing $y(0)=0$ and $y(1)=1$ gives us two equations which we can use to solve for $a$ and $b$, yielding (after some simplification) the above result.

(This is the general approach. The quick-and-dirty shortcut I actually took was to start with $e^{kx}$, subtract the value at $0$, divide by the value at $1$, and then plot it to make sure I didn't screw anything up.)

  • Perfect, thank you! If you don't mind, could you go into a little more detail on how you got there? – user61442 Feb 08 '13 at 06:08
  • I think the third example should have numerator $(1+a)x$, since as it stands, when $x=1$, the value is not 1. – Daryl Feb 08 '13 at 06:14
  • @Daryl: I think you are mistaken. $\left.\dfrac x{1+a(1-x)}\right|_{x=1}=\dfrac1{1+a(1-1)}=\dfrac1{1+0}=1$. –  Feb 08 '13 at 06:17
  • @user61442: See my edit. –  Feb 08 '13 at 06:22
  • You are right. My brain didn't work properly after a long day... My apologies. – Daryl Feb 08 '13 at 07:37