Solve the problem in C++ (Geometry: find the bounding rectangle) A bounding rectangle is the minimum rectangle that encloses a set of points in a two-dimensional plane, as shown in Figure 11.9d. Write a function that returns a bounding rectangle for a set of points in a two-dimensional plane, as follows: const int SIZE = 2; Rectangle2D getRectangle(const double points[][SIZE]); Write another function that returns a pointer to the bounding rectangle as follows: Rectangle2D* getRectanglePointer(const double points[][SIZE]); The Rectangle2D class is defined in Programming Exercise 11.9. Write a test program that prompts the user to enter five points and displays the bounding rectangle’s center, width, and height. Sample Run Enter five points: 1.0 2.5 3 4 5 6 7 8 9 10 The bounding rectangle’s center (5.0, 6.25), width 8.0, height 7.5
Solve the problem in C++
(Geometry: find the bounding rectangle)
A bounding rectangle is the minimum rectangle that encloses a set of points in a two-dimensional plane, as shown in Figure 11.9d.
Write a function that returns a bounding rectangle for a set of points in a two-dimensional plane, as follows:
const int SIZE = 2;
Rectangle2D getRectangle(const double points[][SIZE]);
Write another function that returns a pointer to the bounding rectangle as follows:
Rectangle2D* getRectanglePointer(const double points[][SIZE]);
The Rectangle2D class is defined in
Write a test program that prompts the user to enter five points and displays the bounding rectangle’s center, width, and height.
Sample Run
Enter five points: 1.0 2.5 3 4 5 6 7 8 9 10
The bounding rectangle’s center (5.0, 6.25), width 8.0, height 7.5
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 3 images