title: Calculate area of split polygon
body: <p>I need to split a polygon with a line, similar to this: <a href="https://stackoverflow.com/questions/3623703/how-can-i-split-a-polygon-by-a-line">How can I split a Polygon by a Line?</a>, but I don't actually care about the resulting polygons, I just want to know the area on each side of the line.</p>
  
  <p>I know I can just do the split and calculate the area of each resulting part, but I was wondering if there is any more efficient algorithm if I just need the area.</p>
  
  <p>For instance, in the image below, the yellow shape shows an original polygon and the line across it shows how I want to split it. Notice that the split line always goes between to vertices, but does not necessarily cross the entire polygon. (Note: the fact that the cut line seems to pass through a third vertex is just an accident: this may be the case but is not necessarily so).</p>
  
  <p>The red and green shapes show the resulting splits, and all I'm interested in is the total area of the red polygons (or of the green, either way)</p>
  
  <p><img src="https://i.stack.imgur.com/8bCUz.png" alt="example polygon split"></p>