def getYIntersectionInsideYSegment(segmentFirstY, segmentSecondY, beginComplex, endComplex, x):
 yIntersection = euclidean.getYIntersectionIfExists(beginComplex, endComplex, x)
 if (yIntersection == None):
  return None
 if (yIntersection < min(segmentFirstY, segmentSecondY)):
  return None
 if (yIntersection <= max(segmentFirstY, segmentSecondY)):
  return yIntersection
 return None

def getYIntersectionInsideYSegment ( segmentFirstY , segmentSecondY , beginComplex , endComplex , x ) : yIntersection = euclidean . getYIntersectionIfExists ( beginComplex , endComplex , x ) if ( yIntersection == None ) : return None if ( yIntersection < min ( segmentFirstY , segmentSecondY ) ) : return None if ( yIntersection <= max ( segmentFirstY , segmentSecondY ) ) : return yIntersection return None
get the y intersection inside the y segment if it does .