Why must rays be shone in the centre of a flat surface? Describe the difficulty that's results if this is not done.

Your question must be in some specific context you did not share. Rays can be shown on any surface, curved, or flat, in the center or not.

We did an experiment of Snell's law of refraction and we shined a light through the centre of semicircular prism on a flat surface to measure the angle of refraction. That was one of our questions I didn't understand necessarily why.

In an experiment like that, the light beam (which I assume was a narrow laser beam) must strike midway between the edges of semicircular prism, so that it is refracted along a radius of the semicircle and strikes the semicircular surface at a right angle. In that matter, it is not refracted a second time, so the angle of refraction at the flat surface can easily be measured.

The word "matter" in my answer above should be "manner"

Rays are usually shone in the center of a flat surface due to a principle called the normal incidence. When light or any other form of radiation strikes a surface at an angle, it causes the rays to bend or refract. However, when the rays are directed perpendicularly or normal to the surface, they do not bend and travel straight through.

If rays are not shone in the center of a flat surface, it can result in a phenomenon called off-axis aberrations. This creates difficulties in imaging systems, such as telescopes or cameras, where the goal is to capture a clear and focused image.

Off-axis aberrations occur because different parts of a lens or mirror may have slight variations in curvature or shape, causing the rays to deviate from their expected path when they are not directed perpendicularly. This deviation can introduce several types of optical errors, including coma, astigmatism, distortion, and chromatic aberration. These errors can degrade the image quality, making it blurry, distorted, or creating color fringes.

To reduce these aberrations and obtain better image quality, it is crucial to direct the rays perpendicular to the surface. This is achieved by ensuring that the light source or radiation is positioned at the center of the flat surface, where the rays can pass through without deviating from their straight path.