Help on Optimization Problem for Tennis Ball Physics + prediction

Started by
41 comments, last by kenBlade 5 years, 1 month ago

that sounds neat -- i've never done anything like that before but could work. As long as it doesn't yield any weird initial flight patterns that the naked eye can detect. 

Thanks for the suggestion!

Advertisement

Sorry, are you using C++? or C#?

C# since this is all done in Unity

Do you know C++? Would you be able to convert a small C++ code into C#?

I think i have code that does this:

Have a body(ball), a target position, gravity. And a constant instant velocity that the ball will have 'at launch'.

It then calculates one of two possible angles the instant velocity must have to hit the target. (It's just quadratic equation to calculate the parabolic trajectory. One can also calculate the time it will take to hit the target.)

If i let the physics engine do the simulation, it is very accurate also with big distance. I guess any physics engine is accurate enough to match this analytic prediction well enough.

Would this help? Need to search for the code...

 

 

The problem is that drag and the Magnus force complicate the calculations. If there was no drag or Magnus force, then the OP could indeed just use the SUVAT equations, right? Do you know of the analytical solution that includes drag and the Magnus force?

I do not even know what magnus force is :) 

I only know there exists no analytical solution for air resistance and iterations would be required in that case.

Oh, googling says magnus force is likely the effect of air friction from rotating ball? Then, as long as air is ignored this magnus force would not be simulated and so has no effect. (I assume air resistance is ignored?)

Well, that's the novel thing about serving in tennis; the spin on the ball can produce a significant force.

yes, same w/ all ball sports. Hence it's so difficult so simulate in a convincing way, yet still be predictable enough for gameplay..

13 hours ago, kenBlade said:

-not doing wind force as thats too sim heavy for now

... sure, but @kenBlade seems to ignore it intentionally? So his problem might be easy to solve? I assume no wind also means nor air resistance at all?

 

2 minutes ago, kenBlade said:

Hence it's so difficult so simulate in a convincing way

Edit: Ok.

This topic is closed to new replies.

Advertisement