A conditional for mouse region.

I would like to make a conditional indicating that the mouse is within the zone referenced by two coordinates. The area would look like is being represented in green in the image below:


The illustrated line (blue) can rotate 360 degrees. So the value of X1 can be in front or behind of X2, the same for Y1 and Y2.

I Think if I make this conditional operation:
if X1<Xm<X2 or X2<Xm<X1 or Y1<Ym<Y2 or Y2<Ym<Y1:

I obtain the expected result. (Edit: I did not obtain :frowning:)

There is a way to make an even smaller conditional? With fewer 'or’s?

I have to correct something I said earlier:
The conditional have to indicate that the mouse is in the gray area, not green.
In other words, the opposite of: β€œif X1<Xm<X2 or X2<Xm<X1 or Y1<Ym<Y2 or Y2<Ym<Y1:”

How to do this?