   Calculating the arc of a ball between two points
  This is probably a dumb question, but my math skills are a bit weak.What I''m trying to do is calculate the arc of a ball (basketball in this case) as it moves from the release point to the end point, which are both known.So I want to calculate the x and y axis of the ball as it arcs between the two points.  This is done in a 2d environment.Any help is greatly appreciated,Mike 
  why not start with a half-circle?  u can allways scale it down to form more "flat" arc... ;  The beginning point and end point are not enough information. There are many physically correct quadratic arcs which pass through any two given points. You''ll also need something to specify how high the arc goes (such as initial velocity). As a start-off point, you''re going to need an equation of the form y=ax*x+b*x+c which fulfils the system of equations represented by the initial and final points. I''m sure you can find somewhere the method of doing that given 3 points (as I said, the initial and final points aren''t enough by themselves).   The official zorx website;  there are an infinite number of solutions to that question.  it could be thrown very fast and straight or it could be thrown in a high arc.  try this out with a real life ball.you also need to know the angle at which it is released and then you can solve for how fast it needs to be going.  essentially the angle of release is entirely arbirtary.  then you can use simple physics kinematics to solve for the high point and whatnot.d = 1/2 a * t^2  for a falling objectd = heighta = gravity (9.8 meters/s/s)t = timei'll have to dredge up more physics memories or spend more time on this if you want the full solution.  for now, work out the angle of release and speed of the ball.-me   [edited by - Palidine on February 19, 2004 8:20:28 PM];  Ok, Currently I do have a 3rd point which is supposed to be the height of the arc.  I calculate the X coordinate by dividing the distance between the two points in half.  The Y coordinate is static.Also of note the y coordinate of the end point may be above or below the release point since it is moveable while the end point is fixed.Thanks again,Mike;  There are some pat "formulae" i can give you...If everything starts off and ends at the same height:Range=(initial velocity)2*sin(2*angle)/gHeight=Range*tan(angle)- g/(2*v2*cos(angle))Range2... If these are wrong, they''re from my physics notes. :-/ I didn''t bother to re-derive them for accuracy.Scout All polynomials are funny - some to a higher degree.Furthermore, polynomials of degree zero are constantly funny. ;  I''d say the first thing that you will want to know is how far apart the start and end points are from each other. The next step is to get the amount of time that the ball will take to fall and make it''s full parabola. To do this, you will need the vertical velocity of the basketball. When you have this, you can find out how many seconds the ball will take to fall. And finally, when you have how many seconds it will take the ball to fall, you can divide the total horizontal distance by the number of seconds it will take, giving you the amount the ball will travel horizontally every second. Good luck, dude. Hope this helps you. ;  I''ve done some more work on this and am as confused as ever.  I''m still not clear on how to get the high point of the arc.Say the end coords are (30,90) and the beginning coords are (100,120).  Now the current way I get the middle point for the x coord is (100-30)/2 which is 35.  However I hardcode say 20 for the Y coord.The current code moves the ball to the midpoint''s x,y coords simply by subtracting/adding 6 from the x and y coords until the point is reached, then it does a similar thing for getting to the end point.  This of course results in an ugly animation that is not realistic.I''ve also tried timing this and it varies depending on the starting point.Thanks,Mike ;  the thing is, you have too little information.try getting some other infomation that makes sense.for example, we want the angle where the ball goes into the basket to be quite steep, so there is lesschance of it bouncing back, yet not too steep for it would mean throwing the bal too high. say a 45 degree angle is optimal, then you have all the equations you need to construct the parabole. (you can also come up with other extra information, which might make more sense)for x=pos1: ax^2+bx+c=height1for x=pos2: ax^2+bx+c=height2for x=pos2: 2ax + b = 1 (the derivative of the quadratic formula has a slope of 1, ie 45 degrees)this is solvable with just a little bit of mathematical knowledge. ;  I've gotten some work done on this problem, and I think it works pretty good. I have a net(red circle) and a shooter.(green circle) You can move the shooter back and forth, causing the xshooter variable to change. Heres my source code:(It's in QB 4.5, but eh, it worksSCREEN 12CLSverticalv = 50start:CLSverticallist = verticalvgravity = 10xend = 600xstart = 10ballx = xstartbally = 440DOpress$ = INKEY$lastx = ballxlasty = ballyIF press$ = "d" THENxstart = xstart + 1PSET (xstart - 1, 440), 0ballx = ballx + 1END IFIF press$ = "a" THENxstart = xstart - 1PSET (xstart + 1, 440), 0ballx = ballx - 1END IFLINE (ballx - 4, bally - 4)-(ballx + 4, bally + 4), 0, BFCIRCLE (ballx, bally), 3CIRCLE (xstart, 440), 2, 2CIRCLE (xend, 440), 2, 4WAIT &H3DA, 8time = (verticalv / 10) + ((verticalv / 10) + 1)ballhorizontal = (xend - xstart) / timeLOCATE 1, 1PRINT "Horizontal Velocity:"; (xend - xstart) / timeLOCATE 2, 1PRINT "Pixels to go:"; ballhorizontal * timeLOCATE 3, 1IF press$ = " " THENballx = ballx + ballhorizontalbally = bally - verticallistverticallist = verticallist - gravityLINE (lastx, lasty)-(ballx, bally), 2LOCATE 4, 1PRINT "Total time it will take: "; time; " seconds"END IFIF press$ = "c" THENINPUT "What is your new velocity"; verticalvGOTO startEND IFLOOP UNTIL press$ = CHR$(27)Spacebar plays the "animation" a and d move the shooter to the left and to the right.The number of frames in the animation is determined by the vertical velocity. The equation I have to calculate time is (verticalv / 10) + ((verticalv / 10) + 1)I'm not sure if this is the real one or not, but it works int the program, so I left it there.The only part that I'm having some trouble on is the time. As you can see above, I've hardcoded the time into the equation, making you have to go into QB and re-compile if you want to change anything. I know that there is a time formula that you can get from the vertical velocity, but I forget what it is. I'll look through my physics stuff and try to find it.Good luck. Hope this stuff helps   [edited by - jedis1000 on February 20, 2004 11:14:08 AM]