Example 7 Given the set $A=\left\{z \mid z^{2 n-1}=\bar{z}, z \in \mathbf{C}, n \in \mathbf{N}, n \geqslant 2\right\}$, on the complex plane, how many right triangles can be formed with the points corresponding to the complex numbers in $A$ as vertices?
Solve the equation $z^{2 \pi-1}=\bar{z}$ first. Clearly, $z=0$ is a solution. When $z \neq 0$, $z^{2 n}=|z|^{2}$. Let $z=r(\cos \theta+i \sin \theta)(r>0)$. Then we have $r^{2 n} \cos 2 n \theta=r^{2}, \sin 2 n \theta=0$. Thus, $r=1, \theta=\frac{k \pi}{n}, k=0,1,2, \cdots, 2 n-1$.

In summary, $A=\left\{0,1, \mathrm{q}, \mathrm{q}^{2}, \cdots, \mathrm{q}^{2 \mathrm{n}-1}\right\}$, where $\mathrm{q}=\cos \frac{\pi}{n}+\mathrm{i} \sin \frac{\pi}{n}$. It is easy to see that these $2 n+1$ solutions correspond to the origin and the vertices of a regular $2 n$-sided polygon (denoted as $A_{0} A_{1} A_{2} \cdots A_{2 n-1}$). Clearly, the internal angles of $\triangle O A_{i} A_{j}$ with $A_{i}, A_{j}$ as vertices are all acute. We consider two cases.

Case one: Right-angled triangles with $O$ as the right-angle vertex. Such right-angled triangles exist if and only if $n$ is even. In this case, there are $2 n$ such right-angled triangles.

Case two: Right-angled triangles where $O$ is not the right-angle vertex. Since the vertices $A_{0}, A_{1}, \cdots, A_{2 n-1}$ can determine $n$ diameters, $2 n(n-1)$ right-angled triangles can be formed.

Therefore, the total number of right-angled triangles is: when $n$ is odd, there are $2 n(n-1)$; when $n$ is even, there are $2(n-1) n+2 n=2 n^{2}$.