I am trying to find a formula for use in a web application. I'd like to predict the total distance given initial velocity and a fixed amount of "drag".
- number representing initial velocity
- number representing drag
- number representing distance
In this web application, we can know that the number of "iterations" is equal to
drag - rounded down.
For example, given:
105 (rounded down).
Distance is calculated by accumulating the velocity of each iteration, starting with the initial velocity.
1.8509277593973181 - 0.0175
1.8509277593973181 - 0.0175 - 0.0175
1.8509277593973181 - 0.0175 - 0.0175 - 0.0175
This ends when the next number to add is less than
Note: I know that I can loop through these iterations and calculate distance imperatively, but I have a feeling that distance can be represented by a formula based on initial velocity and drag.