Let $A(-2;-2)$ and $B(4;4)$ are vertices of the square $ABCD$. If the intersection of the diagonals of the square lies in the second quadrant, find its coordinates.
I am not sure what exactly we are supposed to use in order to find the center $O$ of the square.
I found that the equation of the line through $A,B$ is $$AB:y=x$$ $AD$ lies on a line perpendicular to $AB$ and passing through $A$, so it has an equation $$AD:y=-x+n$$ and $-2=2+n\Rightarrow n=-4\Rightarrow AB:y=-x-4.$. Therefore we can write the coordinates of $D$ as $D=(x;-x-4)$. $O$ is the midpoint of $BD$, so $O=\left(\dfrac{x+4}{2};\dfrac{-x}{2}\right)$. Now $\vec{OA}.\vec{OB}=0$ and from here we can actually find $x$ and from there the coordinates of $O$, but I seem to always mess up the calculations as I got $x=-16$ or $x=0$ which isn't the case (we can see it from the diagram). Is there something more direct?
