For context I am developing a ray-tracer for a computer science class, and want to implement some more advanced shapes than just spheres. So while this is related to schoolwork, I'm not asking you to do my work for me, the work is implementing the programming, and it's the math I don't understand, so I'm just looking for help understanding how the math works.
I am trying to understand how to calculate the intersection point, and the normal vector from that point, of several algebraic surfaces. I am at the very frustrating point of knowing what I need to do, and how it is theoretically done, but not really grasping how to actually do it.
I know that I need to take the equation for the line and substitute the x, y, and z variables in the surface equation for the equivalent portions of the line equation, but as soon as I sit down to do that, I immediately hit a mental brick wall. As for the normal calculations, I'm really lost, I'm not even sure there is a general case way to calculate the normals.
So, I'd love some help on how to calculate the intersection and normal of some of these shapes, and any sort of general case rules for these calculations would be fantastic.
Update While real general case solutions would be super awesome, it's ok to assume the shapes are in their standard orientation, not rotated or transformed at all - just positioned and (maybe) scaled. This make the problem much simpler, I believe. If there are other limitations you can use to make the problem even simpler, that's likely fine.