Basic math help needed...

Started by
2 comments, last by CompiledMonkey 20 years, 9 months ago
I''m making a game for my final project in programming, and I need a little help with curved lines. I''m making 3 Card Monty (http://www.isy.vcu.edu/~cstewart/info350/FinalProject.html) and need a way to move two of the cards around at the same time. I know how to actually do the code of animating the cards, but I don''t know how to come up with the equation to do it with an arc. Can anybody help me here?
Advertisement
One way to do it would be by using projectil-like parametric equations. In other words, set an x velocity, and update that until it gets to the destination. Also set a y velocity, but also a y acceleration, updating the velocity with the acceleration (negative if you want an arc that goes up and returns down, positive if you want an arc that goes down then returns up). Note that whatever sign the y acceleration has, the initial y velocity should have the opposite sign.

Check out an introductor physics book for more detail on this simple method of doing things.
I get the idea of what you are saying. I''m just not sure how to implement it. Do you know of any examples or anything?
center of arc = (x,y)
rotation = t (for theta)
radius = r

position of point on arc with given rotation = (cos(t)*r+x,sin(t)*r+y)
____________________________________________________________AAAAA: American Association Against Adobe AcrobatYou know you hate PDFs...

This topic is closed to new replies.

Advertisement