title: Calculating the angle on a bouncing back ball
body: <p>I have been working on a game and am having some problems with the bouncing effect. I have searched on the Internet for different resources but have not found the correct way of doing it.</p>
  
  <p>I wonder if there is some way to calculate the degrees or the angle that the ball will bounce back after hitting a wall. </p>
  
  <p>Exampel, the ball is moving at a specific angle, I am wondering how to calculate the angle when I bounce</p>
  
  <pre><code>bollX += bollspeed*Math.cos(Math.toRadians(angle)); 
  bollY += bollspeed*Math.sin(Math.toRadians(angel));
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/URNXh.png" alt="enter image description here"></p>
  
  <p>Thanks for the help.</p>