Function to check if the third point forms a rectangle with other two points at corners
< ? php function isBetween ( $ a , $ b , $ c ) { return min ( $ a , $ b ) <= $ c and $ c <= max ( $ a , $ b ) ; }