Resonant Cavities and Waveguides