I created a program that simulates a knockback system and since setting

$velocity = velocity - (velocity*friction)$,

the acceleration must be equals to,

$a(t) = -velocity * friction$

and the resulting velocity function must be,

$v(t) = Initial Velocity - velocity * friction * t $

which is equals to,

$v(t) = \frac{InitialVelocity}{1 + Friction*t}$

given the velocity formula the resulting distance formula would be,

$d(t) =\int{v(t)} = \frac{InitialVelocity^2}{2(1+Friction*t)}$

However, when I try to calculate the time given the distance, friction and Initial Velocity it gives me a wrong answer.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.