Theory:

In this section, we will learn how the light gets refracted through a rectangular glass slab.
 
Consider a glass slab, a substance or sheet made of glass material with three dimensions: length, breadth, and height, and it is in cuboidal shape.
 
Glass slab does not deviate, nor does it disperse the light rays whenever passing through it. This suggests that the incident and the emergent ray emerging from the glass slab are parallel. The glass slab only creates a lateral or sideways shift or displacement to the direction of light.
 
Refraction_through_a_rectangular_glass_slab.png
Refraction through a rectangular glass slab
 
The above figure shows that the refraction or bending of light rays through a glass slab occurs at the two equal and parallel and opposite surfaces.
 
We can observe that the incident ray that falls on one of the parallel surfaces of the slab first undergoes refraction at the AB surface, and the refracted ray bends towards the normal.
 
Again, it is an incident on the other surface equal to the first one, which is DC. Through a glass slab, the light before reaching the air again undergoes refraction two times. The second time, the refracted ray deviates away from the normal. If the light is incident at right angles, it will pass through the glass slab without any deviation.
 
We can observe, the emergent ray has emerged parallel to the incident ray of light at the beginning. This is a unique property of a glass slab as it has two opposite and parallel equal surfaces from which the rays emerge.