# how can i find the angle of a reflecting line?

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.

-

For a reflecting line, $$B = A$$ For the game of pong though, the position of the paddle changes the angle.
@NetaMeta - if it hits' at $30^\circ$, it will bounce back at $180\circ - 30^\circ$. In your diagram, this means $A=B$. – nbubis Jan 31 '14 at 23:56