Are given:
The initial value is 0 ;
Value to which you want to cast Initial value: tween.attrs.radius ;
The time for which you need to bring the initial value to the value tween.attrs.radius - end ;
And the frequency of cycles: age
For example:

  tween = { age: 10, end: 200, attrs: { radius: 50 } 

Question: How to calculate the number by which you need to increase the initial value with each tick, so that when the time specified in the end initial value is 50?
I do it like this:

 obj.attrs.radius += (0 - tween.attrs.radius) * tween.age / tween.end; 

But the initial value when doing this is less than 50 about 2 times.

    1 answer 1

     var step = tween.attr.radius/tween.age; // шаг (искомоС Π·Π½Π°Ρ‡Π΅Π½ΠΈΠ΅) var period = tween.end/tween.age; // с ΠΊΠ°ΠΊΠΎΠΉ ΠΏΠ΅Ρ€ΠΈΠΎΠ΄ΠΈΡ‡Π½ΠΎΡΡ‚ΡŒΡŽ Π±ΡƒΠ΄Π΅ΠΌ // ΠΏΡ€ΠΈΠ±Π°Π²Π»ΡΡ‚ΡŒ step