def buoy_distance(pixel_width, focal_length, ACTUAL_WIDTH=0.4):
    """ Calculates the distance of the buoy from the boat.
    
    The algorithm uses the similar triangles in the following equation:
    (focal_len / pixel_width) = (actual_distance / actual_width)

    Keyword arguments:
    pixel_width -- The width of the buoy in pixels
    focal_length -- The focal length of the camera in pixels
    ACTUAL_WIDTH -- The actual width of the buoy in desired units (default 0.4m)

    Returns:
    distance -- The distance of the buoy in the units of the ACTUAL_WIDTH
    """
    return focal_length * ACTUAL_WIDTH / pixel_width