Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please answer in detail using CPP (C++) coding. please use a copy and paste format 2. Point in Rectangle A point in the Cartesian plane
Please answer in detail using CPP (C++) coding.
please use a copy and paste format
2. Point in Rectangle A point in the Cartesian plane can be represented by a its coordinate pair (x, y), whereas a rectangle can be represented by its 4 points. The diagram below illustrates a rectangle, represented by 4 blue points, and a red point (x, y), which could be anywhere on the plane. 9 8 (x4,44) (33,43) 7 6 2 (x,y) 5 4 3 2 (21, y1) (22,42) 1 0 1 2 3 4. 5 6 7 8 9 Your task is to write a program that takes in the coordinates of the rectangle, and the coordinates of the red point, and determines whether the point is inside the rectangle or not. If the point touches the edge of the rectangle. then it counts as inside. Think about what variables, and how many, you need to have in order to represent the rectangle and the point, and to be able to compute the correct answer. Your program for this exercise should be called point_in_rect.cppStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started