tomtinderbox
Member
Greetings,
I'll come in hard and true: I suck at mathematics.
I know that:
Can also be written as:
Let's say I give xx a starting value of 100 in a create event and I put the lerp() function above in the step event. How can I calculate how many steps it will take for xx to reach 10? Is there a formula that I can add in the create event so that I can predict in advance how many times the step event needs to run to for lerp() to reach the target value, in this case 10?
Knowing that would lead up to my ultimate goal: Would it also be possible to calculate how much xx has been accumulated during all the steps? Calculating the above function by hand the first step lerp() returns 77.5, the second 60.625, etc. I would like to know how much all the returns are combined when the target is reached.
I've been struggling a bit on how to go about this. I could just let the steps run and count the amount of steps and the accumulated xx... but that kind of defeats the point of such a nice function.
Cheers,
Tom
I'll come in hard and true: I suck at mathematics.
I know that:
Code:
xx = lerp(xx, 10, 0.25);
Code:
xx = xx + ((10 - xx) * 0.25);
Knowing that would lead up to my ultimate goal: Would it also be possible to calculate how much xx has been accumulated during all the steps? Calculating the above function by hand the first step lerp() returns 77.5, the second 60.625, etc. I would like to know how much all the returns are combined when the target is reached.
I've been struggling a bit on how to go about this. I could just let the steps run and count the amount of steps and the accumulated xx... but that kind of defeats the point of such a nice function.
Cheers,
Tom
Last edited: