title: Finding the shape created by two other intersecting shapes
body: <p>I have two overlapping shapes in my C# app, defined by <code>Point</code> arrays. I need to find the points that define the shape where these two overlap. In this image, I know the red and green points, but I need the yellow points.</p>
  
  <p><img src="https://i.stack.imgur.com/TbIhX.png" alt="alt text"></p>
  
  <p>Here is some dummy code that might help:</p>
  
  <pre><code>Point[] GetIntersection(Point[] red, Point[] green)
  {
      Point[] yellow = ?!?;
  
      return yellow;
  }
  </code></pre>
  
  <p>There are certainly ways you could do this assuming nice easy rectangles. In practice, I need to be able to handle polygons and maybe even circles (although I can live without circles).</p>
  
  <p>Any ideas? I'm hoping there is a nifty GDI+ function that will just spit this out.</p>