def addLoopXSegmentIntersections(lineLoopsIntersections, loop, segmentFirstX, segmentSecondX, segmentYMirror, y):
 rotatedLoop = euclidean.getRotatedComplexes(segmentYMirror, loop)
 for pointIndex in xrange(len(rotatedLoop)):
  pointFirst = rotatedLoop[pointIndex]
  pointSecond = rotatedLoop[((pointIndex + 1) % len(rotatedLoop))]
  addLineXSegmentIntersection(lineLoopsIntersections, segmentFirstX, segmentSecondX, pointFirst, pointSecond, y)

def addLoopXSegmentIntersections ( lineLoopsIntersections , loop , segmentFirstX , segmentSecondX , segmentYMirror , y ) : rotatedLoop = euclidean . getRotatedComplexes ( segmentYMirror , loop ) for pointIndex in xrange ( len ( rotatedLoop ) ) : pointFirst = rotatedLoop [ pointIndex ] pointSecond = rotatedLoop [ ( ( pointIndex + 1 ) % len ( rotatedLoop ) ) ] addLineXSegmentIntersection ( lineLoopsIntersections , segmentFirstX , segmentSecondX , pointFirst , pointSecond , y )
add intersections of the loop with the x segment .