0
votes

I am using this drag formula in a simulation game:

double drag = (p * Math.pow(u, 2) * C * A) / 2;

(See Drag on Wikipedia)

This equation works for a short while, till the drag force is greater than the velocity, and the object (a rocket) starts falling instead of rising slower. Currently I am subtracting the drag force from the y and x using trig to calculate the change for each.

Is their a simpler formula or a way I can get this to work by including frames per second, which is set at 60?

1
FPS? What's that? "feet per second"? That's just the units for velocity.duffymo
Frames per secondSheikh
A force cannot be greater than a velocity (the units are incompatible). If the drag force is greater than the thrust then your rocket will decelerate. Drag cannot make anything fall (drag would then start working to slow the fall)Tibrogargan
@Tibrogargan I see. I'll try to check for incompatibilities.Sheikh
Force = mass * acceleration, so acceleration = force / mass. There are three separate forces acting on your rocket: The thrust of the rocket, gravity and drag. You need to calculate the final force (a vector) that is operating on your rocket [by "adding" them together] to determine how it's velocity will change each frame.Tibrogargan

1 Answers

1
votes

A force cannot be greater than a velocity (the units are incompatible). If the drag force is greater than the thrust then your rocket will decelerate. Drag cannot make anything fall (drag would then start working to slow the fall).

Force = mass * acceleration, so acceleration = force / mass. Acceleration is the change in velocity. There are three separate forces acting on your rocket: The thrust of the rocket, gravity and drag. You need to calculate the final force (a vector product) that is operating on your rocket [by "adding" them together] to determine the acceleration and then how that will make it's velocity will change each frame.