How exactly can I calculate time until a ball fall if I know initial and final x and y position of a ball, gravity, delta time, initial dx and dy of a ball and its speed calculated from the formula sqrt(dx ** 2 + dy ** 2)?

  • \$\begingroup\$ Which level of precision do you need? E.g. If you want to simulate a tenis ball with rotation/effects or just a simple, ball without atmosphere? \$\endgroup\$ – Adrian Maire Nov 16 '16 at 12:02
  • \$\begingroup\$ I want to simulate a small ball with no effects, without atmosphere. This equation should provide also horizontal motion, not only free fall with dx = 0 \$\endgroup\$ – Tkininter Nov 16 '16 at 12:23
  • \$\begingroup\$ Downvoted as OP obviously did not make a lot of research before posting... \$\endgroup\$ – realUser404 Nov 16 '16 at 12:28

Supposing a macroscopic ball falling without atmosphere resistance and where Relativist effect is negligible.

  • P0[x,y,z] is the initial position of the ball, with y >= r
  • P[x,y,z] is the final position of the ball.
  • V0[x,y,z] is the initial speed of the ball
  • g[0,y,0] is the gravity, with y < 0
  • r is the radius of the ball, r >= 0
  • ground is defined as a plane at Y=0

The position of the ball at any moment is given by (1):

P = P0 + V0*t + g*t*t;

To found the time where the ball hit the ground (2):

P0.y + V0.y*t + g.y*t*t = r

Solving the equation (3):

t = ( -V0.y - sqrt(V0.y*V0.y - 4*g.y*(P0.y-r)) ) / (2 * g.y)

Final position can be calculated using (1)

Note: Considering that P0.y >=r and g.y is negative, the internal of the root is always positive.

| improve this answer | |

an unusual answer cause its mostly a link, but this is the way to calculate object falling according to X gravity following newton's law.


| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.