def isLoopIntersectingLoop(anotherLoop, loop):
 for pointIndex in xrange(len(loop)):
  pointFirst = loop[pointIndex]
  pointSecond = loop[((pointIndex + 1) % len(loop))]
  segment = (pointFirst - pointSecond)
  normalizedSegment = euclidean.getNormalized(segment)
  segmentYMirror = complex(normalizedSegment.real, (- normalizedSegment.imag))
  segmentFirstPoint = (segmentYMirror * pointFirst)
  segmentSecondPoint = (segmentYMirror * pointSecond)
  if euclidean.isLoopIntersectingInsideXSegment(anotherLoop, segmentFirstPoint.real, segmentSecondPoint.real, segmentYMirror, segmentFirstPoint.imag):
   return True
 return False

def isLoopIntersectingLoop ( anotherLoop , loop ) : for pointIndex in xrange ( len ( loop ) ) : pointFirst = loop [ pointIndex ] pointSecond = loop [ ( ( pointIndex + 1 ) % len ( loop ) ) ] segment = ( pointFirst - pointSecond ) normalizedSegment = euclidean . getNormalized ( segment ) segmentYMirror = complex ( normalizedSegment . real , ( - normalizedSegment . imag ) ) segmentFirstPoint = ( segmentYMirror * pointFirst ) segmentSecondPoint = ( segmentYMirror * pointSecond ) if euclidean . isLoopIntersectingInsideXSegment ( anotherLoop , segmentFirstPoint . real , segmentSecondPoint . real , segmentYMirror , segmentFirstPoint . imag ) : return True return False
determine if the a loop is intersecting another loop .