to find Q we need to make 2 distance measure
that they fulfill these conditions
PS=RQ and RS=QP
the formula of distances between 2 points is
![\sqrt[]{(x2-x1)^2+(y2-y1)^2}](https://img.qammunity.org/2023/formulas/mathematics/college/lv29jygnvr92r2akqmo57wrhy4130lwc7w.png)
Distance PS
![\begin{gathered} \sqrt[]{(6-4)^2+(-1-(-5))^2} \\ \\ PS=\sqrt[]{20} \end{gathered}](https://img.qammunity.org/2023/formulas/mathematics/college/sknknz406zcbl9lj79jhngs3pfj6tu12n8.png)
Distance RQ
![\begin{gathered} \sqrt[]{(0-x)^2+(-1-y)^2} \\ \\ RQ=\sqrt[]{x^2+(1+y)^2} \end{gathered}](https://img.qammunity.org/2023/formulas/mathematics/college/k7kppptao9duntd9extry54ptazpeavpeo.png)
where x and y are de coordinates of Q
Distance RS
![\begin{gathered} \sqrt[]{(0-4)^2+(-1-(-5))^2} \\ \\ RS=\sqrt[]{32} \end{gathered}](https://img.qammunity.org/2023/formulas/mathematics/college/vliayh6w1i1tqllmpc56y920zzyfuwox2h.png)
Distance QP
![\begin{gathered} \sqrt[]{(x-6)^2+(y-(-1))^2} \\ \\ QP=\sqrt[]{(x-6)^2+(y+1)^2} \end{gathered}](https://img.qammunity.org/2023/formulas/mathematics/college/530kwx2vcjyprfy1qm2a6gc1xn4dh00oid.png)
now solve the equals
PS=RQ
![\begin{gathered} \sqrt[]{20}=\sqrt[]{x^2+(1+y)^2} \\ 20=x^2+(1+y)^2 \end{gathered}](https://img.qammunity.org/2023/formulas/mathematics/college/xn52fk1ywryp13ncle3cw6d2adhorxsxx5.png)
RS=QP
![\begin{gathered} \sqrt[]{32}=\sqrt[]{(x-6)^2+(y+1)^2} \\ 32=(x-6)^2+(y+1)^2 \end{gathered}](https://img.qammunity.org/2023/formulas/mathematics/college/z2i58plktj09wfmapkyo4h0stpmgctpjps.png)
if I subtract the two equations I will get

and i will solve to find x

the value of x is 2, then I can replace x on any equation to find y
so replacing

use factor to solve y
![\begin{gathered} y=\frac{-b\pm\sqrt[]{b^2-4ac}}{2a} \\ \\ y=\frac{-2\pm\sqrt[]{4+60}}{2} \\ \\ y=(-2\pm8)/(2) \\ \\ y=-1\pm4 \end{gathered}](https://img.qammunity.org/2023/formulas/mathematics/college/m5snd9ct5ujohi3sutwhubc4ifdakjg6bq.png)
then y will have two values

the real coordinate is y=3 because if is y=-5 the point dont form a rectangle
if x=2 and y=3 the point Q is (2,3)