title: Pong reflector math?
body: <p>I am making a Pong clone and I am treating my variables in this way:</p>
  
  <pre><code>direction = a value from 0 to 2*pi 
  distX = cos(direction)*speed of the ball
  distY = sin(direction)*speed of the ball
  
  on update:
  ball's x position += distX
  ball's y position += distY
  </code></pre>
  
  <p>I can already handle the flipping of directions correctly when a ball hits a wall (just reflect at 90 degrees) but what about a paddle? I don't know how to best handle the angle and speed of the ball after it connects.</p>
  
  <p>Does it depend on where it hits on the paddle? Does it matter if the paddle is moving? etc</p>
  
  <p>I don't know a reasonable way to handle the math here.</p>