Title: exponential interpolation ? like in ultrafractal Post by: cKleinhuis on February 24, 2014, 04:53:14 PM hi all, i can not get my head around the "exponential interpolation" feature of ultrafractal, as described here:
http://www.ultrafractal.com/help/index.html?/help/tutorials/basicskills/bs-zoom.html i want to implement such an interpolation method of my own, but i can not figure it out, and the internet seems to be not providing any information as well, is it so easy no one writes about it ?! question: i have a linear interpolation between point x and y. i now want to interpolate the values exponentially as described in the uf link... :hmh: :hmh: :hmh: Title: Re: exponential interpolation ? like in ultrafractal Post by: hobold on February 24, 2014, 06:01:12 PM If I am not mistaken, you can can get exponential interpolation by working in logarithmic space. Conceptually that is a three step process:
if you want to interpolate a variable from value A to value B according to a time parameter t (with 0.0 <= t <= 1.0), then: 1. take the logarithm of A and B (any base of logarithm will do, as long as you are consistent later) logA = log(A); logB = log(B); 2. now interpolate the transformed values as you normally would, either linearly, or with a spline, or however you wish: logInterpolatedValue = interpolate(t, logA, logB); 3. finally, the interpolated value from log space needs to be mapped back (use the same base as with the log of step 1) interpolatedValue = exp(logInterpolatedValue); That should do the trick. There are some limitations, because A and B may not be zero and must have the same sign. But that is a fundamental limitation of logarithmic space, not of this specific algorithm. Title: Re: exponential interpolation ? like in ultrafractal Post by: cKleinhuis on February 24, 2014, 07:17:31 PM very cool, thank you, it seems to work ;)
Title: Re: exponential interpolation ? like in ultrafractal Post by: hobold on February 25, 2014, 12:20:28 AM Math works! :)
Title: Re: exponential interpolation ? like in ultrafractal Post by: cKleinhuis on February 25, 2014, 12:47:51 AM right, and i never get how easy working with logarithms actually is ;) and for the zoom factors it is a MUST to get it continuously smooth thank you for the pointing !!! |