Prism-Like Behavior at Terahertz Frequencies of a 2D Metallic Grid with a Varying Periodicity