title: Rotating a point about another point (2D)
body: <p>I'm trying to make a card game where the cards fan out. Right now to display it Im using the Allegro API which has a function:</p>
  
  <pre><code>al_draw_rotated_bitmap(OBJECT_TO_ROTATE,CENTER_X,CENTER_Y,X
          ,Y,DEGREES_TO_ROTATE_IN_RADIANS);
  </code></pre>
  
  <p>so with this I can make my fan effect easily. The problem is then knowing which card is under the mouse. To do this I thought of doing a polygon collision test. I'm just not sure how to rotate the 4 points on the card to make up the polygon. I basically need to do the same operation as Allegro.</p>
  
  <p>for example, the 4 points of the card are:</p>
  
  <pre><code>card.x
  
  card.y
  
  card.x + card.width
  
  card.y + card.height
  </code></pre>
  
  <p>I would need a function like:</p>
  
  <pre><code>POINT rotate_point(float cx,float cy,float angle,POINT p)
  {
  }
  </code></pre>
  
  <p>Thanks</p>