On Tuesday, 20 September 2016 at 12:35:18 UTC, Basile B. wrote:
I've recently started an easing/interpolation family of function in my D user library. It's based on something I know well since I've already used them in 2012 in a VST plugin called GrainPlot (RIP).


However for one of the function, I can't manage to get the inverse.

A function that's fully implemented:
https://github.com/BBasile/iz/blob/master/import/iz/math.d#L598
- f(x,c) = x*x*x - x*x*c + x*c;
- c(f(0.5)) = 4 * (y - 0.125));

Another:
https://github.com/BBasile/iz/blob/master/import/iz/math.d#L749
- f(x,c) = pow(x, c);
- c(f(0.5)) = log(y) / log(0.5));

The problem is here:
https://github.com/BBasile/iz/blob/master/import/iz/math.d#L849
- f(x,c) = 1.0 - pow(1.0 - pow(x, 2.0/c), c * 0.5);
- c(f0.5)) = ?

Which means that I ask you if you can isolate c for

y = 1.0 - pow(1.0 - pow(0.5, 2.0/c), c * 0.5);

y is always f(0.5,c)

So if we rearrange and take the logs of both sides and divide by c we get

2*log(1-y)/c = log(1-2^(-2/c))

and then that we have one occurrence of c on each side do an iterative back substitution to find the intersection given that you know for y=0.5 ,c = 2. We used this method for finding voltages and currents in circuits with semiconductors.

Reply via email to