First, let's write the distance formula:
Probably we should draw the points to get an image of what we have:
Then, we can calculate the distance between each point, so that we find out if all the sides are equal or different.
Since we have 2 pairs of sides with the same dimension, then we assume that it is a rectangle or a paralelogram.
We can get the slope of two lines in order to know if they are perpendicular or they have certain angle between each other.
Since the slopes are reciprocal and have different sign, we asure that both lines are perpendicular, therefore, we are talking about a rectangle.