def arena_config(posx, posy, ppm, center=None, flip_y=True):
    """
    This function will convert the position values from the units of bits to centimeters. It will also center the arena
    around the point (0,0) if you provide a center value. I have added a flip_y keyword argument because the Tint
    program flips the y values so I will allow you to flip the values as well (or not).

    :param posx:
    :param posy:
    :param arena:
    :param conversion:
    :param center:
    :param flip_y: bool value that will determine if you want to flip y or not. When recording on Intan we inverted the
    positions due to the camera position. However in the virtualmaze you might not want to flip y values.
    :return:
    """
    if center is not None:
        posx = 100 * (posx - center[0]) / ppm
    else:
        posx = 100 * posx / ppm
    if flip_y:
        if center is not None:
            posy = 100 * (-posy + center[1]) / ppm
        else:
            posy = 100 * -posy / ppm
    elif center is not None:
        posy = 100 * (posy + center[1]) / ppm
    else:
        posy = 100 * posy / ppm
    return posx, posy
