Im trying to create a method to calculate the fall time for an object using real formulas. Well I came up with this:
public static double calculate_fall_time(float height) {
final float GRAVITY = 9.81f;
float h = (1/2)*GRAVITY*2;
float h2 = GRAVITY/GRAVITY;
double t = Math.sqrt(((2*h2)/GRAVITY));
return t;
}
Well I used to this website to compare the results but it wasn't the same. If I have 370 at the input then my program shows 0.4515 but the website is showing around 8,6 seconds.
Does anybody know how I can fix this problem? Thanks in advance :D
NOTE: I know that arcade physics are much more fun but my goal is to create a rather realistic game. Thanks for reading.
height
parameter inside your function? \$\endgroup\$double t = Math.sqrt(2 * GRAVITY * height);
It outputs something which looks similar to the value of the website (85.20211494220669) but it itsn't correct. (8.69) \$\endgroup\$