Function to check if the third point forms a rectangle with other two points at corners
static bool isBetween ( int a , int b , int c ) { return ( Math . Min ( a , b ) <= c && c <= Math . Max ( a , b ) ) ; }