import math


def crop(pois, lat, long, max_dist):
    """
    Crop a list to points that are within a
    maximum distance of a center point.
    :param pois: list of lats and longs
    :param lat: center lat
    :param long: center long
    :param max_dist: max distance
    :return: a filtered list
    """
    # Convert from meters to radians:
    rad_dist = max_dist * math.cos(lat) / 111320
    crop_list = []
    for i in pois:
        if math.hypot(lat-i[0], long - i[1]) <= rad_dist:
            crop_list.append(i)
    return crop_list