.. py:module:: box The class Box ============= The class :py:class:`Box` Box represents 2D bounding boxes of the 2D space. .. py:class:: Box(xmin, ymin, xmax, ymax) .. rubric:: Public methods: .. py:attribute:: xmin the x coordinate of the bottom left vertex of the box (:py:class:`float` or :py:class:`int`) .. py:attribute:: ymin the x coordinate of the bottom left vertex of the box (:py:class:`float` or :py:class:`int`) .. py:attribute:: xmax the x coordinate of the top right vertex of the box (:py:class:`float` or :py:class:`int`) .. py:attribute:: ymax the y coordinate of the top right vertex of the box (:py:class:`float` or :py:class:`int`) .. py:attribute:: width the width of the box .. py:attribute:: height the height of the box .. rubric:: Methods: .. py:method:: aspect_ratio() Returns the ratio width/height of the box .. py:method:: fitting_window(asp) Returns the smallest Box enclosing the box centered that has the given aspect ratio The class suports the method :py:class:`str`. The class :py:class:`Box` is partially implemented in the file :download:`box.py `. You just have to implement the method :py:meth:`fitting_window`. You can pass the tests of the following test files :download:`test-box.txt `.