Example 8 The ratio of the distance from point $P$ to fixed points $A$ and $B$ is $\frac{n}{m}$, find the locus of point $P$.

 untranslated text remains in its original format and line breaks are preserved.
Let the line $AB$ be the $x$-axis, and let the coordinates of $A$ and $B$ be $(a, 0)$ and $(b, 0)$, respectively. Let the coordinates of point $P$ be $(x, y)$. Then, $m^{2}\left[(x-a)^{2}+y^{2}\right]=n^{2}\left[(x-b)^{2}+y^{2}\right]$ or it can be transformed into $\left(m^{2}-n^{2}\right)\left(x^{2}+y^{2}\right)-2\left(a m^{2}-b n^{2}\right) x+m^{2} a^{2}-n^{2} b^{2}=0$. This is a circle with center $D\left(\frac{a m^{2}-b n^{2}}{m^{2}-n^{2}}, 0\right)$. This circle intersects the $x$-axis at points $E\left(\frac{m a+n b}{m+n}, 0\right)$ and $F\left(\frac{m a-n b}{m-n}, 0\right)$. These two points are the internal and external division points of segment $AB$ $\left(\frac{A E}{E B}=\frac{A F}{B F}=\frac{n}{m}\right)$, and $D$ is the midpoint of segment $EF$. The radius of $\odot D$ is $\frac{1}{2}\left(\frac{m a-n b}{m-n}-\frac{m a+n b}{m+n}\right)=\frac{m n(a-b)}{m^{2}-n^{2}}$.