title: Android get new coordinates after rotation
body: <p>Im developing simple game. I have cca. 50 rectangles arranged in 10 columns and 5 rows. It wasn't problem to put them somehow to fit the whole screen. But when I rotate the canvas, let's say about 7° angle,  the old coordinates does't fit in the new position of the coordinates. In constructor I already create and define the position of that rectangles, in onDraw method I'm drawing this rectangles (of course there are aready rotated) bud I need some  method that colliding with the current rectangle. I tried to use something like this (i did rotation around the center point of the screen)</p>
  
  <pre><code>int newx = (int) ((x * Math.cos(ROTATE_ANGLE) - (y  * Math.sin(ROTATE_ANGLE))) + width / 2);                
  int newy = (int) ((y * Math.cos(ROTATE_ANGLE) + (x  * Math.sin(ROTATE_ANGLE))) + height / 2);
  </code></pre>
  
  <p>but it doesn't works (becuase it gives me absolute wrong new coordinates). <strong>x</strong> and <strong>y</strong> are coordinates of the touch that I'm trying to calculate new position in manner of rotation. <strong>ROTATE_ANGLE</strong> is the angle of rotation the screen.</p>
  
  <p>Does anybody know how to solve this problem, I already go thorough many articles, wiki, wolframalpha categories but not luck. Maybe I just need some link to understand problem more.</p>
  
  <p>Thank you</p>