13 Given the ellipse $C: \frac{x^{2}}{a^{2}}+\frac{y^{2}}{b^{2}}=1(a>b \geqslant 0)$, its eccentricity is $\frac{4}{5}$, and the distance between the two directrices is $\frac{25}{2}$.
(1) Find the values of $a$ and $b$;
(2) Let point $A$ have coordinates $(6,0)$, and $B$ be a moving point on the ellipse $C$. Construct an isosceles right triangle $\triangle A B P$ with $A$ as the right-angle vertex (the letters $A, B, P$ are arranged in a clockwise direction). Find the equation of the locus of point $P$.
13 (1) Let $c$ be the focal radius of the ellipse, then
$$
\frac{c}{a}=\frac{4}{5}, \frac{a^{2}}{c}=\frac{25}{4}.
$$

Thus, we have $a=5, b=3$.
(2) Method one: Let the coordinates of point $B$ be $(s, t)$, and the coordinates of point $P$ be $(x, y)$. Then we have
$$
\overrightarrow{A B}=(s-6, t), \overrightarrow{A P}=(x-6, y).
$$

Since $\overrightarrow{A B} \perp \overrightarrow{A P}$, we have
$$
(s-6, t)(x-6, y)=(s-6)(x-6)+t y=0.
$$

Also, since $\triangle A B P$ is an isosceles right triangle, we have $|A B|=|A P|$, i.e.,
$$
\sqrt{(s-6)^{2}+t^{2}}=\sqrt{(x-6)^{2}+y^{2}}.
$$

From (1), we get
$$
s-6=-\frac{t y}{x-6} \Rightarrow(s-6)^{2}=\frac{t^{2} y^{2}}{(x-6)^{2}},
$$

Substituting into (2), we get $t^{2}=(x-6)^{2}$. Thus, $y^{2}=(s-6)^{2}$, i.e., $s=6+y$ (not valid, discard) or $s=6-y$. Substituting into the ellipse equation, we get the trajectory equation of the moving point $P$
$$
\frac{(x-6)^{2}}{9}+\frac{(y-6)^{2}}{25}=1.
$$

Method two: Let $B\left(x_{1}, y_{1}\right), P(x, y),|A B|=r$, then the parametric equation of the circle with $A$ as the center and $r$ as the radius is
$$
\left\{\begin{array}{l}
x=6+r \cos \alpha, \\
y=r \sin \alpha .
\end{array}\right.
$$

Let the angle between $A B$ and the positive direction of the $x$-axis be $\theta$, the parametric representation of point $B$ is
$$
\left\{\begin{array}{l}
x_{1}=6+r \cos \theta, \\
y_{1}=r \sin \theta,
\end{array}\right.
$$

and the parametric representation of point $P$ is

i.e.,
$$
\begin{array}{c}
\left\{\begin{array}{l}
x=6+r \cos \left(\theta-90^{\circ}\right), \\
y=r \sin \left(\theta-90^{\circ}\right),
\end{array}\right. \\
\left\{\begin{array}{l}
x=6+r \sin \theta, \\
y=-r \cos \theta .
\end{array}\right.
\end{array}
$$

From the above two equations, we get
$$
\left\{\begin{array}{l}
x_{1}=6-y \\
y_{1}=x-6
\end{array}\right.
$$

Since point $B$ is on the ellipse, we get the trajectory equation of point $P$
$$
\frac{(x-6)^{2}}{9}+\frac{(y-6)^{2}}{25}=1.
$$