title: Intersection between 2 polygons
body: <p>I have two polygons (one rectangle and one triangle), I want to have a function (poly_intersect) that gives me the intersection between these two polygons.
  <a href="https://i.stack.imgur.com/jqpUD.png" rel="nofollow noreferrer">related image is here</a></p>
  
  <pre><code>import matplotlib 
  import matplotlib.pyplot as plt 
  import pandas as pd
  polygon1 = pd.DataFrame([[2,2],[4,2],[4,4],[2,4],[2,2]],columns=['X','Y'])
  polygon2 = pd.DataFrame([[1,3],[3,3],[3,6],[1,3]],columns=['X','Y'])
  
  fig, ax = plt.subplots(1,1, figsize=(6, 4))
  ax.add_patch(matplotlib.patches.Polygon(polygon1.values,color='blue',alpha=0.5))
  ax.add_patch(matplotlib.patches.Polygon(polygon2.values,color='green',alpha=0.5))
  ax.axis([0,5,1,7])
  
  
  vertices = poly_intersect(polygon1,polygon2)
  </code></pre>
  
  <p>expected output:  <code>[[2,3],[3,3],[3,4],[2,4]]</code></p>