Boxes are a bit more involved.
For a circle you use the distance between the points and the center of the circle. For a box you use the distance from the closest point on the edge of the box.
For a non rotated box you could get that point with:
X = clamp(p.x, box.bbleft, box.bbright)
Y = clamp(p.y, box.bbtop, box.bbbottom)
At least that’s a start. That gives points inside the box.
I’ve run out of time again. Time management for me is very poor lately.