Reflection involves the generation of recursive secondary rays. The algorithm for reflection is based upon the physical model, which is described in [Serway 1990]. Using the normal to the surface, I calculate the reflected ray in the following way:
Reflection rays are secondary, and thus could potentially bounce through the scene forever. To stop that from happening, I impose a limit on the depth of secondary rays which can be generated.
The source for reflection can be found in the file render.c, in the function ReflectRay.