  A spectral method using associated Legendre functions with algebraic mapping
is developed for a linear stability analysis of wake vortices. These functions
serve as Galerkin basis functions, capturing correct analyticity and boundary
conditions for vortices in an unbounded domain. The incompressible Euler or
Navier-Stokes equations linearised on a swirling flow are transformed into a
standard matrix eigenvalue problem of toroidal and poloidal streamfunctions,
solving perturbation velocity eigenmodes with their complex growth rate as
eigenvalues. This reduces the problem size for computation and distributes
collocation points adjustably clustered around the vortex core. Based on this
method, strong swirling $q$-vortices with linear perturbation wavenumbers of
order unity are examined. Without viscosity, neutrally stable eigenmodes
associated with the continuous eigenvalue spectrum having critical-layer
singularities are successfully resolved. The inviscid critical-layer eigenmodes
numerically tend to appear in pairs, implying their singular degeneracy. With
viscosity, the spectra pertaining to physical regularisation of critical layers
stretch out toward an area, referring to potential eigenmodes with wavepackets
found by Mao & Sherwin (2011). However, the potential eigenmodes exhibit no
spatial similarity to the inviscid critical-layer eigenmodes, doubting that
they truly represent the viscous remnants of the inviscid critical-layer
eigenmodes. Instead, two distinct continuous curves in the numerical spectra
are identified for the first time, named the viscous critical-layer spectrum,
where the similarity is noticeable. Moreover, the viscous critical-layer
eigenmodes are resolved in conformity with the $Re^{-1/3}$ scaling law. The
onset of the two curves is believed to be caused by viscosity breaking the
singular degeneracy.
