All of the points which are equidistant from 2 points are on the perpendicular bisector of the line segment joining the points.
The slope of the perpendicular bisector is -1/3.
The midpoint is (1/2.3/2)
The equation of the perpendicular bisector is y = (5-x)/3
Now you need to decide what the limits of x are so that the line stays within the specified square.
If you don't know how to do the steps needed for each of the steps I listed, make a comment and I will try to help further.