def isLineIntersectingInsideXSegment(beginComplex, endComplex, segmentFirstX, segmentSecondX, y):
 xIntersection = getXIntersectionIfExists(beginComplex, endComplex, y)
 if (xIntersection == None):
  return False
 if (xIntersection < min(segmentFirstX, segmentSecondX)):
  return False
 return (xIntersection <= max(segmentFirstX, segmentSecondX))

def isLineIntersectingInsideXSegment ( beginComplex , endComplex , segmentFirstX , segmentSecondX , y ) : xIntersection = getXIntersectionIfExists ( beginComplex , endComplex , y ) if ( xIntersection == None ) : return False if ( xIntersection < min ( segmentFirstX , segmentSecondX ) ) : return False return ( xIntersection <= max ( segmentFirstX , segmentSecondX ) )
determine if the line is crossing inside the x segment .