Example 4 (29th Russian Olympiad) Find all angles $\alpha$ such that the set $\{\sin \alpha, \sin 2 \alpha, \sin 3 \alpha\}=\{\cos \alpha, \cos 2 \alpha, \cos 3 \alpha\}$.
Analysis We use the unordered nature of the elements in the set to solve the problem.
Solution Since $2 \pi$ is the period of all the functions involved, let $\alpha \in[0,2 \pi)$. From the given, we have:
$$
\begin{array}{l}
\sin \alpha+\sin 2 \alpha+\sin 3 \alpha=\cos \alpha+\cos 2 \alpha+\cos 3 \alpha \\
\quad \Rightarrow 2 \sin 2 \alpha \cos \alpha+\sin 2 \alpha=2 \cos 2 \alpha \cos \alpha+\cos 2 \alpha \\
\quad \Rightarrow \sin 2 \alpha(2 \cos \alpha+1)=\cos 2 \alpha(2 \cos \alpha+1) \\
\Rightarrow(\sin 2 \alpha-\cos 2 \alpha)(2 \cos \alpha+1)=0
\end{array}
$$

If $2 \cos \alpha+1=0 \Rightarrow \cos \alpha=-\frac{1}{2}$, which, upon verification, does not satisfy the conditions of the problem;
If $\sin 2 \alpha-\cos 2 \alpha=0 \Rightarrow \tan 2 \alpha=1 \Rightarrow \alpha=\frac{\pi}{8}, \frac{5}{8} \pi, \frac{9}{8} \pi, \frac{13}{8} \pi$
Also, $\sin \alpha \sin 2 \alpha \sin 3 \alpha=\cos \alpha \cos 2 \alpha \cos 3 \alpha$, and $\sin 2 \alpha=\cos 2 \alpha$
So $\cos 4 \alpha=0$, hence $\alpha=\frac{k \pi}{2}+\frac{\pi}{8} \quad(k=1,2, \cdots, 8)$
Upon verification: $\alpha=\frac{k \pi}{2}+\frac{\pi}{8}(k \in \mathbf{Z})$ satisfies the conditions of the problem.