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

Experts Exchange Solution brought to you by

Enjoy your complimentary solution view.

Get this solution by purchasing an Individual license!
Start your 7-day free trial.

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trialhttp://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.

Math / Science

From novice to tech pro — start learning today.

Experts Exchange Solution brought to you by

Enjoy your complimentary solution view.

Get this solution by purchasing an Individual license!
Start your 7-day free trial.

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,