Search code examples
c++motionprojectile

Why should I use velocity equations instead of position ones in Projectile Motion


I've got a question, I've seen in this answer, that velocity equations are better than position ones in Projectile Motion. Can someone explain me please, why should I do that?

Why I am asking about that? I was trying to simulate Horizontal, Vertical and Projectile motion, and now, when I've made almost everything, I've started to wondering, how to add Air-Resistance, so it would look more realistic. Almost all of solutions, which I've seen are using velocity equations right here. I was wondering if I can add Air-Resistance based on position equations, or it's a must to use velocity equations right here.

I've made so far this code, and it works good as well.

else if (whichThrow == 3) {
    while (t < totalTime) {
        tempX = velocity[0] * t;
        tempY = velocity[1] * t - (acceleration / 2)*t*t;
        t += step;
        coords.push_back(make_pair(tempX, tempY));
        printf("[%f][%f]\n", tempX, tempY);
    }
}

Solution

  • If we simulating motion, there would be many external forces apply on the object such as gravity, collision, wind, etc. It would be more convenient to make it in velocity because it will be interchangeable between acceleration and position.

    Since you mentioned about the drag force of the air which is defined as [Wikipedia]:

    drag_force

    where :

    • F is the drag force, which is by definition the force component in the direction of the flow velocity,

    • eqn is the mass density of the fluid,[1]

    • eqn is the flow velocity relative to the object,

    • eqn is the reference area, and

    • eqn is the drag coefficien,

      we know that the motion is velocity-dependent. To be more clear, you could visit this.