Question: Python Programming, Python2 please. Python3 ok, but please state ( Geometry: find the bounding rectangle ) A bounding rectangle is the minimum rectangle that encloses

Python Programming, Python2 please. Python3 ok, but please state

(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 12.16. Write a method that returns a bounding rectangle for a set of points in a two-dimensional plane, as follows:

def getRectangle(points):

You defined the Rectangle2D class in Exercise 8.19. Write a test program that prompts the user to enter the points as x1 y1 x2 y2 x3 y3 ... in one line, and dis- plays the bounding rectangles center, width, and height. Here is a sample run:

Python Programming, Python2 please. Python3 ok, but please state (Geometry: find the

bounding rectangle) A bounding rectangle is the minimum rectangle that encloses a

*12.4 (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 12.16. Write a method that returns a bounding rectangle for a set of points in a two-dimensional plane, as follows: def getRectangle(points): You defined the Rectangle2D class in Exercise 8.19. Write a test program that prompts the user to enter the points as x1 yl x2y2x3 y3 in one line, and dis- plays the bounding rectangle's center, width, and height. Here is a sample run: Programming Exercises 431 Enter the points: 1.0 2.5 3 4 5 67 8 9 10 Enter The bounding rectangle is centered at (5.0, 6.25) with width 8.0 and height 7.5 FIGURE 12.16 Points are enclosed inside a rectangle

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!