title: Compute union of two arbitrary shapes
body: <p>I'm working on an application, I need to be able to combine two overlapping arbitrary shapes as drawn by the user. This would be a Union operation on the two shapes. The resultant shape would be the silhouette of the two overlapping shapes.</p>
  
  <p>The shapes are stored as a sequence of points in a clockwise manner.</p>
  
  <p>Ideally I'd like an algorithm which will take two arrays of Points (x,y) and return a single array of the resultant shape.</p>
  
  <p>I've been reading Wikipedia on <a href="http://en.wikipedia.org/wiki/Boolean_operations_on_polygons" rel="noreferrer">Boolean operations on polygons</a> which mentions the <a href="http://en.wikipedia.org/wiki/Sweep_line_algorithm" rel="noreferrer">Sweep line algorithm</a> but I can't make the link between this and my goal, alas I'm not a Mathematician.</p>
  
  <p>I'm developing the application in ActionScript 3 but I'm familiar with C#, Java and I can pick my way through C and C++. </p>