In order that the four points form arectangle, they must be symmmetric about the vertex. Your method worked for has vertex (0, 0).

Complete the square in to determine the vertex, . You want to find "h" so that the distance from to , 2h, is the same as the height