This function checks if the two input intervals oferlap and outputs the corresponding pattern (up, down, or straight) based on that.
This function checks if the two input intervals oferlap and outputs the corresponding pattern (up, down, or straight) based on that.