Another way to think about the calculation: D = ax + by + cz is dot(P,N) + d. A dot product between any point P and the normal vector of the plane gives us the distance from P to a plane that goes through the origin in the direction of N, then by adding the offset d we get the actual distance to the plane that we are interested in.

Another way to think about the calculation: D = ax + by + cz is dot(P,N) + d. A dot product between any point P and the normal vector of the plane gives us the distance from P to a plane that goes through the origin in the direction of N, then by adding the offset d we get the actual distance to the plane that we are interested in.