I previously showed the derivation of how to determine the intersection of a plane and a cone. At the time I had to solve that equation, so after doing so I decided to publish it for anyone to use. Given the positive feedback, it seems this was useful, so I might as well continue with a few more.
Here is probably the most basic intersection: a ray and a plane. Solving it is straightforward, which I hope can be seen below. Like last time, I am using vector notation.
- We define a ray with its origin
and its direction as a unit vector .
Any point on the ray at a signed distance from the origin of the ray verifies: .
When is positive is in the direction of the ray, and when is negative is in the opposite direction. - We define a plane with a point
on that plane and the normal unit vector , perpendicular to the plane.
The distance between any point and the plane is . If this equality is not obvious for you, you can think of it as the distance between and along the direction. When , it means is on the plane itself. - We define
the intersection or the ray and the plane, and which we are interested in finding.

Since
A question to ask ourselves is: what about the division by
Note: There are several, equivalent, ways of representing a plane. If your plane is not defined by a point
Signed distance to a plane
For the sake of simplicity, in the above we defined the distance to the plane as an absolute value. It is possible however to define it as a signed value:
Distances that can be negative are called signed distances, and they are a foundation of Signed Distance Fields (SDF).