The Optical Response Of Rectangular Metallic Gratings And Metal/Dielectric Multilayers