83.5k views
1 vote
Take as input two opposite corners of a rectangle: (x1,y1) and (x2,y2). Finally, the user is prompted for the coordinates of a third point (x,y). Find whether the point (x,y) lies inside the rectangle.

1 Answer

2 votes

Answer:

The answer is a point
(x,y) / x1\leq x\leq x2    ,  y1\leq y\leq y2

Explanation:

That happens because the points you have are in opposite corners, which means that they are the limits of the rectangle. so any point inside the rectangle is between that segment

User El Hoss
by
5.3k points