asked 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

answered
User El Hoss
by
8.3k points
Welcome to Qamnty — a place to ask, share, and grow together. Join our community and get real answers from real people.