I am trying to write a ray tracer for a school research project and I am running into some strange issues with my code.

Normally I would be fairly confident I could figure out what is going wrong...