The class Box¶
The class Box Box represents 2D bounding boxes of the 2D space.
- class box.Box(xmin, ymin, xmax, ymax)¶
Public methods:
- width¶
the width of the box
- height¶
the height of the box
Methods:
- aspect_ratio()¶
Returns the ratio width/height of the box
- fitting_window(asp)¶
Returns the smallest Box enclosing the box centered that has the given aspect ratio
The class suports the method
str.
The class Box is partially implemented in the file box.py. You just have to implement the method fitting_window().
You can pass the tests of the following test files test-box.txt.