def rescale_rectangle(top_left, sides, ratio):
    """
    Rescale rectangle, leaving its center point unchanged

    Parameters
    ----------
    top_left : (float, float)
        (x,y) coordinates of rectangle top left corner
    sides : (float, float)
        (x,y) lengths of rectangle sides
    ratio : float
        Rescale value

    Returns
    -------
    (float, float), (float, float)
        Rescaled top left corner coordinates, rescaled lengths of sides
    """
    rescaled_top_left = (top_left[0] + sides[0] / 2.0 - sides[0] / 2.0 * ratio,
                         top_left[1] + sides[1] / 2.0 - sides[1] / 2.0 * ratio)
    rescaled_sides = (sides[0] * ratio, sides[1] * ratio)
    return rescaled_top_left, rescaled_sides