Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Solved

Posted on 2003-11-18

Hi all,

I'm trying to code the "bouncing movement" of a ball for a program.

What I need is the formula from which I can get an exact point (position of the ball) in an elliptic arc. (I couldn't yet find it)

Could anybody please help?

Thanks in advanced,

Techfreelance

I'm trying to code the "bouncing movement" of a ball for a program.

What I need is the formula from which I can get an exact point (position of the ball) in an elliptic arc. (I couldn't yet find it)

Could anybody please help?

Thanks in advanced,

Techfreelance

4 Comments

Give the ball a starting velocity in the X direction, say 1 m/sec

Give it a starting velocity in the Y direction, if we assume it's being thrown upward, say 0.5 m/sec

Now let's assume there's no air resistance, so the ball is not going to change speed in the X direction,

i.e. X Accelleration equals zero.

But there's gravity, which is a constant downward acceleration, so each second it's going to increase in Y velocity by G m/sec,

on Earth's surface G is IIRC 9.8 meters per second.

So that shoul dbe all you need to calculate the ball's trajectory. Starting at X,Y position of say (0,0), calculate its position 0.1 second later, easily done since you know the X and Y velocities. Also calculate a new X and Y velocity, given the X and Y accelerations. Very simple math.

And Oh, when the ball hits the ground (Y = 0), it will bounce, assume a very elastic ball, so the Y velocity reflects. Very easy, very simple, as the old Chef Tell used to say,

http://www.brainycreatures.co.uk/physics/friction.asp

x(t) = V*t*cos(theta)

y(t) = V*t*sin(theta) - g*t² /2

The time for the ball to come down is (2V/g)sin(theta) so the above formula is for 0 < t < (2V/g)sin(theta).

I am not sure exactly how much detail you want but there is a start, let me know what else you need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Course of the Month5 days, 18 hours left to enroll

Join the community of 500,000 technology professionals and ask your questions.