Problem: Let $ABC$ be a triangle with orthocenter $H$ and
let $P$ be the second intersection of the circumcircle of
triangle $AHC$ with the internal bisector of $\angle BAC$.
Let $X$ be the circumcenter of triangle $APB$
and let $Y$ be the orthocenter of triangle $APC$.
Prove that the length of segment $XY$ is equal to
the circumradius of triangle $ABC$.

Solution: \begin{center}
\begin{asy}
  size(8cm);
  pair A = Drawing("A", dir(110), dir(110));
  pair B = Drawing("B", dir(210), dir(210));
  pair C = Drawing("C", dir(330), dir(330));
  draw(A--B--C--cycle);
  draw(unitcircle);
  pair Q = dir(30); // 330 + 1/2 * (330-210) (mod 360)
  Drawing("Q", Q, Q);
  pair P = A+C-A*C*conj(Q);
  P = Drawing("P", P, dir(Q-P));
  pair X = Drawing("X", circumcenter(A,P,B), dir(225));
  pair Y = Drawing("Y", orthocenter(A,P,C), dir(225));
  pair X1 = Drawing("X'", A+C-A*C*conj(X), dir(45));
  pair Y1 = Drawing("Y'", A+C-A*C*conj(Y), dir(45));
  Drawing("H", A+B+C, dir(170));
  draw(circumcircle(A,P,C));
  pair B1 = Drawing("B'", A+C-A*C*conj(B), dir(45));
  draw(A--Q--C--cycle);
  draw(X--Y);
  draw(X1--Y1);
  Drawing("O", origin, dir(45));
\end{asy}
\end{center}

We eliminate the floating orthocenter
by reflecting $P$ across $\ol{AC}$ to $Q$.
Then $Q$ lies on $(ABC)$ and moreover $\angle QAC = \tfrac 12 \angle BAC$.
This motivates us to reflect $B$, $X$, $Y$
to $B'$, $X'$, $Y'$ and complex bash with respect to $\triangle AQC$.
Obviously \[ y' = a + q + c. \]
Now we need to compute $x'$.
You can get this using the formula
\[ x' = a + \frac{(b'-a)(q-a)\left( \ol{q-a}-\ol{b'-a} \right)}{(b'-a)\ol{(q-a)}
  - \ol{(b'-a)}(q-a)}. \]
Using the angle condition we know
$b = \frac{c^3}{q^2}$, and then that
\[ b' = a+c - ac\ol b = a+c-\frac{aq^2}{c^2}. \]
Therefore
\begin{align*}
  x' &= a + \frac{\left( c-\frac{aq^2}{c^2} \right)\left( q-a \right)\left( \frac 1q - \frac 1a - \frac 1c + \frac{c^2}{aq^2}  \right)}{\left( c-\frac{aq^2}{c^2} \right)\left( \frac 1q - \frac 1a \right) - \left( \frac 1c - \frac{c^2}{aq^2} \right)\left( q-a \right)} \\
  &= a + \frac{\frac{c^3-aq^2}{c^2} \left( q-a \right)\left( \frac 1q - \frac 1a - \frac 1c + \frac{c^2}{aq^2} \right)}{-\frac{c^3-aq^2}{c^2}\frac{q-a}{qa} + \frac{c^3-aq^2}{aq^2c}(q-a)} \\
  &= a + \frac{\frac 1q - \frac 1a - \frac 1c + \frac{c^2}{aq^2}}{-\frac{1}{qa} + \frac{c}{aq^2}} \\
  &= a + \frac{c^2-q^2 + aq-\frac{aq^2}{c}}{c-q} \\
  &= a + c + q + \frac{aq}{c}
\end{align*}
whence
\[ \left\lvert x'-y' \right\rvert
  = \left\lvert \frac{aq}{c} \right\rvert
  = 1. \]