Hi guys, quick question on the plane equation and finding if a point is on a plane or not.
Given a plane defined by a normal (ABC) and a distance from origin (D). I've read articles describing that a point is on the plane if it satisfies the plane equation:
Ax + By + Cz + D = 0
mathematical, Dirk already gave a good answer to your question, but I wanted to stress that it is a good idea to try to work "coordinate free." I.e. where possible, avoid formulas that expose the x, y, z coordinates, like the above "plane equation" does. Instead, like Dirk said (and as I also discuss in my book), it's better to consider planes as being defined by the set of vectors that are perpendicular to the plane normal, and that have an "origin" defined by any point on the plane.
In other words, let N be the plane normal, let P be any point on the plane, and let X be all other points on the plane. Then we can express this relationship as:
Dot(N, X - P) = 0.
I.e. the vectors N and X - P need to be perpendicular.
You can expand that expression in two ways:
Dot(N, X - P) = Dot(N, X) - Dot(N, P) = ... = n.x * x.x + n.y * x.y + n.z * x.z - d
Dot(N, X - P) = Dot(N, X) + Dot(N, -P) = ... = n.x * x.x + n.y * x.y + n.z * x.z + d
Which is why you see the expanded explicit-coordinate plane equation sometimes with '-' and sometimes with '+'. Both are correct, and the difference is just that the 'd' constant is negated between the two expressions.
Hope that helps.