<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_parameters(self, hwr_obj):
 """ Take a list of points and calculate the factors for scaling and moving it so that it's in the unit square. Keept the aspect ratio. Optionally center the points inside of the unit square. """

        a = hwr_obj.get_bounding_box()

        width = a['maxx'] - a['minx'] + self.width_add
        height = a['maxy'] - a['miny'] + self.height_add

        factor_x, factor_y = 1, 1
        if width != 0:
            factor_x = self.max_width / width

        if height != 0:
            factor_y = self.max_height / height

        factor = min(factor_x, factor_y)
        addx, addy = 0.0, 0.0

        if self.center:
            # Only one dimension (x or y) has to be centered (the smaller one)
            add = -(factor / (2.0 * max(factor_x, factor_y)))

            if factor == factor_x:
                addy = add
                if self.center_other:
                    addx = -(width * factor / 2.0)
            else:
                addx = add
                if self.center_other:
                    addy = -(height * factor / 2.0)
        assert factor > 0, "factor > 0 is False. factor = %s" % str(factor)
        assert isinstance(addx, float), "addx is %s" % str(addx)
        assert isinstance(addy, float), "addy is %s" % str(addy)
        assert isinstance(a['minx'], (int, float)), "minx is %s" % str(a['minx'])
        assert isinstance(a['miny'], (int, float)), "miny is %s" % str(a['miny'])
        assert isinstance(a['mint'], (int, float)), "mint is %s" % str(a['mint'])
        return {"factor": factor, "addx": addx, "addy": addy,
                "minx": a['minx'], "miny": a['miny'], "mint": a['mint']}