title: How to update x, y coordinates on an rotating rectangle edge
body: <p>Ok so I have searched and searched for a solution to my problem, but non seem to fix it.</p>
  
  <p>I need to make a game with a rotating "cannon", my cannon is a simple rectangle placed in the middle of my panel that I can rotate with my keyboard. It rotates around one edge. I want to shoot out of the edge on the other side. I have found the starting point of where to shoot my bullets by using:</p>
  
  <pre><code>x = a + dia * (float)Math.Cos(angle);
  y = b + dia * (float)Math.Sin(angle)
  </code></pre>
  
  <p>where "a, b" is the center coordinate I rotate it around and "dia" is the diagonal of the rectangle and "angle" is the angle of the one half of my rectangle.</p>
  
  <pre><code>public float rotate = 0.0f; 
  g.TranslateTransform(a , b);
          g.RotateTransform(rotate);
  </code></pre>
  
  <p>I have a own class for my bullets that I put in a List.
  So far so good. But when I rotate my cannon, the bullets don't come out from the tip anymore..they just start appearing far off where I want them to. it's because of this code:</p>
  
  <pre><code>x = (float)((x * Math.Cos(rotate)) - (y * Math.Sin(rotate)));
          y = (float)((x * Math.Sin(rotate)) + (y * Math.Cos(rotate)));
  </code></pre>
  
  <p>that's supposed to update the x, y coordinates of the tip of the cannon.
  If I delete it, it just fires from the same spot(no shit).
  Can someone please explain to me what code I need to write to update the X, Y so they come out of my rectangle edge? It's driving me crazy..</p>
  
  <p>Edit:
  Found my answer staring at the screen in the early mornings. I had no need for any "find new x, y coordinates". I simply made a updater that updated the original angle with the float number it needed to move a little bit each time i rotated it.
  hah! so simple, yet so hard to see.</p>