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.