Assume I have an object that moves with an initial velocity $V\_0$, and I need this object to travel a certain distance $D$ then stops completely by decreasing its velocity with a reduction factor $r$ **or** decrement $dv$ each time step $ms$. How can I calculate $r$ and $dv$?

**Note:**  

This question is a mathematical clarification to my solution of [that question](https://stackoverflow.com/questions/64285998/calculate-deceleration-based-on-velocity-and-grid).