Example 8 Given the sequences of real numbers $\left\{a_{n}\right\},\left\{b_{n}\right\}$, where all terms are non-zero, and $a_{n}=a_{n-1} \cos \theta-b_{n-1} \sin \theta, b_{n}=$ $a_{n-1} \sin \theta+b_{n-1} \cos \theta$, and $a_{1}=1, b_{1}=\tan \theta, \theta$ is a known number. Find the general formulas for $\left\{a_{n}\right\},\left\{b_{n}\right\}$.
Analysis Construct the complex number $z_{n}=a_{n}+b_{n} \mathrm{i}\left(n \in \mathbf{N}^{*}\right)$ and solve.
Solution Construct the complex number $z_{n}=a_{n}+b_{n} \mathrm{i}\left(n \in \mathbf{N}^{*}\right)$, then
$$
\frac{z_{n}}{z_{n-1}}=\frac{\left(a_{n-1} \cos \theta-b_{n-1} \sin \theta\right)+\left(a_{n-1} \sin \theta+b_{n-1} \cos \theta\right) \mathrm{i}}{a_{n-1}+\mathrm{i} b_{n-1}}=\cos \theta+\mathrm{i} \sin \theta \text {. }
$$

Therefore, $\left\{z_{n}\right\}$ is a geometric sequence with the first term $z_{1}=1+i \tan \theta$ and the common ratio $\cos \theta+\mathrm{i} \sin \theta$, so
$$
z_{n}=(1+\mathrm{i} \tan \theta)(\cos \theta+\mathrm{i} \sin \theta)^{n-1}=\sec \theta(\cos \theta+\mathrm{i} \sin \theta)^{n}=\sec \theta(\cos n \theta+\mathrm{i} \sin n \theta) \text {. }
$$

Thus, $a_{n}=\sec \theta \cos n \theta, b_{n}=\sec \theta \sin n \theta$.