Thursday, September 21, 2017

0 - 1 Remapping Functions: Sine-Wave

/* remapping functions */


for(i=[-0:1/160:1])translate([i,0])square([1/160,    (sinw(  (i))) ]);
    function sinw(i)=sin(i*360)/2+smooth(i);
    function gauss(x) =       x + (x - smooth(x));
    function smooth (a) =let (b = clamp(a))(b * b * (3 - 2 * b));
    function clamp(a, b = 0, c = 1) = min(max(a, b), c);

 

No comments:

Post a Comment