title: Rotate an axis aligned rectangle by a 90 degrees
body: <p>I have rectangle object (<code>sf::IntRect</code>) , with attributes: left, top, width and height on a 2D plane. I want to rotate it by a multiple of 90 degrees (that is 90, 180 or 270), around point (0,0). Thus I am writing a function like this:</p>
  
  <pre><code>void rotateRect(sf::IntRect&amp; rect, int rot)
  {
      //code I need
  }
  </code></pre>
  
  <p>the rotation is either 0 (0), 1 (90), 2 (180) or 3 (270).</p>
  
  <p>How can I achieve this as simply as possible.</p>