Equations for aiming tennis ball parabolic motion

In summary, the problem is to determine the angle and velocity needed for the computer player to hit the ball through three specific points on the court. This can be simplified to a 2-dimensional problem and solved by considering the equations of motion with constant acceleration. The initial velocity can be chosen arbitrarily, and then the final velocity can be determined by solving for it using the given time, position, and acceleration values. This process can then be repeated for the vertical motion to find the optimal angle and velocity for hitting the ball over the net and towards the target. The equations used are x = v0*t + x0 and x = x0 + v0*t + 1/2*a*t^2, where x0 is the initial height
  • #1
markofjohnson
2
0
Hi, I'm writting a 3D tennis game, and I need to revamp how the computer player hits the ball. I have a simple physics model for trajectory (no air resistance) that works great, but now I need to have the computer player play smarter, and make judgements about how to get the ball over the net optimally and to the target on the other side of the court.

This is a problem of solving linear equations for parabolic motion? (Again, there is no air drag in this game). Specifically what I need is what is the angle and velocity to hit the ball so that the ball goes through 3 points:

- Start position when hit is x1,y1,z1.
- The ball must be hit to x3,y3,z3 (z3=0 when hit ground).
- The ball must also get over the net at height z2 ie position x2,y2,z2.

What equations or code will tell me speed and velocity for hitting the ball through these 3 points?

Many thanks
Mark
 
Last edited by a moderator:
Physics news on Phys.org
  • #2
what language are you writing this in?
 
  • #3
Its for iPhone, so C, but I can translate from anything if you have some handy source code. Thanks.
 
  • #4
Motion occurs in three dimensions but we can simplify it to 2 dimensions by considering only the plane containing the vector we want to hit the ball in (so the 2 dimensions of the plane are up and forward).

I assume your physics model neglects drag forces so, in the forward direction, the ball is given an initial velocity via. an impulse force and then no further acceleration occurs. So, motion in the forward dimension is simply

x = v0*t + x0

or equivalently,
d = rt

Note that, hitting the ball amounts to choosing initial velocity. For this dimension we can pick an arbitrary velocity. Then we solve for t (time) to see how long it will take to cover the distance from one side of the court to the other.

The second step is to consider the vertical motion of a parabola with that previous time value in mind, such that the final height will be 0 at the given time t, indicating that the motion has completed it's arc.

From the equations of motion with constant acceleration,
http://en.wikipedia.org/wiki/Equation_of_motion

What variables do we know? We know the final time, final position, and final acceleration but not the final velocity so we choose this equation:

x = x0+ v0*t + 1/2*a*t^2

x0 = initial height
x = final height ( = 0, since it hits table)
v0 = unknown
t = known, from first part
a = known, gravity

So you can just solve for v0.

Now you can combine the initial velocity that you chose randomly from step 1 with this one and that gives you the initial velocity vector (speed is just the length of the velocity vector)
 
  • #5
height=(v^2(sin(x))^2))/(2g)
range=(v^2*sin(2x))/g
v=speed
g=9.8ms^-2
 

What is the equation for calculating the height of a tennis ball in parabolic motion?

The equation for calculating the height of a tennis ball in parabolic motion is h = h0 + v0t + 1/2at2, where h0 is the initial height, v0 is the initial velocity, t is the time, and a is the acceleration.

How is the initial velocity of a tennis ball calculated for parabolic motion?

The initial velocity of a tennis ball can be calculated using the equation v0 = v0x + v0y, where v0x is the horizontal component of the initial velocity and v0y is the vertical component of the initial velocity.

What factors affect the trajectory of a tennis ball in parabolic motion?

The trajectory of a tennis ball in parabolic motion is affected by the initial velocity, initial angle, air resistance, and gravity. The surface of the court and wind conditions can also play a role.

How can the trajectory of a tennis ball be adjusted for optimal aim?

The trajectory of a tennis ball can be adjusted by changing the initial velocity, initial angle, or a combination of both. By adjusting these factors, the ball's trajectory can be optimized to hit a specific target.

Can the equation for aiming a tennis ball in parabolic motion be used for other sports?

Yes, the equation for aiming a tennis ball in parabolic motion can be applied to other sports such as basketball, soccer, and football. However, the specific variables and factors may vary depending on the sport and its unique conditions.

Similar threads

  • Mechanics
Replies
2
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
Replies
6
Views
8K
  • Introductory Physics Homework Help
Replies
9
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
14
Views
2K
Replies
45
Views
3K
  • Introductory Physics Homework Help
Replies
4
Views
4K
  • Mechanical Engineering
Replies
11
Views
6K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
Back
Top