In this post I’m going to explain how to classify a point with respect a plane, that is, given a certain plane and a point, we will see how to decide whether the point is laying on the plane surface, or it is located on the positive or negative half-spaces defined by the plane.
Given a plane:
A normal vector to the plane is given by:
And D is a parameter specifying the distance from the origin (0,0,0) to the plane. D has the following properties:
- It represents the shortest (orthogonal) distance from the plane to the origin.
- It is signed: D is positive if the origin is in the positive half of the plane (meaning that the normal vector points torwards it), and negative otherwise.
- It is scaled: according to the magnitude of the normal vector. One has to divide D by the magnitude of the normal vector in order to obtain the real distance from the origin (that is, with respect to the canonical base).
Now, given a point p, we can consider a vector from the origin to p:
And we can obtain the distance, restricted to the axis of the plane normal, from this vector point to the origin by projecting it onto the plane normal:
Then, we can classify p with respect to the plane based on D and Dp. It can belong to the plane, or it can either lay on the negative or positive half side of the plane:
Finally, we can compute the signed distance from p to the plane: