Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The scenario as you can see in the picture. A ball will be hitting a surface and I want to fairly correctly get the new angle after the collision..

I expect to know the X,Y coordinates of the lines breaking points (The picture below would has 6 lines)

Secondly, if the ball would have a rotation - Is there a standard way of compensate for a "screewed" ball?

alt text

share|improve this question

What you need to calculate is the reflection vector;

if v is the velocity of your ball and n is the normal vector of the surface the ball is bouncing from then the the velocty of the ball after the bounce (assuming perfectly elastic collision etc) will be;


in 2d this will be;



share|improve this answer
Good general purpose answer. Just a little note for those making more simplistic rebound game like breakout or pong or the like, if you have a axis aligned bounding box and are not doing real physics (you want the velocity to remain the same) then you can just swap the components of the velocity vector. ie: If you reach the left or right edge of the box, negate the X value of the velocity vector. If you reach the top or bottom, negate the Y value of the velocity. – James Jan 11 '11 at 23:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.