If I have a ray defined by a starting point and a direction, and a plane defined by its normal and its distance from the origin, how can I tell if the plane is in front versus behind the ray?
By behind, I mean that if there had a second ray starting at the same point than the first but heading in the opposite direction, the plane would be behind the first ray if the second ray would hit the plane.
I'm assuming the base of the ray is not on the plane.
Translate everything so that you have a vector $n$ normal to the plane whose arrow tip lies on the base of the ray $r$. If $r\cdot n < 0$, then the ray is tipped "toward" the plane and will eventually intersect it. If $r\cdot n=0$, the ray is parallel to the plane. If $r\cdot n>0$ the ray is directed so that it will never hit the plane.