code: def is_separating(direction, polygon1, polygon2):
      
      # NOTE: We assume throughout that ``norm_squared != 0``. If it **were**
      #       zero that would mean the ``direction`` corresponds to an
      #       invalid edge.
      norm_squared = direction[0] * direction[0] + direction[1] * direction[1]
      params = []
      vertex = np.empty((2,), order="F")
      for polygon in (polygon1, polygon2):
          _, polygon_size = polygon.shape
          min_param = np.inf
          max_param = -np.inf
          for index in six.moves.xrange(polygon_size):
              vertex[:] = polygon[:, index]
              param = cross_product(direction, vertex) / norm_squared
              min_param = min(min_param, param)
              max_param = max(max_param, param)
          params.append((min_param, max_param))
      # NOTE: The indexing is based on:
      #       params[0] = (min_param1, max_param1)
      #       params[1] = (min_param2, max_param2)
      return params[0][0] > params[1][1] or params[0][1] < params[1][0]
docs: Checks if a given ``direction`` is a separating line for two polygons.
  
      .. note::
  
         This is a helper for :func:`_polygon_collide`.
  
      Args:
          direction (numpy.ndarray): A 1D ``2``-array (``float64``) of a
              potential separating line for the two polygons.
          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 ``direction`` is a separating line.