Question: . Write a function that matches the following declaration int InRectangle( float pt[2], float rect[4]); Argument pt[2] defines a point on the plane: pt[0] is

. Write a function that matches the following declaration int InRectangle( float pt[2], float rect[4]); Argument pt[2] defines a point on the plane: pt[0] is the x-coordinate, pt[1] is the y-coordinate. Argument rect[4] defines a rectangle on the same plane. rect[0] and rect[1] define the x- and y- cordinates respectively of one corner of the rectangle. rect[2] and rect[3] define the opposite corner. Coordinates may be any valid floating point value, including negative values. The function returns int 0 (false) for any point that lies outside the rectangle, and 1 (true) for any other point (i.e. points inside and on the boundary of the rectangle)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
