code: def _polygon_collide(polygon1, polygon2):
      
      direction = np.empty((2,), order="F")
      for polygon in (polygon1, polygon2):
          _, polygon_size = polygon.shape
          for index in six.moves.xrange(polygon_size):
              # NOTE: When ``index == 0`` this will "wrap around" and refer
              #       to index ``-1``.
              direction[:] = polygon[:, index] - polygon[:, index - 1]
              if is_separating(direction, polygon1, polygon2):
                  return False
  
      return True
docs: Determines if two **convex** polygons collide.
  
      .. _SAT: https://en.wikipedia.org/wiki/Hyperplane_separation_theorem
      .. _see also: https://hackmd.io/s/ryFmIZrsl
  
      This code uses the Separating axis theorem (`SAT`_) to quickly
      determine if the polygons intersect. `See also`_.
  
      .. note::
  
         There is also a Fortran implementation of this function, which
         will be used if it can be built.
  
      Args:
          polygon1 (numpy.ndarray): A ``2 x N`` array (``float64``) of ordered
              points in a polygon.
          polygon2 (numpy.ndarray): A ``2 x N`` array (``float64``) of ordered
              points in a polygon.
  
      Returns:
          bool: Flag indicating if the two polygons collide.