   Bouncing Ball
  Ball bouncing in a circle for the iphone, the device gives me the acceleration in x,y,z axishttp://www.flickr.com/photos/60395315@N00/3621325296/I am working on figuring the math for this, wondering if I am on the right pathLets say the ball is starting from (a,b) inside the circle (see figure) hitting any point (c,d) on the circle. The next point the program calculates based on the accleration/velocity the device returns is outside the circle (m,n). Now when we check the bounds, the ball should have bounced from the point (c,d).The line (a,b) & (m,n) intersects the circle at (c,d)The tangent of the line is x.c + y.d = r*r   (x,y are points on the line)The distance of m,n from the tangent is equal to the point p1, p2 where the bounces to at this point I reverse the velocity & reduce it to .75 percent of its original.Am I on the right path here. How do I find point (p1,p2), where I am going to draw the ball?[Edited by - MysteryBox on June 12, 2009 11:06:33 PM]
  Hi MysteryBox,I guess you have a small thinking error here:Quote:The distance of m,n from the tangent is equal to the point p1, p2 where the bounces toat this point I reverse the velocity & reduce it to .75 percent of its original.You do not want to reverse the velocity, instead you want to mirror it at the tangent at (c,d). To do so, calculate the tangential and normal parts of the velocity along the tangent, and reverse the normal parts.You will also need to calculate how much percent of your initial velocity was "used" when the collision occurred. Of the remaining amount you can then take 75 percent and you should end up at (p1,p2).Cheers,fng   ;fnq, thanks for the reply. Let me see if understand this correctly.The angle of the bounce will easy to calculate based on the angle at which the ball hits the tangent.The calculation of the velocity(scaler) of the resulting bounce is what confuses me. Quote:To do so, calculate the tangential and normal parts of the velocity along the tangent, and reverse the normal parts.so the resulting bounce velocity will be the reversed normal to the tangent and the angle will be the mirror angle? Quote:You will also need to calculate how much percent of your initial velocity was "used" when the collision occurred. Of the remaining amount you can then take 75 percent and you should end up at (p1,p2).Do I subtract this from the normal velocity we calculate above?