Finding the other two vertices of a square, given opposite vertices $(a, b)$ and $(c, d)$

Solution 1:

Translate the coordinate system so that the midpoint $(\frac{a+c}{2}, \frac{b+d}{2})$ maps to the origin. Then the vertices $(a,b)$, $(c,d)$ become $(a - \frac{a+c}{2}, b - \frac{b+d}{2}) = (\frac{a-c}{2}, \frac{b-d}{2}),$ and the other is simply the negative of this. Rotating them by $90^\circ$ gives $$\pm \left(\frac{d-b}{2}, \frac{a-c}{2}\right),$$ and then undoing the translation gives the claimed result.