genartlib icon indicating copy to clipboard operation
genartlib copied to clipboard

Interpolate exp tanh

Open verberktstan opened this issue 1 year ago • 2 comments

Ok so i'm just making cool stuff for my own art projects. And I'd like to share this with you!

I've extended algebra/interpolate to accept some curve coefficients as optional arg. Besides linear interpolation, there's also exponential, tanh and s-curve interpolation.

You can supply a curve to your interpolation like this:

(algebra/interpolate {:exponent 2} 0 1 0.5) ~= 0.4667
(algebra/interpolate {:tanh-factor -0.5} 0 1 0.5) ~= 0.755

I've added tests for clarity...

verberktstan avatar Apr 18 '23 18:04 verberktstan

@thobbs I hope you have time to review this. I'd say this is a nice addition to your great lib!

verberktstan avatar Apr 18 '23 18:04 verberktstan

@thobbs if you don't fancy me opening PR's, please let me know. That's ok. Greetings from The Netherlands. Keep up the great work!

verberktstan avatar Sep 13 '23 08:09 verberktstan