Locus of a point on triangle side Let $P$ be a point on line segment $XY$. On the perpendicular line to $XY$ through $P$ lies point $Z$. Prove that for any position of $Z$ there is a unique point $Q$ on line segment $XZ$ for which $\angle ZYQ = \angle ZXY $. The perpendicular line on $XZ$ through $Q$ then always passes through the same (fixed) point $R$ on line segment $XY$, independent of the position of $Z$.  
From geogebra it seems that 
$$\angle ZSQ = \angle ZYQ =\angle ZXY  $$ and
$$\angle YZP = \angle YQS$$
$S$ is the intersection of $ZP$ and $QR$.
Holding $Z$ and shifting $Q$ on $XZ$ does not affect $\angle ZSQ$. 
 A: WLOG, suppose $XY$ is on the $x$-axis. Let us define points $X,Y$ as $(-a,0)$ and $(a,0)$, respectively. Then, $Z$ should be defined as point $(b,z)$. Additionally, point $Q=\left(q,-\frac{z}{a+b}\left(q+a\right)\right)$. For $a,b,z,q \in \Bbb R$.
We have the following equations for lines $XZ, QY$ and $ZY$
$$XZ: y=\frac{z}{a+b}\left(x+a\right)\qquad m_1=\frac{z}{a+b}\\
ZY:y=-\frac{z}{a-b}\left(x-a\right)\qquad m_2=-\frac{z}{a-b}\\
QY:y=-\frac{z(a+q)}{(a+b)(a-q)}\left(x-a\right))\qquad m_3=-\frac{z(a+q)}{(a+b)(a-q)}$$ 
Since we should have $\angle ZYQ=\angle ZXY$, we want the angle between lines $QY$ and $ZY$ be equal to $\angle ZXY$ Thus, we have:
$$\frac{m_2-m_3}{1+m_2m_3}=m_1$$
Substituting the slopes from the equations above, we get that $m_2$ should be:
$$m_2\to-\frac{2 a z (a+b)}{(a+b)^2 (a-q)-z^2 (a+q)}$$
However, we already know that $m_2=-\frac z{a-b}$, therefore:
$$-\frac{2 a z (a+b)}{(a+b)^2 (a-q)-z^2 (a+q)}=-\frac{z}{a-b}\\
q\to -\frac{a \left((a+b) (a-3 b)+z^2\right)}{(a+b)^2+z^2}\tag{1}$$
This gives us $q$ such that $\angle ZXY=\angle ZYQ$.

Now the line perpendicular to $XZ$ through $Q$ is defined by the line:
$$y=-\frac{a+b}{z}\left(x-q\right)+\frac{z}{a+b}\left(q+a\right)$$
Which has a zero of (i.e. $R=(x,0)$):
$$x\to \frac{z^2 (a+q)}{(a+b)^2}+q\tag{2}$$
Since we already know $q$, substituting $(1)$ in $(2)$, and we get:
$$\bbox[20px,border:1px black solid]{x\to-\frac{a (a-3 b)}{a+b}\implies
\therefore R \text{ is definitely invariant to } Z}$$
You can check this implementation.
A: 
$\triangle XYZ \sim \triangle YQZ$, therefore $QZ/YZ = YZ/XZ$.
$PQRZ$ is cyclic, therefore
$$PX \cdot RX = QX \cdot XZ = (QZ-XZ) \cdot XZ = YZ^2 - XZ^2 = \\
(PY^2 + PZ^2) - (PX^2 + PZ^2) = PY^2 - PX^2.$$
Note that the argument doesn't go through if both $\angle ZYQ$ and $\angle ZXY$ are taken in the clockwise direction, because the two triangles won't be similar. There is an implicit condition in the problem.
A: Solution
It's easy to have that the circumcircle of $\triangle QXY$ touches $ZY$ at $Y$,and $Z,P,Q,R$ are cyclic.
Hence, $$ZY^2=ZX \cdot ZQ=ZX \cdot (ZX+XQ)=ZX^2+ZX \cdot XQ=ZX^2+PX \cdot XR.$$
This shows that $$XR=\frac{ZY^2-ZX^2}{PX}=\frac{PY^2-PX^2}{PX}=\frac{PY^2}{PX}-PX.$$
Notice that $PX,PY$ are fixed length. Then the length of $XR$ is a constant. As a result, $R$ is a fixed point independent of $Z.$

