def getEndpointsFromYIntersections(x, yIntersections):
 endpoints = []
 for yIntersectionIndex in xrange(0, len(yIntersections), 2):
  firstY = yIntersections[yIntersectionIndex]
  secondY = yIntersections[(yIntersectionIndex + 1)]
  if (firstY != secondY):
   firstComplex = complex(x, firstY)
   secondComplex = complex(x, secondY)
   endpointFirst = euclidean.Endpoint()
   endpointSecond = euclidean.Endpoint().getFromOtherPoint(endpointFirst, secondComplex)
   endpointFirst.getFromOtherPoint(endpointSecond, firstComplex)
   endpoints.append(endpointFirst)
   endpoints.append(endpointSecond)
 return endpoints

def getEndpointsFromYIntersections ( x , yIntersections ) : endpoints = [ ] for yIntersectionIndex in xrange ( 0 , len ( yIntersections ) , 2 ) : firstY = yIntersections [ yIntersectionIndex ] secondY = yIntersections [ ( yIntersectionIndex + 1 ) ] if ( firstY != secondY ) : firstComplex = complex ( x , firstY ) secondComplex = complex ( x , secondY ) endpointFirst = euclidean . Endpoint ( ) endpointSecond = euclidean . Endpoint ( ) . getFromOtherPoint ( endpointFirst , secondComplex ) endpointFirst . getFromOtherPoint ( endpointSecond , firstComplex ) endpoints . append ( endpointFirst ) endpoints . append ( endpointSecond ) return endpoints
get endpoints from the y intersections .