i am trying to make the game pong ( my math is really bad and i am working on it) and trying to do the bouncing ball part.
I am trying to calculate the out going(reflecting) angel of the ball after hitting the walls or pedals (the walls are always horizontal and the pedals are always vertical)
Here is an image to demonstrate it better :
here is what i tried so far:
m = (y2-y1) / (x2-x1)
angle = atan(-m);
How ever this does not seem to work.