Tuesday, July 28, 2009

Gravitational acceleration in terms of time, written in C++?

I need a formula that can be used in a C++ program that will find how long it will take an object to freefall from a given height. Not the velocity upon impact, but the duration of the fall. Also, please give what each variable means.

Gravitational acceleration in terms of time, written in C++?
If you want to just use simple kinematics equations. You can find it using the two formulas


Vf^2 = Vi^2 + 2ad


and


Vf = Vi + at





If your starting from rest then you have


t = sqrt(2ad)/a (or in C++ t = sqrt(2 * a * d) / 2; assuming you include cmath and all the variables are float or double)


Where t = time


a = acceleration


d = height


No comments:

Post a Comment