Example 3.3.2 (League 2004) In an acute triangle $ABC$, the altitude $CE$ from $C$ to $AB$ intersects the altitude $BD$ from $B$ to $AC$ at point $H$. The circle with diameter $DE$ intersects $AB$ and $AC$ at points $F$ and $G$, respectively. $FG$ intersects $AH$ at point $K$. Given $BC=25, BD=20, BE=7$, find the length of $AK$.

---

The translation maintains the original text's formatting and structure.
To prove that points $F, E, D, G$ are concyclic, $\therefore \angle A F G=\angle E D G$.
Also, points $A, E, H, D$ are concyclic, $\therefore \angle A H E=\angle E D G$.
$\therefore \angle A F G=\angle A H E, \therefore F, E, H, K$ are concyclic.
Thus, we have
$$
A K=A F \cdot A E: A H=A G \cdot A D: A H=A G \cdot \cos \angle D A H.
$$

Also, points $B, C, D, E$ are concyclic, $\triangle A B D \sim \triangle A E G \sim \triangle A C E$.
$$
\begin{array}{c}
D E=B C \cdot \sin \angle D B E=25 \cdot A D: A B=25 \cdot A G: A E=25 \cdot A E: A C. \\
\therefore A G=A E^{2}: A C . C D=15, C E=24. \\
\text { Let } \quad A E=x, A D=y, x(x+7)=y(y+15), \\
A C^{2}=x^{2}+24^{2}, A B=20^{2}+y^{2}. \\
\because A B: A C=A D: A E, A B^{2} \cdot A E^{2}=A C^{2} \cdot A D^{2}, \\
\therefore\left(20^{2}+y^{2}\right) x^{2}=\left(x^{2}+24^{2}\right) y^{2}, 5 x=6 y,
\end{array}
$$

Solving (1) and (2), we get $x=18, y=15, A C=30, \cos \angle D A H=\cos \angle D B C=\frac{4}{5}$.
$$
\therefore A G=18^{2} / 30=54 / 5 . A K=216 / 25.
$$