D and math, can you isolate this ?

Basile B. via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Sep 20 06:44:35 PDT 2016


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.
> [...]
> 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)

If you don't understand, these function have a control point, for 
"parabol" and "pow" it's easy to get the c Coefficient that 
manages the slope. But for the ellipse (aka the super ellipse) 
it's a math nightmare !!!!)

For example is use the three functions in the same order 
(parabol, pow, ellipse):

http://sendvid.com/ygti5jmr

for the ellipse you can see that the mouse position is not in 
sync with the control point at the middle...it's the problem.

I need to isolate c when "y = 1.0 - pow(1.0 - pow(0.5, 2.0/c), c 
* 0.5)".
I know it's hard...otherwise I wouldn't ask ;]




More information about the Digitalmars-d-learn mailing list