SISinusWaveView icon indicating copy to clipboard operation
SISinusWaveView copied to clipboard

About damping formula

Open mrleolink opened this issue 10 years ago • 1 comments

Hi Raffeal,

I have read the source code as well as the explaining comment many times but I still can't figure out the damping formula that you used. Particularly this part:

    if (value > _dampingAmplitude) _dampingAmplitude += (fmin(value,1.0)-_dampingAmplitude)/4.0;
    else if (value<0.01) _dampingAmplitude *= _dampingFactor;
    _amplitude = fmax( fmin(_dampingAmplitude*20, 1.0), _idleAmplitude);

Why did you choose 4.0 as divisor, 0.86 (~ sqrt(3)/2) as damping factor, and multiply dampingAmplitude by 20 after all?

I'm really keen on the beauty of maths in this animation, so I'm looking forward to your to hearing from you. Thanks :+1:

mrleolink avatar Jun 02 '14 10:06 mrleolink

How can I set the gradual-changed color for my wave view ? Thank you.

DreamFlyingCow avatar Oct 16 '18 09:10 DreamFlyingCow