def getNumberOfIntersectionsToLeft(loop, point):
 if (point == None):
  return 0
 numberOfIntersectionsToLeft = 0
 for pointIndex in xrange(len(loop)):
  firstPointComplex = loop[pointIndex]
  secondPointComplex = loop[((pointIndex + 1) % len(loop))]
  xIntersection = getXIntersectionIfExists(firstPointComplex, secondPointComplex, point.imag)
  if (xIntersection != None):
   if (xIntersection < point.real):
    numberOfIntersectionsToLeft += 1
 return numberOfIntersectionsToLeft

def getNumberOfIntersectionsToLeft ( loop , point ) : if ( point == None ) : return 0 numberOfIntersectionsToLeft = 0 for pointIndex in xrange ( len ( loop ) ) : firstPointComplex = loop [ pointIndex ] secondPointComplex = loop [ ( ( pointIndex + 1 ) % len ( loop ) ) ] xIntersection = getXIntersectionIfExists ( firstPointComplex , secondPointComplex , point . imag ) if ( xIntersection != None ) : if ( xIntersection < point . real ) : numberOfIntersectionsToLeft += 1 return numberOfIntersectionsToLeft
get the number of intersections through the loop for the line going left .