4 ms·
Instead of cos(...) you could use pow( cos(...), a ) where a can be used to adjust the steepness. I can't plot it right now and I think I'm missing so
by static_noise 11y ago
Instead of
cos(...)
you could use
pow( cos(...), a )
where a can be used to adjust the steepness.
I can't plot it right now and I think I'm missing something, but you get the general idea of using the power of a function which goes form 0 to 1 to adjust steepness.
Another solution would be a 2-piece function kind of
0.5*pow( 2*t/T, a ) for t < T/2
and
1-0.5*pow( 2*(1-t/T), a ) for t > T/2
which makes a similar slope as the cosine but is easier to calculate.