Artificial intelligent assistant

Finding which diagonal area of a rectangle you are in I am trying to calculate which diagonal half a user has clicked within a box using x and y co-ordinates. I have found out how to do this in one diagonal direction, but can't figure out how to change this to calculate the opposite way. In the top half of the image below I divide 200 by 100 and then work out which side is being clicked by finding out if the 'click X' divided by the 'click Y' is greater or less than the 'box width' divided by the 'box height'. $$width / height = 200 / 100 = 2$$ $$clickX / clickY = 150 / 80 = 1.875$$ It is the bottom half of that image I need to find out how to calculate, which is a change in the diagonal direction. ![enter image description here](

Your criteria for the first picture actually comes from the equation of the diagonal line $y=\frac{x}{2}$.

So the second picture works the same way. The equation of the other diagonal line is $y=100-\frac{x}{2}$. So the criteria will be $$\text{upper left corner: } x+2y<200\\\ \text{lower right corner: } x+2y>200$$

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 98748eea164ff89e68d0c72831d6db30