cptrnet 169 Report post Posted August 30, 2005 How do I find the line, in 2D, that a object is moving on, such as a pong ball. So from the velocity how do I calculate the line coordinates? I need it to figure out so I can tell where the ball will hit for the computer. I am terrible at math, I don't even know what this calculation is called, so I dont know what to look for on google or here. Can anyone lend me some help. Thanks. 0 Share this post Link to post Share on other sites
frob 45009 Report post Posted August 30, 2005 Quote:Original post by cptrnetHow do I find the line, in 2D, that a object is moving on, such as a pong ball. So from the velocity how do I calculate the line coordinates? I need it to figure out so I can tell where the ball will hit for the computer. I am terrible at math, I don't even know what this calculation is called, so I dont know what to look for on google or here. Can anyone lend me some help. Thanks.It's called the slope. Rise over run. See the definition of a line that you were supposed to learn in 7th grade. If you want, there are 30 different forms of the equation here 0 Share this post Link to post Share on other sites
cptrnet 169 Report post Posted August 30, 2005 They never taught me how to find the slope from a velocity. If you don't want to be helpful just don't post, don't waste the space on the forums. I wasn't in the highest math class either, you know some people struggle. I have no idea what those calculations are on that page. Am I supposed to know what everything is? If I did why would I post on here? Can someone give me a retards version of what the poster above tried to give me. Im sorry Im not as gifted as you are. 0 Share this post Link to post Share on other sites
frob 45009 Report post Posted August 30, 2005 Quote:Original post by cptrnetThey never taught me how to find the slope from a velocity. If you don't want to be helpful just don't post, don't waste the space on the forums. I wasn't in the highest math class either, you know some people struggle. I have no idea what those calculations are on that page. Am I supposed to know what everything is? If I did why would I post on here? Can someone give me a retards version of what the poster above tried to give me. Im sorry Im not as gifted as you are.Apart from your trolling, I'll just repeat that the slope is the velocity, which is 'rise over run', or dy/dx, or however else you want to call it.You might try looking at formula #2 from the definition of the line web page. Since you should know all but one value (you know the starting coordinates and the slope called m), and I presume you know one of the ending coordinates (the row your paddle is on), it should be easy to figure out. 0 Share this post Link to post Share on other sites
CombatWombat 673 Report post Posted August 30, 2005 I think you are better off doing things with vector math, as slope you can run into division by zero issues if your ball is going directly up/down.Vector math really isnt too terribly difficult to get a grasp on, especially for 2D where you will rarely need to use cross products. 0 Share this post Link to post Share on other sites
LilBudyWizer 491 Report post Posted August 31, 2005 Well, a good resource is Mathworld. Just type line in the search field and follow the first link. What you describe is a line-line intersection. You can look that up on Mathworld as well, but I doubt you'll find that as useful as what you'll find on this site. If you follow the link under resources above for Programming>>Math and Physics the first three topics under Physics Tutorials is a good place to start. Under Math you'll find an article on fast 2D line intersection. Under Programming>>Game Programming you'll find a tutorial using pong Game Programming 101 Part I.That will get you started. 0 Share this post Link to post Share on other sites