import math


def pts_near(gt_bbx, pred_bbx, rad):  # change name
    """
    Determine if two points are within a radius.

    Parameters
    ----------
    gt_bbx : dict
            [centre_x, centre_y]
    pred_bbx : dict
            [centre_x, centre_y]
    Returns
    -------
    True or False
    """

    # create a box region where anything outside
    # the box is not within the radius (rad).
    if (abs(gt_bbx['centre_x'] - pred_bbx['centre_x']) > rad or
            abs(gt_bbx['centre_y'] - pred_bbx['centre_y']) > rad):
        pt_cls = False

    rad_sqrd = math.pow(rad, 2)
    # return true if the points are close
    pt_cls = bool(
        rad_sqrd > (math.pow(gt_bbx['centre_x'] - pred_bbx['centre_x'], 2) +
                    math.pow((gt_bbx['centre_y'] - pred_bbx['centre_y']), 2))
    )
    return pt_cls