title: C - Calculate area between two rectangles
body: <p>I have been searching for solutions to my problem but haven't found any that I could understand fully, feel free to link to solutions.</p>
  
  <p>I want to calculate the x,y co-ordinates of a rectangle which is the intersection of two other 2D, normal rectangles:</p>
  
  <pre><code>  (x0,y0)      
      +------------+
      |            |
      |    (x4,y4) |
      |       +----------+
      |       |    |     |
      +-------|----+     |
              |  (x2,y2) |
              |          |
              +----------+
                       (x5,y5)
  </code></pre>
  
  <p>Basically I just need co-ordinates for the intersection rectangle. I'll be implementing this in C but the answer can be in pseudo code. </p>
  
  <p>Thanks</p>
  
  <p><strong>Edit:</strong> what i am looking for is an algorithm to find the rectangle of intersection between any two 2d, normal rectangles, not a solution solely for the example above</p>