Scattering theory and orthogonal polynomials