def isXSegmentIntersectingPath(path, segmentFirstX, segmentSecondX, segmentYMirror, y):
 rotatedPath = getRotatedComplexes(segmentYMirror, path)
 for pointIndex in xrange((len(rotatedPath) - 1)):
  pointFirst = rotatedPath[pointIndex]
  pointSecond = rotatedPath[(pointIndex + 1)]
  if isLineIntersectingInsideXSegment(pointFirst, pointSecond, segmentFirstX, segmentSecondX, y):
   return True
 return False

def isXSegmentIntersectingPath ( path , segmentFirstX , segmentSecondX , segmentYMirror , y ) : rotatedPath = getRotatedComplexes ( segmentYMirror , path ) for pointIndex in xrange ( ( len ( rotatedPath ) - 1 ) ) : pointFirst = rotatedPath [ pointIndex ] pointSecond = rotatedPath [ ( pointIndex + 1 ) ] if isLineIntersectingInsideXSegment ( pointFirst , pointSecond , segmentFirstX , segmentSecondX , y ) : return True return False
determine if a path is crossing inside the x segment .